[PHP] Re: If statement question

2006-06-26 Thread Adam Zey
es. Alex. Stuff inside an if statement will be compiled (So it has to be free of syntax errors and such), but it won't be executed unless the condition is true. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: PHP 5, Windows, and MySQL

2006-06-26 Thread Adam Zey
oblem, have you checked the PHP docs on how to install MySQL support for PHP5 on Windows? http://www.php.net/manual/en/ref.mysql.php Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Strip outgoing whitespace in html

2006-06-26 Thread Adam Zey
day. Definitely worth the enormous bandwidth savings! Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] mail() returns false but e-mail is sent ?

2006-06-26 Thread Adam Zey
the return value of mail()? Trust me, we've all made stupid mistakes, they're nasty little buggers that can sneak in and ruin anyone's day; best to include it since it might be relevant. Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: rss feeds from db

2006-06-22 Thread Adam Zey
ant it there, do a search-replace for "¦" and either replace it with an alternative character (perhaps a ¦ directly), or an empty string to remove it entirely. Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Equivelant to mysql_fetch_row for normal array

2006-06-22 Thread Adam Zey
an array. You really should read the manual, the pages for all these functions describe EXACTLY what they do. Remember that mysql_fetch_array returns an associative array. You can refer to the SQL fields by their names. So if your select query was "SELECT foo, bar FROM mytabl

[PHP] Re: [MailServer Notification]Content Filtering Notification

2006-06-21 Thread Adam Zey
: [PHP] helping people... OK, this is just amusing. Somebody over at "AIT Batam" is obviously an idiot. Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: comparing a string

2006-06-21 Thread Adam Zey
Rafael wrote: (inline) Adam Zey wrote: Rafael wrote: A single "=" it's an assignment, not a comparison; and though it sometimes work, you shouldn't compare strings with "==", but using string functions, such as strcmp()... or similar_text(), etc. This is

Re: [PHP] helping people...

2006-06-21 Thread Adam Zey
t: http://www.php.net/unsub.php If somebody is sending you spam from one address over and over, USE A FILTER TO BLOCK THEM. Don't be an asshole and threaten to DDoS/attack their server. At that point you've just gone from being a victim to the bad guy, and you don't get a

Re: [PHP] For Loop

2006-06-20 Thread Adam Zey
er to read by doing $arr["p{$i}name"] even though the {} aren't required. It'd be a lot easier to read than concatenations :) Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: shutting down a web app for maintenance

2006-06-20 Thread Adam Zey
aintenance? Because otherwise, if you've denied all access to ANY of your webapp's php scripts, it shouldn't matter if the user has session data. If you physically move the web app's PHP scripts (Or set up a redirect, etc), they can't do anything with it. Regards

[PHP] Re: shutting down a web app for maintenance

2006-06-20 Thread Adam Zey
m everyday issues. If you wanted to get fancy, you could code your system to prevent new logins, expire normal logins much faster (Say, after 15 minutes instead of hours or days), and then wait for all users to be logged out before continuing. Regards, Adam Zey. -- PHP General Mailing List (

Re: [PHP] Paging Help

2006-06-20 Thread Adam Zey
of you guys. As a comment, it would have been better to do "SELECT COUNT(*) FROM foo" and reading the result rather than doing "SELECT * FROM foo" and then mysql_num_rows(). Don't ask MySQL to collect data if you're not going to use it! That actually applies to why

[PHP] Re: comparing a string

2006-06-20 Thread Adam Zey
ion the fact that it leads to harder to read code. Which of these has a more readily apparent meaning? if ( strcmp($foo,$bar) == 0 ) if ( $foo === $bar ) Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: running conditions while looping through arrays....

2006-06-19 Thread Adam Zey
{ # Mail is spam! Do something. } } Or something like that. I'm not exactly sure what your criteria are. What I'm doing above is looping through the mail messages one at a time, and checking all aspects of that email in each loop iteration. If you're doing complex analysis on each message, then that is probably the fastest way. If you're simply searching for things, you could always do array searches. So, search through $email with array_search or perhaps array_intersect. Then you don't need to loop at all. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Replacing text with criteria

2006-06-15 Thread Adam Zey
ositions. BTW, in functions like substr, specifying "-1" for length means keep going until the second to last character. Regards, Adam. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: How to run one php app from another?

2006-06-15 Thread Adam Zey
require_once(). Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: serving video files with php

2006-06-15 Thread Adam Zey
drain compared to just letting Apache handle the download itself. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: trapping fatal errors...?

2006-06-12 Thread Adam Zey
safer to handle errors before they happen by checking that you're in a good state before you try to do something. For example, nonexistent files can be handled by file_exists(). Undefined functions can be checked with function_exists(). Regards, Adam Zey. -- PHP General Mailing List

[PHP] Re: How to tell if a socket is connected

2006-06-12 Thread Adam Zey
times out or not. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] server sending notifications to clients

2006-06-08 Thread Adam Zey
kartikay malhotra wrote: Dear Adam, "You can do it without polling. I've seen web applications that open a neverending GET request in order to get updates to the browser instantaneously. Regards, Adam." Kindly elaborate on "neverending GET request". Shall I call the

Re: [PHP] server sending notifications to clients

2006-06-08 Thread Adam Zey
But since you don't want php files to execute forever you will have to stick to AJAX. You can do it without polling. I've seen web applications that open a neverending GET request in order to get updates to the browser instantaneously. Regards, Adam. -- PHP General Mai

[PHP] Re: running php method in the background

2006-06-08 Thread Adam Zey
lot easier to work with. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: file( ) function

2006-06-08 Thread Adam Zey
M. You might want to reexamine the need for your code. It appears that all your code does is searches through a file for a certain line. Do you need to do this manually? array_search() will replace your entire for loop with a single function call, and it'll almost certainly be faster

Re: [PHP] When is "z" != "z" ?

2006-06-06 Thread Adam Zey
7;t mean to sound harsh, but why are you still complaining about it? You've been shown to do exactly what you want, why is it still a problem? Heck, if you still really want to do < and > with strings, you can easily write your own functions to compare two strings using your own

Re: [PHP] Cannot read variables

2006-06-06 Thread Adam Zey
for an old badly written script, and in that case one has to question why they are running an old badly written script :) Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] If value is odd or not

2006-06-05 Thread Adam Zey
echo "$variable is ".($variable % 2 ?'even':'odd')."\n"; I'm not sure if you can nuke the whitespace in the modulus area or not. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] When is "z" != "z" ?

2006-06-05 Thread Adam Zey
tedd wrote: -TG: Thanks for your explanation and time. Normally, I don't alpha++ anything -- not to criticize others, but to me it doesn't make much sense to add a number to a character. But considering the php language is so string aware, as compared to other languages, I just tried it on

[PHP] Re: i have a problem inserting blob data larger than 1 mb

2006-06-05 Thread Adam Zey
longblob yet? They both have more capacity. I suggest you refer to the MySQL manual. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: SPL Iterator and Associative Array

2006-06-05 Thread Adam Zey
to develop on 5.0.5, put the code on 5.1.2, get a bunch of errors, and then have to develop again on 5.1.2 to fix the bugs. Not to mention that any testing done with 5.0.5 is invalid since you can't be sure that things will behave the same with the different production version. You may even waste time working around bugs in 5.0.5 that don't exist in 5.1.2. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Retrieving Content

2006-06-05 Thread Adam Zey
chris smith wrote: On 6/3/06, Adam Zey <[EMAIL PROTECTED]> wrote: Rodrigo de Oliveira Costa wrote: > I just discovered the problem I have to retrieve the output of the > site and not the url since its dynamic. Ca I do it like retrieve the > output of this url: > > www.tryou

[PHP] Re: Retrieving Content

2006-06-02 Thread Adam Zey
t_contents("http://www.tryout.com/1/2/";); Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Retrieving Content

2006-06-02 Thread Adam Zey
do it in PHP code so the performance benefits are slightly less. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Retrieving Content

2006-06-02 Thread Adam Zey
from. It might be faster, but it would probably end up being less flexible. Alternatively, if you need a super robust solution, you might want to look into actual HTML parsing libraries, like tidy (which has a PHP module). Regards, Adam Zey. -- PHP General Mailing List (http://www.php.ne

Re: [PHP] If value is odd or not

2006-06-02 Thread Adam Zey
s needed is a recipe for disaster. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Reading an XML outputting PHP file as XML

2006-06-02 Thread Adam Zey
ackticks operator. Note that simplexml_load_string() doesn't care about what type of file you reported it as (with Content-Type or something). It only cares that the string you pass it is XML. So if your script is the ONLY one that will ever get this XML, you don't need to bother with the content ty

Re: [PHP] ob_flush() problems

2006-05-31 Thread Adam Zey
ww.php.net/manual/en/function.flush.php for more information on obstacles to getting data to the client as it is generated. As an unrelated note, there is no point in using "print" for some things and "echo" for others. For your uses, you might as well just use "echo&

Re: [PHP] Executing functions or scripts in parallel

2006-05-30 Thread Adam Zey
>> > to execute my function servstatus(); in parallel with every hosts to >> > increase the speed ? >> > Thanks in advance. >> > >> > []'s >> > Felipe Martins >> > >> > >> Can you show us the function?

Re: [PHP] Using 'header' as redirect

2006-05-30 Thread Adam Zey
MB of HTML into some poor user's browser. If you're getting this data from a database, set a limit to how many records can be shown, and give the user a form to control the parameters of what data is returned. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Better method than stristr

2006-05-29 Thread Adam Zey
ke you're on very dangerous ground, letting users throw arbitrary SQL at your script. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] pop-up window in php???

2006-05-29 Thread Adam Zey
php PHP is a server-side language. It cannot directly influence anything on the client-side. That is why you need to have your PHP script output a client-side scripting language such as JavaScript. You are still only executing PHP code on the server. Regards, Adam Zey. -- PHP General Mailing

[PHP] Re: pop-up window in php???

2006-05-29 Thread Adam Zey
any help would be appreciated. thanks, Siavash This has nothing to do with PHP, this is a javascript matter. You PHP script merely prints out the javascript code. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] problems with regex

2006-05-29 Thread Adam Zey
ot;", $str); Or if you did want to replace them with a space: $str = str_replace(array("!". "?"), " ", $str); This is especially important if you're doing the string replace in a loop, but even if you aren't, it is very bad style to use regular expres

Re: [PHP] preg_replace learning resources? Regex tuts? Tips? (and yes, I have been rtfm)

2006-05-25 Thread Adam Zey
a "[a-z]", then the indicator will show it matching the next character, then if I add "*", the text selection will expand to show it matching the rest of the letters, and so on. Anyhow, I find the feedback as I write a regex to be addictively useful. Regards, Adam Zey. --

[PHP] Re: str_replace(), and correctly positioned HTML tags

2006-05-25 Thread Adam Zey
\n"), array("", "", "\n"), $text); So, to sum up my advice: 1) Don't create extra variables that you will never use 2) Consider using break tags instead of paragraph tags, they're easier to deal with in your situation. 3) Use arrays for replacement when appropriate 4) Don't store data if you're only ever going to echo it out right away and never use it again. I think that's it, unless I missed something. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How to disable PHP's POST caching?

2006-05-24 Thread Adam Zey
Curt Zirzow wrote: On Tue, May 23, 2006 at 06:37:27PM -0400, Adam Zey wrote: The data going from client->server needs to be sent over an HTTP connection, which seems to limit me to PUT and POST requests, since they're the only ones that allow significant quantities of data to be sen

[PHP] Re: Embedding PHP 5 in a C application

2006-05-24 Thread Adam Zey
gards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How to disable PHP's POST caching?

2006-05-24 Thread Adam Zey
Stut wrote: Adam Zey wrote: Tunelling arbitrary TCP packets. Similar idea to SSH port forwarding, except tunneling over HTTP instead of SSH. A good example might be encapsulating an IRC (or telnet, or pop3, or ssh, etc) connection inside of an HTTP connection such that incomming IRC traffic

Re: [PHP] How to disable PHP's POST caching?

2006-05-23 Thread Adam Zey
jekillen wrote: On May 23, 2006, at 3:37 PM, Adam Zey wrote: Essentially, I'm looking to write something in the same vein as GNU httptunnel, but in PHP, and running on port 80 serverside. The server->client part is easy, since a never-ending GET request can stream the data and be

[PHP] Re: how include works?

2006-05-23 Thread Adam Zey
do, say, require_once() twice, it ignores the second one. This is useful if your script might include the same file in different places (perhaps your main script includes two other scripts which both themselves include "functions.php") Regards, Adam Zey. -- PHP General Mailing Lis

Re: [PHP] How to disable PHP's POST caching?

2006-05-23 Thread Adam Zey
Mindaugas L wrote: I'm still new in php:) what about using cookies? nobody mentioned anything? store info in client cookie, and read it from server the same time? :)) On 5/24/06, *Adam Zey* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote: *snip*

[PHP] Re: Formatting of a.m. and p.m.

2006-05-23 Thread Adam Zey
lace your example: echo str_replace(array("am", "pm), array("a.m.", "p.m."), date("a")); And to do the replacement on a full data/time: echo str_replace(array("am", "pm), array("a.m.", "p.m."), date("g:i a")); which would output something like "12:52 p.m." Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How to disable PHP's POST caching?

2006-05-23 Thread Adam Zey
being sent on to the final destination. The idea is to get TCP tunneling working, once you do that you can rely on other programs to use that TCP tunnel for more complex things, like SOCKS. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Going through 2 arrays at once

2006-05-23 Thread Adam Zey
versity 225 South 6th Street, 9th Floor Minneapolis, MN 55402 www.capella.edu <http://www.capella.edu/> It sounds like you want to use a while loop and then iterate manually through both arrays, iterating both arrays once per loop iteration. Sorry if I've misunderstood the prob

Re: [PHP] How to disable PHP's POST caching?

2006-05-23 Thread Adam Zey
any buffering going on. My backup approach, as I described in another mail, involves client-side buffering and multiple POST requests. But that induces quite a bit of latency, which is quite undesirable. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] How to disable PHP's POST caching?

2006-05-23 Thread Adam Zey
g the data rather than splitting it up like that. Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How to disable PHP's POST caching?

2006-05-23 Thread Adam Zey
f breaking lots http protocols 'rules' while your at it. Regards, Adam Zey. As I mentioned in my more recent mail, this unfortunately isn't an option since I need to run on port 80 without disturbing the existing webserver, which requirse that the script be running through

Re: [PHP] How to disable PHP's POST caching?

2006-05-23 Thread Adam Zey
Richard Lynch wrote: On Tue, May 23, 2006 4:39 pm, Adam Zey wrote: The only other approach I can figure out is to send periodic POST requests with the latest data, the downside of which is a huge increase in latency between data production and consumption. Sounds like you maybe want

Re: [PHP] How to disable PHP's POST caching?

2006-05-23 Thread Adam Zey
Jochem Maas wrote: Adam Zey wrote: PHP seems to cache POST data, and waits for the entire POST to finish sending before it makes it available to php://input. I'd like to be able to read the post data from php://input while the client is still uploading it. How can I cause PHP to mak

[PHP] How to disable PHP's POST caching?

2006-05-23 Thread Adam Zey
stead of after the client finishes sending? Regards, Adam Zey. PS: As far as I can tell, PHP caches the entire POST in memory as it is being sent, but just doesn't make it available to php://input until after the client is done. Since PHP already has it in memory, why isn't it acces

Re: [PHP] echo'ing a variable and cat'ing text

2006-03-02 Thread Adam Williams
got it! i had to have my block of code look like this: if ( $file = file ( $filename ) ) { foreach ( $file as $line ) { if ( $line != "" ) { $line = trim($line); echo ( $line . "@mdah.state.ms.us" ); echo "\n"; } } } else { echo ( "

Re: [PHP] echo'ing a variable and cat'ing text

2006-03-02 Thread Adam Williams
John Nichel wrote: Well, you're not telling fgets how much to read for one, and I'd do this a different way to begin with... if ( $file = file ( $filename ) ) { foreach ( $file as $line ) { if ( $file != "" ) { echo ( $line . "@mdah.state.ms.us" ); } } } else

Re: [PHP] echo'ing a variable and cat'ing text

2006-03-02 Thread Adam Williams
Hi, I just tried that, didn't make a difference, still not getting my expected output. [EMAIL PROTECTED] wrote: [snip] echo "$thedata"."@mdah.state.ms.us"; [/snip] Try echo "$thedata".'@mdah.state.ms.us'; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www

[PHP] echo'ing a variable and cat'ing text

2006-03-02 Thread Adam Williams
I have a file called userlist. I'm trying to read the file, and then echo their name and add @mdah.state.ms.us with it. In the file userlist, it looks like: userabc userdef userxyz and I have the following code: But when I run it, I get: @mdah.state.ms.ususerabc @mdah.state.ms.ususerdef

Re: [PHP] working with ini files

2006-02-28 Thread Adam Ashley
t/package/Config all the hard work has been done for you. Adam Ashley signature.asc Description: This is a digitally signed message part

Re: [PHP] Limitation on PEAR : Spreadsheet_Excel_Writer

2006-02-12 Thread Adam Ashley
ives of pear-general. I know for sure it is in the pear-general archives as this question has been asked and answered many times. Adam Ashley signature.asc Description: This is a digitally signed message part

Re: [PHP] XML and htmlentities conditionally?

2006-01-29 Thread Adam Hubscher
Brian V Bonini wrote: On Sun, 2006-01-29 at 02:01, Adam Hubscher wrote: I have a block of XML that looks as follows: <*_~_*> Røyken VGS <*_~_*> My question is, can I in any way efficiently (i -stress- efficiently, if anyone read my previous XML and special characters post

[PHP] XML and htmlentities conditionally?

2006-01-28 Thread Adam Hubscher
I have a block of XML that looks as follows: <*_~_*> Røyken VGS <*_~_*> Now, if I run that block of XML through htmlentities, I will get the following: <*_!_*> Røyken VGS <*_~_*> XML parsers will return a problem, as there is both an unclosed tag and an invalid tag, in two places no less

Re: [PHP] XML and special characters

2006-01-28 Thread Adam Hubscher
Steve Clay wrote: Sunday, January 22, 2006, 10:10:54 PM, Adam Hubscher wrote: ee dee da da da? §ð <-- those that look like html entities are the represented characters. I was mistaken, they are html entities, Can you show us a small chunk of this XML that throws errors? You said you

Re: [PHP] XML and special characters

2006-01-22 Thread Adam Hubscher
Adam Hubscher wrote: tedd wrote: I've been having a tough time with parsing XML files and special characters. -snip- Any suggestions as to how I could get around this seemingly impossible road block thats been placed by what seems to be the xml engines :O.. Adam: I believe that

Re: [PHP] XML and special characters

2006-01-22 Thread Adam Hubscher
tedd wrote: I've been having a tough time with parsing XML files and special characters. -snip- Any suggestions as to how I could get around this seemingly impossible road block thats been placed by what seems to be the xml engines :O.. Adam: I believe that these "special"

[PHP] XML and special characters

2006-01-22 Thread Adam Hubscher
I've been having a tough time with parsing XML files and special characters. I have attempted every applicable engine, last try SAX, to attempt at parsing a (rather large, 17.8mb) xml file. The problem I hit, is when it hits a UTF8 encoded character. I've attempted at decoded the file before

[PHP] Schroedinger's Bug - may require exorcism...

2005-11-29 Thread Adam Atlas
* to debug something like this? Thanks for any help. -- Adam Atlas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Core dumps

2005-07-16 Thread Adam Currey
Hi all, new to the list, and a bit of a php cluebie. I know I'll omit some details that you'll need, so tell me what you need to know. I've been happily running mod_php4 (4.4.0) with apache 2.0.52 on FreeBSD 4.9 for quite some time, no problems. Today I tried to install phpBB from /usr/ports/w

[PHP] Dynamic Images and File Permissions

2005-07-14 Thread Adam Hubscher
I have a script that generates, creates, and updates dynamic banner images for users of a service. Recently I have run into a problem with file permissions... that has thoroughly annoyed me. I found a solution to fix the problem, however, it was then hit with another problem, and I'm not sure how

[PHP] Re: Echo array string index?

2005-07-13 Thread Adam Hubscher
Matt Darby wrote: I have an array setup as such: *$arr['generated text']='generated number';* What would be the best way to echo the key in a loop? Seems pretty easy but I've never attempted... Thanks all! Matt Darby I'm not sure I understand the question. You could do foreach($arr as $key =

[PHP] Dynamic Images and File Permissions

2005-07-13 Thread Adam Hubscher
I have a script that generates, creates, and updates dynamic banner images for users of a service. Recently I have run into a problem with file permissions... that has thoroughly annoyed me. I found a solution to fix the problem, however, it was then hit with another problem, and I'm not sure

Re: [PHP] Re: Session variables are not stored when set in implicitly calledconstructor!??

2005-04-19 Thread Adam
Hallo again, thank You for Your response. > > > > // singleton for request > > class Request { > > function __destructor() { > > $_SESSION["variable"] = "hallo"; > > The __destructor() method is supposed to be about killing the class > (Request). It's probably bad practice to be chang

[PHP] Session variables are not stored when set in implicitly called constructor!??

2005-04-16 Thread Adam
Hallo everybody, hope I am writing to correct mailinglist(^_^*)... I have troubles with sessions and descructor in php5. Can not set session variable in destructor when it's called implicitly. Do You know solution please? I think problem is that session is stored before imlicit object destruction *

[PHP] Redirection after login with security

2005-04-10 Thread Adam Hubscher
Synopsis: I am writing a management system for a MSSql database driven game, and I've run into an issue. The community site is located on a remote webserver, to protect the actual server from any possible vulnerabilities in the community application/forum application (as we all have seen the re

Re: [PHP] Socket_connect producing errors that show no reason

2005-01-17 Thread Adam Hubscher
Jochem Maas wrote: Adam Hubscher wrote: The code looks like this: if(($sock = socket_create(AF_INET,SOCK_STREAM,SOL_TCP)) < 0){ print("Couldn't Create Socket: " . socket_strerror(socket_last_error()). "\n"); } socket_set_option($sock, SOL_SOCKET,SO_RCVTIMEO, ar

[PHP] Socket_connect producing errors that show no reason

2005-01-17 Thread Adam Hubscher
The code looks like this: if(($sock = socket_create(AF_INET,SOCK_STREAM,SOL_TCP)) < 0){ print("Couldn't Create Socket: " . socket_strerror(socket_last_error()). "\n"); } socket_set_option($sock, SOL_SOCKET,SO_RCVTIMEO, array('sec' => 1, 'usec' => 0)); $output = ''; for($i = 0; $i < count($fil

[PHP] Re: $_POST

2005-01-17 Thread Adam Hubscher
Andrew Maxwell wrote: When you submit something, and you want to make sure that the user inputs all of the info, is there an easier way to do it than this: if ((!$_POST[name]) || !$_POST[pass]) || (!$_POST[blah])) { etc. } is there an easy way to check if all of the varibles have data in them?

Re: [PHP] Socket_Connect returning unusual error

2005-01-16 Thread Adam Hubscher
Richard Lynch wrote: Adam Hubscher wrote: Warning: socket_connect() expects parameter 3 to be long, string given in testing.php on line 21 Couldn't Create Socket: Success PHP usually auto-converts data -- However it's possible that this EXPERIMENTAL function (?) doesn't have the

[PHP] socket_connect errors

2005-01-16 Thread Adam Hubscher
Ok, I had made a post earlier but bout 5min later I figured out the problem (I had spaces and returns that were in the array beside the ports). The code looks like this: if(($sock = socket_create(AF_INET,SOCK_STREAM,SOL_TCP)) < 0){ print("Couldn't Create Socket: " . socket_strerror(socket_last_

[PHP] Socket_Connect returning unusual error

2005-01-16 Thread Adam Hubscher
Warning: socket_connect() expects parameter 3 to be long, string given in testing.php on line 21 Couldn't Create Socket: Success It actually spits that across for every socket I'm trying to connect. I'm doing an online status for multiple servers, which I have tested to work when I simply do a s

[PHP] socket_connect giving me weird error

2005-01-16 Thread Adam Hubscher
Warning: socket_connect() expects parameter 3 to be long, string given in testing.php on line 21 Couldn't Create Socket: Success It actually spits that across for every socket I'm trying to connect. I'm doing an online status for multiple servers, which I have tested to work when I simply do a s

Re: [PHP] Preventing execution without inclusion

2005-01-14 Thread Adam Hubscher
Thomas Goyne wrote: On Thu, 13 Jan 2005 16:25:30 -0600, Adam Hubscher <[EMAIL PROTECTED]> wrote: 1 (the preferred way): user accesses http://www.example.org/index.php?function=Join, this loads the class NewUser and begins its implementation. Because of the __autoload, it in

[PHP] Preventing execution without inclusion

2005-01-13 Thread Adam Hubscher
From within the application, I use one page to include classes/variables and so on. Is there a way (I may have been missing it in the documentation for PHP, however I didnt see anything related) to prevent a user from directly accessing/executing *.php by the file making sure taht it was only i

[PHP] Re: [PHP-XML-DEV] DomXPath and default XML namespaces

2004-12-13 Thread Adam Maccabee Trachtenberg
On Mon, 13 Dec 2004, Dan Phiffer wrote: > Adam Maccabee Trachtenberg wrote: > > > This is an XPath FAQ. Without a ns prefix, XPath doesn't choose > > elements living in the default ns, but ones living in no namespace. > > Are there any good references you might p

[PHP] Re: [PHP-XML-DEV] DomXPath and default XML namespaces

2004-12-13 Thread Adam Maccabee Trachtenberg
vable, what happens to: And /root/foo/qxx? Do you select qxx in the default ns? Or not? -adam -- [EMAIL PROTECTED] | http://www.trachtenberg.com author of o'reilly's "upgrading to php 5" and "php cookbook" avoid the holiday rush, buy your copies today! -

[PHP] grabbing source of a URL

2004-12-10 Thread Adam Williams
Hi, I don't know what functions to use so maybe someone can help me out. I want to grab a URL's source (all the code from a link) and then cut out a block of text from it, throw it away, and then show the page. For example, if I have page.html with 3 lines: hi this is line a this is line b

[PHP] RE: [SOLVED][PHP] Re: simple mail() question

2004-11-13 Thread Adam Fleming
Hi Manuel, That was *exactly* the issue. I can't express my gratitude for the assistance enough -Adam Original Message Follows From: Manuel Lemos <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: [PHP] Re: simple mail() question Date: Sat, 13 Nov 2004 19:21:18 -0200 Hell

[PHP] simple mail() question

2004-11-13 Thread Adam Fleming
Hello All, I have a simple mail() question, and I hope a hero can shed some light. I can't understand why my messages are being encoded, and extra headers are being added, *before* the message is sent through sendmail. Infinite Thanks, Adam Input: $more test.php Expected Result: $p

[PHP] stripping text from a string

2004-10-29 Thread Adam Williams
Hi, I use a piece of proprietary software at work that uses weird session ID strings in the URL. A sample URL looks like: http://zed2.mdah.state.ms.us/F/CC8V7H1JF4LNBVP5KARL4KGE8AHIKP1I72JSBG6AYQSMK8YF4Y-01471?func=find-b-0 The weird session ID string changes each time you login. Anyway, how c

[PHP] Good Class/API Design ?

2004-10-25 Thread Adam Reiswig
code and SimpleTest to test your code as it is written. These along with some XP techniques I read about seem like good practices to follow. Does anyone have any other ideas/practices that it would be good for a new oop developer like myself to make a habit it of? Thanks!! -- Adam Rei

Re: [PHP] fopen and http://

2004-10-08 Thread Adam Williams
On Fri, 8 Oct 2004, Hendrik Schmieder wrote: > What say phpinfo about Registered PHP Streams ? > >Hendrik > > Hi, I think I just figured out my problem...I had to use rtrim($line) because I think there was a \n or an invisible character at the end of the line that was being passed to

Re: [PHP] fopen and http://

2004-10-08 Thread Adam Williams
On Fri, 8 Oct 2004, Matt M. wrote: > > But I don't understand why I am getting that error about failed to open > > strem: HTTP request failed, when I can bring up the links fine in a > > browser on the server running the php script. So can anyone help me out? > > Thanks > > do you have allow_url

[PHP] fopen and http://

2004-10-08 Thread Adam Williams
Hi, I'm having a problem with fopen and http files. I keep getting the error: Warning: fopen(http://zed/htdocs/rgfindingaids/series594.html ) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/awilliam/public_html/rgfaidstest.php on line 15 http://zed

[PHP] opposite of array_unique()?

2004-08-04 Thread Adam Williams
array_unique() removes duplicate values from an array. Is there an opposite function or way of keeping all values in a single dimentional array that are duplicates and removing all that are duplicates? for example if I have an array: array( [0] => 'dog', [1] => 'cat', [2] => 'rabbit', [3] => '

<    1   2   3   4   5   6   7   8   9   10   >