[PHP] Sending / Receiving Cookies with Fopen??
Hello all. I have a problem to solve, but have no idea where to start.. I am writing a site right now that needs to read information from many other web pages on different domains (using fopen). However a few sites have given me the error: you need to have cookies enabled to view this page. This is because it is the PHP engine that is hitting the web page, and not my browser directly. The PHP engine does not support cookies as my browser does, thus I get this 'no cookies' error. Is there any way to make these web sites think I have cookies enabled? Can I send specific message headders that would mimic having cookies present? Or can I encode the cookies into the URL in some way? Or better yet, is there a way to allow PHP to accept cookies and send these back to the server every time I request a page? Thanks for any help. I have no idea were to turn next! Andrew -- FYII: The fopen type stuff I'm doing is.. $file = @fopen ($Hyperlink, r); while (!feof ($file)) { $line = fgets ($file, 1024); // yadda yadda yadda } fclose($file); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] libxml
Hi, I need to use PHP from cvs for other reasons. Anyway, libxml 2.3.9 - Configure wants a higher version (2.4.2). libxml 2.4.6 - Causes the trouble. libxml 2.4.2 - Wont build - dies after configre libxml 2.4.5 - same problem BTW, this error appears for xmltree calls. am wokring on clearing out bad redhate 7.1 libraries which may be causing conflicts, before attempting again. Its my poorly educated guess, that this may be the cause. Sean -Original Message- From: Tamas Arpad [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 24 October 2001 11:55 PM To: php; [EMAIL PROTECTED] Subject: Re: [PHP] libxml On Wednesday 24 October 2001 11:38, php wrote: Firstly, I use php 4.0.5 and libxml 2.3.9 on several machines without any problem. Older php and libxml combinations however caused many segmentation faults, especially with not well-formatted xmls. Are you sure that you warning message is related to libxml library? If you compile php without domxml the warning message disappears? Arpi thanks to those who replied to me last week about xmldom support with this error: Warning: Unknown list entry type in request shutdown (0) in Unknown on line 0 I've since tried a few combinations of versions of libxml, and expat (dont know if expat would matter), any was wondering if anyone who is using dom support correctly could tell me which versions work for them. Thank you, Sean -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] disable_functions not working in httpd.conf
Hey All, Was just trying the following and disable_functions is not working? Although safe mode and open_basedir are! What is really strange that when phpinfo is called the disable_functions value is phpinfo, can't seem to disable echo either, I don't want to put these in php.ini as I still want to be able to have a fully fledged php running from the main document root. VirtualHost * ServerAdmin [EMAIL PROTECTED] DocumentRoot /home/test/public_html ServerName test.foo.bar.com.au ErrorLog logs/test.foo.bar.com.au-error_log CustomLog logs/test.foo.bar.com.au-access_log common Directory /home/test/public_html AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps php_admin_value open_basedir /home/test/public_html php_admin_value user_dir /home/test/public_html php_admin_value disable_functions phpinfo php_admin_flag safe_mode On php_admin_value safe_mode_allowed_env_vars PHP_ php_admin_value safe_mode_protected_env_vars LD_LIBRARY_PATH php_admin_value sendmail_from [EMAIL PROTECTED] /Directory /VirtualHost What am I doing wrong, any suggestions welcome on the above conf too :) Thanks in advance, Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Regex problem
Hi there, I am camping with a little regular expressions problem... Problem: I want to check if $variable begins with a * (star), and it doesn't matter if it starts with plenty of spaces... My solution: ereg(^[:space:]*\*,$variable) But, it doesn't seem to work with the space part... The regex: ereg(^\*,$variable) does work, but that doesn't include spaces at the start... How can I extend this one so that it doesn't matter if there are a lot of spaces at the begin? Thanks in advance, Leon Mergen
[PHP] = 0 and = 0
why does ? $qty = 0 ; if ($qty != test) print qty is not test; ? work properly but not the following ? $qty = 0 ; if ($qty != test) print qty is not test; ? Thanks, Robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Regex problem
Hello Leon, try this if (preg_match(/^([[:space:]]*)?\*/s, $string)) { echo Match.; } else { echo No match; } James Leon Mergen [EMAIL PROTECTED] wrote in message 002f01c15d2a$e4ca3030$012aa8c0@leon">news:002f01c15d2a$e4ca3030$012aa8c0@leon... Hi there, I am camping with a little regular expressions problem... Problem: I want to check if $variable begins with a * (star), and it doesn't matter if it starts with plenty of spaces... My solution: ereg(^[:space:]*\*,$variable) But, it doesn't seem to work with the space part... The regex: ereg(^\*,$variable) does work, but that doesn't include spaces at the start... How can I extend this one so that it doesn't matter if there are a lot of spaces at the begin? Thanks in advance, Leon Mergen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] = 0 and = 0
Hello Robin, Very simple. :) RC ? $qty = 0 ; if ($qty != test) print qty is not test; ? $qty is string, so PHP compares 0 with test char by char. chr(0) isn't equal t. RC ? $qty = 0 ; if ($qty != test) print qty is not test; ? In this case $qty is integer value, so PHP tries to convert test to integer value [ integer(test) == 0], so last condition result is FALSE. Is it clear? RC Thanks, RC Robin -- Best regards, Vitali Falileev mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Regex problem
My solution: ereg(^[:space:]*\*,$variable) Try ereg(^[:space:]\**$,$variable) or ereg(^[ ]*\**$,$variable) or ereg(^[[:space:]]*\**$,$variable) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] = 0 and = 0
The only reason I could see that not working is if PHP is typecasting test to (int) in the second example... $qty = 0; (string) test = test; (string) 0 != test (evaluates true) $qty = 0; (int) test = 0; (when cast to int) 0 != 0 (evaluates false) e.g. By comparing an int to a string in the 2nd example, the string is casted to int, and the int cast of test is 0. -Original Message- From: Robin Chen [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 4:06 AM To: [EMAIL PROTECTED] Subject: [PHP] = 0 and = 0 why does ? $qty = 0 ; if ($qty != test) print qty is not test; ? work properly but not the following ? $qty = 0 ; if ($qty != test) print qty is not test; ? Thanks, Robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] = 0 and = 0
? $qty = 0 ; if ($qty != test) print (qty is not test); ? ? $qty = 0 ; if ($qty != test) printf(qty is not test); ? I just tested those two lines with php 4.0.6 and they both work. There is a difference though. If you set $qty=0; then $qty has no value. But if you set $qty=0, it has a value. Type casting is irrelevant in php. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] talking directly w/ MySql
On Wednesday 24 October 2001 14:33, _lallous wrote: I think that the MySql's API allow to many queries to be executed w/o having an open connection, example: SELECT 1+1; how can i issue such statments w/o opening a connection? like SELECT NOW() .. whenever I first run mysql_query() it tries to connect w/ default connection settings. try adding the mysql_telepathy extension (seriously - how should the data get to and from mysql without a connection?) -- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/) /* you are not expected to understand this */ - from the UNIX V6 kernel source -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Object sharing
On Wednesday 24 October 2001 15:35, Victor Hugo Oliveira wrote: Does anyone know a way to share an object with all sessions ? The idea is to access the same database connection poll. poll or pool? if pool: simply use persistent connections -- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/) /* you are not expected to understand this */ - from the UNIX V6 kernel source -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] = 0 and = 0
If you set $qty=0; then $qty has no value. Of course it has a value. The value is 0. Quite distinct from not having a value, or in proper terms, not being set. Try this: var_dump($qty); $qty = 0; var_dump($qty); Well, I will save you the trouble, it outputs: NULL int(0) Type casting is irrelevant in php. No they aren't. Try this: $qty = 0; if($qty==test) echo foo; if((string)$qty==test) echo bar; This will only output foo. Not bar. You could also use the === operator to force PHP to check not only the value but also the type. See http://www.php.net/manual/en/language.operators.comparison.php -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] = 0 and = 0
If you set $qty=0; then $qty has no value. Of course it has a value. No it doesn't have a value. PHP interprets 0 as null. A very easy way for you to check: $value=0; if(!$value) printf($value doesn't have a value (it didn't even print 0)br\n); $value=0 if($value) printf($value does have a value if I put 0 instead of 0br\n); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] is_int() and is_double
On Wednesday 24 October 2001 20:26, Michael George wrote: [...] The function is called after a form submission from HTML. When I enter 12 14 I get: --- lookupProduct( 12, 14 ) $partNum: 12 does appear to be a number, and not a double $serial: 14 does appear to be a number, and not a double --- When I enter 12.514.8 I get: --- lookupProduct( 12.5, 14.8 ) $partNum: 12 does appear to be a number, and not a double $serial: 14 does appear to be a number, and not a double --- Why is the function is_double() failing? I have an analagous problem with the is_int() function. You get both values as strings from the form. is_numeric checks if the variable is in some was a number (and returns true because it actually is a string representation of a number). is_int and is_double check whether the variable's current datatype actually is int or double See the manual. Possible solution: if (is_numeric ($a)) { $a = (double) $a; if (intval ($a) == $a) echo '$a' is integer; else echo '$a' is double; } -- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/) /* you are not expected to understand this */ - from the UNIX V6 kernel source -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Regex problem
$sNoSpaces = ltrim($variable); if ('*' == $sNoSpaces[0]) -- Regards, -- Calin Uioreanu [EMAIL PROTECTED] Tel: +49 - (0) 89 - 25 55 17 23 http://www.ciao.com -- Leon Mergen [EMAIL PROTECTED] wrote in message 002f01c15d2a$e4ca3030$012aa8c0@leon">news:002f01c15d2a$e4ca3030$012aa8c0@leon... Hi there, I am camping with a little regular expressions problem... Problem: I want to check if $variable begins with a * (star), and it doesn't matter if it starts with plenty of spaces... My solution: ereg(^[:space:]*\*,$variable) But, it doesn't seem to work with the space part... The regex: ereg(^\*,$variable) does work, but that doesn't include spaces at the start... How can I extend this one so that it doesn't matter if there are a lot of spaces at the begin? Thanks in advance, Leon Mergen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] = 0 and = 0
Thank you, that was it. I needed to test the variable against both an integer and a string, so I ended up using (string) when I need to compare a string. Rest of the time, it's an integer. Robin Rasmus Lerdorf wrote: If you set $qty=0; then $qty has no value. Of course it has a value. The value is 0. Quite distinct from not having a value, or in proper terms, not being set. Try this: var_dump($qty); $qty = 0; var_dump($qty); Well, I will save you the trouble, it outputs: NULL int(0) Type casting is irrelevant in php. No they aren't. Try this: $qty = 0; if($qty==test) echo foo; if((string)$qty==test) echo bar; This will only output foo. Not bar. You could also use the === operator to force PHP to check not only the value but also the type. See http://www.php.net/manual/en/language.operators.comparison.php -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] = 0 and = 0
The integer 0 is equal to False, but not Null. Robin Kodrik wrote: If you set $qty=0; then $qty has no value. Of course it has a value. No it doesn't have a value. PHP interprets 0 as null. A very easy way for you to check: $value=0; if(!$value) printf($value doesn't have a value (it didn't even print 0)br\n); $value=0 if($value) printf($value does have a value if I put 0 instead of 0br\n); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] = 0 and = 0
Kodrik, you are picking the wrong person to argue with. ;) If you set $qty=0; then $qty has no value. Of course it has a value. No it doesn't have a value. PHP interprets 0 as null. Completely incorrect. A very easy way for you to check: $value=0; if(!$value) printf($value doesn't have a value (it didn't even print 0)br\n); if() doesn't check for null, it checks for a boolean false condition. Does 0 evaluate to false? Sure it does. So does and 0. That doesn't mean they are null. $value=0 if($value) printf($value does have a value if I put 0 instead of 0br\n); That is completely wrong as well. You obviously didn't try your own example. The following all evaluate to false: if(0) if(false) if(null) if(0) if() But the fact that they all evaluate to false says nothing about whether they are values or not. Just like all of these all evaluate to true: if(1) if(true) if(abc) if(-1) That doesn't mean that 0 == null anymore than it means that 1 == -1. Just because two values both evaluate to the same boolean state does not mean they are one and the same. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Removing an Array Element
On Wednesday 24 October 2001 23:33, Jason Caldwell wrote: That won't work, as that will only unset the *value* not the *element*. Try again: $myArray = array('100'='jibberjabber','200'='morejibberjabber','0'=''); var_dump ($myArray); echo br; if(isset($myArray[0])) { unset ($myArray [0]); } var_dump ($myArray); Outputs: array(3) { [100]= string(12) jibberjabber [200]= string(16) morejibberjabber [0]= string(4) } array(2) { [100]= string(12) jibberjabber [200]= string(16) morejibberjabber } - index 0 is gone. -- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/) /* you are not expected to understand this */ - from the UNIX V6 kernel source -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] = 0 and = 0
You are right, 0 didn't show as a value. But his two lines still don't need typecasting, they both work: http://24.234.52.166 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] = 0 and = 0
The integer 0 is equal to False, but not Null. Not quite true. 0 evaluates to false. They are not equal. Try this: if(0==false) echo 1; if(0===false) echo 2; You will find that this only prints 1. 0 and false are distinct and separate values. This is something that confuses a lot of people, especially in conjunction with something like the strpos() function which will return 0 when it matches something at position 0 in the string, but it returns false when there is no match. A lot of people will mistakenly do: if(strpos(abcdef,abc)) { ... } and then be confused that the condition appeared not to be met. What they actually should have done was: if(strpos(abcdef,abc)!==false) { ... } So be careful and try to think of 0 and false as distinct and separate entities and you will avoid coding mistakes like this. -Rasmus Robin Kodrik wrote: If you set $qty=0; then $qty has no value. Of course it has a value. No it doesn't have a value. PHP interprets 0 as null. A very easy way for you to check: $value=0; if(!$value) printf($value doesn't have a value (it didn't even print 0)br\n); $value=0 if($value) printf($value does have a value if I put 0 instead of 0br\n); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: socket question
That seems to just give me the first line, of: htmlheadtitlePHP Credits/title/headbody but nothing else after that. Any ideas? :) Tim James Cave [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... There is some source code on the php.net site which captures the credits with output buffering and then uses then in the page. Once you have the data in a variable you can do what you like to it. if (function_exists('ob_start')) { ob_start(); phpcredits(); $credits = ob_get_contents(); ob_end_clean(); } Maybe that will do the trick. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Q:Why is my code returning this? Help?
why are you using stripslaches? 25/10/2001 00:41:45, Marcus James Christian [EMAIL PROTECTED] wrote: Hello, As mainly a designer w/ HTML and JS php is usually just an end of site add on to process forms and I LOVE php! I've been away from PHP coding for about a month and I can't figure out what I'm forgetting here is partial of the form, the php handler, and the final email I get. If you see some syntax I'm botching let me know please. form action=../php/dc_rif_handler.php method=post select name=title option selectedTitle.../option optionMr./option optionMs./option optionMrs./option /select /td/tr trtd align=rightfont color=33b*First Name:/td tdinput type=text name=fname size=48/td/tr trtd align=rightfont color=33b*Last Name:/td tdinput type=text name=lname size=48/td/tr trtd align=rightfont color=33b*Mailing Address:/td tdinput type=text name=m_address size=48/td/tr trtd align=rightfont color=33b*City, State, Zip:/td tdinput type=text name=city_state_zip size=48/td/tr .. THE PHP HANDLER... Your form has been proccessed and sent to ... ?php $to = [EMAIL PROTECTED] ; $subject = A Dale Commons web site visitor is requesting information!; $message_raw = My name is $fname, $lname \r$r1a, $r2a, $r3a\r$r1b\rhere is my contact information:\r$title, $fname, $lname, \r$m_address,\r$city_state_zip,\rPhone Number: $phone\rFax: $fax\rThe best time to call is $time_to_call\rMy email address is $e_address; $message_stripped = stripslashes($message_raw); mail ($to, $subject, $message_stripped, From: [EMAIL PROTECTED] ); ? AND FINALLY THE SENSELESS EMAIL I GET AT THE END... My name is , , , I am looking for a loved one. here is my contact information: , , , , , Phone Number: Fax: The best time to call is My email address is .. What in the world? Did I forget everything PHP taught me? What the heck are those weird commas from and I could swear a form element named xname is called in php via $xname ??? Please let me know what you see, -Marcus PS, I just ran phpinfo(); on my server and it looks like all the others that work. -- Marcus James Christian UNLIMITED Multimedia Internet Design http://mjchristianunlimited.com Proudly presents the music of CHROMATICUS at http://www.mp3.com/chromaticus and http://chromaticus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] = 0 and = 0
You are right, 0 didn't show as a value. But his two lines still don't need typecasting, they both work: http://24.234.52.166 I don't mean to pick on you, but no, you are wrong. And I am only doing this because so many people get confused on this point and I always see questions related to it. His lines were: $qty = 0 ; if ($qty != test) print qty is not test; $qty = 0 ; if ($qty != test) print qty is not test; So his two conditions can be simplified to: if(0!=test) echo 1; if(0!=test) echo 2; Try this code yourself, or his original code if you want. Only the first condition is met and you will only see it print 1. When you are comparing an integer to a string, the string will get converted to its integer representation. The integer representation of test is 0. So the second condition becomes: if(0!=0) which is obviously false. Therefore if you cast it: if((string)0!=test) You are again comparing a string to a string and PHP will not try to convert test to an integer. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: socket question
That is, using a socket, that it gives me the one line. echo'ing it gives the whole thing. Tim Tim Ballantine [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... That seems to just give me the first line, of: htmlheadtitlePHP Credits/title/headbody but nothing else after that. Any ideas? :) Tim James Cave [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... There is some source code on the php.net site which captures the credits with output buffering and then uses then in the page. Once you have the data in a variable you can do what you like to it. if (function_exists('ob_start')) { ob_start(); phpcredits(); $credits = ob_get_contents(); ob_end_clean(); } Maybe that will do the trick. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] = 0 and = 0
Check the link I posted. http://24.234.52.166 There is the code I wrote and it's output. The two lines print. You can explain me why tomorrow they print on my server and not yours. Good night But his two lines still don't need typecasting, they both work: http://24.234.52.166 I don't mean to pick on you, but no, you are wrong. And I am only doing this because so many people get confused on this point and I always see questions related to it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] RE: URL variables
They're just there ... If the link is a href='yourpage.php?yourvar=fred' Then in yourpage.php ... echo($yourvar); the only way you may go wrong with this is with scoping, $yourvar isn't available in a function inside yourpage.php. Tim Ward -- From: Clint Tredway [SMTP:[EMAIL PROTECTED]] Sent: 24 October 2001 20:13 To: PHP General Subject: URL variables How do I reference URL variables..? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] disable_functions not working in httpd.conf
On Thursday 25 October 2001 09:47, Joseph Blythe wrote: Hi, bad news disable_functions doesn't work for me either in apache's config file I tried it with php_value, and php_admin_value, also in .htaccess with php_value without any luck php4.0.5, Apache/1.3.14 bye, Arpi Hey All, Was just trying the following and disable_functions is not working? Although safe mode and open_basedir are! What is really strange that when phpinfo is called the disable_functions value is phpinfo, can't seem to disable echo either, I don't want to put these in php.ini as I still want to be able to have a fully fledged php running from the main document root. VirtualHost * ServerAdmin [EMAIL PROTECTED] DocumentRoot /home/test/public_html ServerName test.foo.bar.com.au ErrorLog logs/test.foo.bar.com.au-error_log CustomLog logs/test.foo.bar.com.au-access_log common Directory /home/test/public_html AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps php_admin_value open_basedir /home/test/public_html php_admin_value user_dir /home/test/public_html php_admin_value disable_functions phpinfo php_admin_flag safe_mode On php_admin_value safe_mode_allowed_env_vars PHP_ php_admin_value safe_mode_protected_env_vars LD_LIBRARY_PATH php_admin_value sendmail_from [EMAIL PROTECTED] /Directory /VirtualHost What am I doing wrong, any suggestions welcome on the above conf too :) Thanks in advance, Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] regardnig receiving mails
Hi For sending mail php has a function mail() But how to receive mails(i.ie. POP3 access) can anyone send some sample code Nigam
[PHP] Loading message
Hi, is there a easy way in php to display text like Loading... while elements on a page is being loaded from the server? Regards # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | # -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] talking directly w/ MySql
SELECT 1+1 doesn't really need a connection... or any other statments that doesn't address a table or database, SELECT SUBSTRING('test', 1, 2); etc etc.. I guess it is not possible though... Kodrik [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... how can i issue such statments w/o opening a connection? I you don't open a connection, how is mysql supposed to know which db you are talking to? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] talking directly w/ MySql
Hey man, when I ask you how is 2+2 you will answer - 4 but when I ask you how is 2*3.141596535 you use a calculator. In both cases I speak with you(make a connection). In the first case you don't need to use calc because you don't have to use it. PHP and Mysql are two standalone apps and when PHP wants to communicate with mysql a connection is needed. On Thursday 25 October 2001 06:50 am, you wrote: SELECT 1+1 doesn't really need a connection... or any other statments that doesn't address a table or database, SELECT SUBSTRING('test', 1, 2); etc etc.. I guess it is not possible though... Kodrik [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... how can i issue such statments w/o opening a connection? I you don't open a connection, how is mysql supposed to know which db you are talking to? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] RE: PHP object communication
If you want access to error functions within the db class it must either extend the error class or have an error object within it. Either ... Class DB extends Error { ... } Class Core extends DB { ... } or Class DB { var $error; ... function DB() // constructor { ... $this-error = new Error(); } ... } Class Core { var $db; var error; function Core() // constructor { ... $this-db = new DB(); $this-error = new Error(); ... } } at the end of the day, both these are ways of getting around the lack of multiple inheritance Tim Ward -- From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] Sent: 24 October 2001 22:45 To: [EMAIL PROTECTED] Subject: PHP object communication Not coming from a programming background, I'm going to have difficulty explaining this one... :) I would like to handle an entire application through one object, which in turn contains objects. I only recently got classes though, and I don't fully understand if what I want to do is possible, or if I'm going about it the wrong way. Consider: ?php // All of these will be in separate files. // The first two are separated simply because // I want to keep my include files small. class Config { // Base config class. // Just contains data. } class Core extends Config { // Base application class. // Just contains methods. } class Error { // Error handler. } class DB { // Database handler. } ? Tying the first two together is no problem, I can just extend the Config class. However I would like to incorporate the third and fourth as objects inside the main object: ? // In fact these would be instantiated (is that the // right word?) inside the Core class. $Core= new Core; $Core-Error = new Error; $Core-DB= new DB ? This is fine when working in the main application, or in the $Core object, but where I get stuck is with communication between the $Core-Error and $Core-DB objects. Say for example that within the DB class I encountered an error, and wanted to talk to the Error object - I /could/ do this: ? class DB { var $Error; function DB() { global $Core; $this-Error = $Core-Error; } } ? But if I extend the application later and add a bunch of new classes, it means I have to do the same for each object I add. I get the impression that I might be able to do this with references, but I can't get a handle on them for the life of me. Can someone explain? Sorry for the lengthy post. Thanks, adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Loading message
the page won't ever showup unless the webserver finishes processing the PHP file, therefore the Loading ... will appear while the page is waiting for its component to finish loading (images, javascripts, flash files, ) therefore what you're asking for has a javascript solution: 1)make a div with width and height about 1000 and absolute position w/ z-index=1000 2)add a body.onload event so that when the pages loads you hide that layer. 3)that layer can hold any text or tags as you want like: Please wait this division's code: div id='loadinglayer' style='left:0;top:0;width:1000;height:1000;position:absolute;z-index:1000;ba ckground:black'Please wait/div body onload='hidelayer()' /body script function hidelayer() { if(document.all) document.all['loadinglayer'].style.visibility=hidden; else document.layers['loadinglayer'].visibility=hide; } /script hope that helps Daniel alsén [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, is there a easy way in php to display text like Loading... while elements on a page is being loaded from the server? Regards # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | # -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] passing a multi dimensional associative array...
Pardon me if I've been smoking too much crack but I can't seem to figure this one out... How do I pass an argument to a function that contains a value from multi dimensional associative array? or... How do I pass an variable as an argument that contains value taken from an array? or... Why doesn't the following work? The following (barring any typos) works for me if the variable $newstring is passed with a value of Some Random Text (it is returned with spaces replace by underscores) but does not work when passing the $newstring = $somearray[thing][data] line. I'm missing something here... TIA, Spunk ?php function RemoveWeirdChars($stringtoreplace) { // Removes spaces that could cause problems. $replacedstring = (ereg_replace( , _, $stringtoreplace)); return $replacedstring; } //$newstring = Some Random Text; //This works... //value comes from an multi-assoc-array $newstring = $somearray[thing][data]; //doesn't work //$finishedstring = (ereg_replace( , _, $newstring)); $finishedstring = (RemoveWeirdChars($newstring)); echo $finishedstring; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: Loading message
I will try experimenting with that. But my situation is: A page with multiple php file includes. The page loads on to the includes, loads them and continues to load the includes below. I want to display some sort of text while the include still isn´t loaded. Likewise i would like to display some sort of loading message while a database search is active. - Daniel -Original Message- From: _lallous [mailto:[EMAIL PROTECTED]] Sent: den 25 oktober 2001 13:14 To: [EMAIL PROTECTED] Subject: [PHP] Re: Loading message the page won't ever showup unless the webserver finishes processing the PHP file, therefore the Loading ... will appear while the page is waiting for its component to finish loading (images, javascripts, flash files, ) therefore what you're asking for has a javascript solution: 1)make a div with width and height about 1000 and absolute position w/ z-index=1000 2)add a body.onload event so that when the pages loads you hide that layer. 3)that layer can hold any text or tags as you want like: Please wait this division's code: div id='loadinglayer' style='left:0;top:0;width:1000;height:1000;position:absolute;z-ind ex:1000;ba ckground:black'Please wait/div body onload='hidelayer()' /body script function hidelayer() { if(document.all) document.all['loadinglayer'].style.visibility=hidden; else document.layers['loadinglayer'].visibility=hide; } /script hope that helps Daniel alsén [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, is there a easy way in php to display text like Loading... while elements on a page is being loaded from the server? Regards # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | # -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: regardnig receiving mails
Look in http://www.php.net/manual/en/ref.imap.php - Original Message - From: Nigam Chheda [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, October 25, 2001 12:41 PM Subject: [PHP] regardnig receiving mails Hi For sending mail php has a function mail() But how to receive mails(i.ie. POP3 access) can anyone send some sample code Nigam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Loading message
flush() (http://www.php.net/manual/en/function.flush.php) the server cache. By defult Apache caches response to time this is completed. Then it responds. But You can flush() the cache in php code. It can help you not to use JavaScript. Krzysztof Daniel Alsén wrote: Hi, is there a easy way in php to display text like Loading... while elements on a page is being loaded from the server? Regards # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | # -- Oszczedzaj papier. Nie przestawaj notowac. Z zewnatrz poczta, w srodku takze notatnik. Twoja nowa poczta http://poczta.interia.pl/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Loading message
I suspect that PHP does all of it's work and, only when complete, will it send the generated html to the client. No matter what you try and do there's no way you can output the progress of your script to the browser while it is still being parsed. I could be wrong, but this is my understanding of it. Is your script really taking that long to be parsed that you need a loading progress bar or is the html (including graphics etc) just very big? Anyway, Hope this helps Derek - Original Message - From: Daniel Alsén [EMAIL PROTECTED] To: php [EMAIL PROTECTED]; _lallous [EMAIL PROTECTED] Sent: Thursday, October 25, 2001 11:27 AM Subject: RE: [PHP] Re: Loading message I will try experimenting with that. But my situation is: A page with multiple php file includes. The page loads on to the includes, loads them and continues to load the includes below. I want to display some sort of text while the include still isn´t loaded. Likewise i would like to display some sort of loading message while a database search is active. - Daniel -Original Message- From: _lallous [mailto:[EMAIL PROTECTED]] Sent: den 25 oktober 2001 13:14 To: [EMAIL PROTECTED] Subject: [PHP] Re: Loading message the page won't ever showup unless the webserver finishes processing the PHP file, therefore the Loading ... will appear while the page is waiting for its component to finish loading (images, javascripts, flash files, ) therefore what you're asking for has a javascript solution: 1)make a div with width and height about 1000 and absolute position w/ z-index=1000 2)add a body.onload event so that when the pages loads you hide that layer. 3)that layer can hold any text or tags as you want like: Please wait this division's code: div id='loadinglayer' style='left:0;top:0;width:1000;height:1000;position:absolute;z-ind ex:1000;ba ckground:black'Please wait/div body onload='hidelayer()' /body script function hidelayer() { if(document.all) document.all['loadinglayer'].style.visibility=hidden; else document.layers['loadinglayer'].visibility=hide; } /script hope that helps Daniel alsén [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, is there a easy way in php to display text like Loading... while elements on a page is being loaded from the server? Regards # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | # -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] ** This e-mail (and any attachment) is intended only for the attention of the addressee(s). Its unauthorised use, disclosure, storage or copying is not permitted. If you are not the intended recipient, please destroy all copies and inform the sender by return e-mail. This e-mail (whether you are the sender or the recipient) may be monitored, recorded and retained by Business Information Publications Limited (BiP). E-mail monitoring/ blocking software may be used, and e-mail content may be read at any time.You have a responsibility to ensure laws are not broken when composing or forwarding e-mails and their contents. ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: Loading message
Is your script really taking that long to be parsed that you need a loading progress bar or is the html (including graphics etc) just very big? Parts of the page is rather heavy loaded. The main php file loads fine and displays it´s contents until it reaches one of the heavy includes (heavy because it gets data from another website). So, in effect, the page loads and displays all content, make pauses when hitting heavy includes, and then continues. - Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] RE: PHP object communication
Hi Tim, If you want access to error functions within the db class it must either extend the error class or have an error object within it. Either ... I'll go for the latter, because extends isn't appropriate in this case: Class DB { var $error; ... function DB() // constructor { ... $this-error = new Error(); } ... } Class Core { var $db; var error; function Core() // constructor { ... $this-db = new DB(); $this-error = new Error(); ... } } at the end of the day, both these are ways of getting around the lack of multiple inheritance In this case, don't I have a completely different error object in $Core-db? adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Entity handling in DOM
Hi all, If I have an entity reference in an XML document, which I', parsing with the libxml PHP/DOM parser - does anyone know how I can [1] expand entities and [2] read in and parse external entities? Code would be helpful. :) TIA, Vikram -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] regardnig receiving mails
Hi For sending mail php has a function mail() But how to receive mails(i.ie. POP3 access) can anyone send some sample code pl reply me mail at following id [EMAIL PROTECTED] Nigam
[PHP] RE: PHP object communication
see below for comments Tim Ward Senior Systems Engineer Please refer to the following disclaimer in respect of this message: http://www.stivesdirect.com/e-mail-disclaimer.html -Original Message- From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] Sent: Thursday, October 25, 2001 11:56 AM To: Tim Ward; [EMAIL PROTECTED] Subject: RE: PHP object communication Hi Tim, If you want access to error functions within the db class it must either extend the error class or have an error object within it. Either ... I'll go for the latter, because extends isn't appropriate in this case: [Tim Ward] I think I would use the second option in your case as well, but always consider inheritance, it's beter where it is appropriate Class DB { var $error; ... function DB() // constructor { ... $this-error = new Error(); } ... } Class Core { var $db; var error; function Core() // constructor { ... $this-db = new DB(); $this-error = new Error(); ... } } at the end of the day, both these are ways of getting around the lack of multiple inheritance In this case, don't I have a completely different error object in $Core-db? [Tim Ward] Yes, which is exactly what you want. the classes DB and Core both need to handle their own errors. What you don't want to do is handle errors in DB within an instance of Core. That would mean DB cannot cannot function except as part of Core. Remember .. there are 2 O's in OOP, the second one is important. Each class should be complete. if you try to get DB to use error functions defined (or inherited by) in Core you are effectively trying to get a parent to inherit from a child. adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Loading message
the page won't ever showup unless the webserver finishes processing the PHP file, therefore the Loading ... will appear while the page is waiting for its component to finish loading (images, javascripts, flash files, ) Totally incorrect. I have a page on our intranet that checks whois information against about 10 whois servers. Right at the top of the page it says Checking. As soon as a response comes back from a whois server it shows in the browser ie :- domain.com available domain.net unavailable The list grows as the results come back.. As soon as all the results have been returned the message Checking... changes to Finished even if all the images etc have not loaded yet... All done with PHP and a one line javascript call. Regards jon ] -- -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send blank email to [EMAIL PROTECTED] -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send blank email to [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Loading message
If what I've said is correct, then in simple terms... your php code will take a set amount of time to execute everything, then the html and web page cmoponents are sent to the browser, then the browser interprets the html and displays the page. One of the stages listed above seems to be running slow. I'm fairly new to PHP and haven't attempted to time how long a php script takes to execute, but you should test this and if it's slow, then I suppose you want to try and optimise the script. if you save everything on the web page and examine the size of the file this might give you an indication as to whether it's a bandwidth problem. You could save the html and all components, upload them to the server as a normal static web page and compare the download times with the dynamic, PHP-generated page. copy the html generated into an html editor that highlights html syntax errors - your browser might be having problems interpreting the html. If your page starts to display content immediately and then takes a while to complete AND if I'm correct in saying the PHP finishes before the generated page is sent to the browser then it's unlikely to be a slow PHP script that's the problem. Hope this helps, Derek - Original Message - From: Daniel Alsén [EMAIL PROTECTED] To: Derek Mailer [EMAIL PROTECTED] Sent: Thursday, October 25, 2001 11:45 AM Subject: RE: [PHP] Re: Loading message Is your script really taking that long to be parsed that you need a loading progress bar or is the html (including graphics etc) just very big? Parts of the page is rather heavy loaded. The main php file loads fine and displays it´s contents until it reaches one of the heavy includes (heavy because it gets data from another website). So, in effect, the page loads and displays all content, make pauses when hitting heavy includes, and then continues. - Daniel ** This e-mail (and any attachment) is intended only for the attention of the addressee(s). Its unauthorised use, disclosure, storage or copying is not permitted. If you are not the intended recipient, please destroy all copies and inform the sender by return e-mail. This e-mail (whether you are the sender or the recipient) may be monitored, recorded and retained by Business Information Publications Limited (BiP). E-mail monitoring/ blocking software may be used, and e-mail content may be read at any time.You have a responsibility to ensure laws are not broken when composing or forwarding e-mails and their contents. ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] how many data can a session hold?
I want to know how many data can a session (treated as cookie) can hold... The number of bytes... and if possible the max size of an - let's say - array of ints. I need this to know how many IDs I can hold in the session... _ . Christian Dechery . . Gaita-L Owner / Web Developer . . http://www.webstyle.com.br . . http://www.tanamesa.com.br -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] generating several images in sequence...
I have a page that calls a image creating script lots of times... this script takes two parameters... the type of graph to be created and an array with data to fill the graph to be created... now I'm doing it like this: img src=?=WEB_ROOT./adm/relatorio_graph.php?tipo=catviewsemp_graphArray=.urlencode($categs)? and it generates an output something like this: img src=/vitrine/adm/relatorio_graph.php?tipo=catviewsemp_graphArray=a%3A3%3A%7Bi%3A2%3Ba%3A2%3A%7Bs%3A4%3A%22view%22%3Bi%3A22%3Bs%3A5%3A%22click%22%3Bi%3A1%3B%7Di%3A3%3Ba%3A1%3A%7Bs%3A4%3A%22view%22%3Bi%3A12%3B%7Di%3A4%3Ba%3A2%3A%7Bs%3A4%3A%22view%22%3Bi%3A10%3Bs%3A5%3A%22click%22%3Bi%3A1%3B%7D%7D it works just fine.. all the graphs show up perfectly... but I was wondering if there is a better way of doing this... I tried with sessions, but I couldn't get the varible to be reseted correctly between two graphs of the same type... and they would repeat... any ideas? _ . Christian Dechery . . Gaita-L Owner / Web Developer . . http://www.webstyle.com.br . . http://www.tanamesa.com.br -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how many data can a session hold?
On Thu, 25 Oct 2001, Christian Dechery wrote: I want to know how many data can a session (treated as cookie) can hold... If you're using cookies, the limit is the cookie spec. I /think/ 4096 bytes for a cookie. Go find the spec to be sure. -- Sapere aude My mind not only wanders, it sometimes leaves completely. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] gray square using imagecopyresized
That's my call: imageCopyResized ($O_imagen, $O_relleno, 0, 0, 0, 0, 83, 62, 174, 83); If I do imagePNG($O_relleno); I can see the correct image, but when I do imagePNG($O_relleno); after imageCopyResized I see that it has copied a gray filled square (with correct size, 83x62) but nothing more, any ideas? Thnx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] web base mail client???
I would say this comes in a close second as the most oft-asked question on php-general, with the first, of course, being What's a good text editor for PHP? hehehehe... Thanks Chrisrtian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Loading message
I agree with you Derek, It also depends on the webserver and your connection speed... perhaps the pages is already parsed and processed but your connection is slow somehow and you're getting the page partially as if it is beeing show while it is beeing processed/parsed. Derek Mailer [EMAIL PROTECTED] wrote in message 010e01c15d43$0a319c60$5c00010a@NTSERVDOM">news:010e01c15d43$0a319c60$5c00010a@NTSERVDOM... I suspect that PHP does all of it's work and, only when complete, will it send the generated html to the client. No matter what you try and do there's no way you can output the progress of your script to the browser while it is still being parsed. I could be wrong, but this is my understanding of it. Is your script really taking that long to be parsed that you need a loading progress bar or is the html (including graphics etc) just very big? Anyway, Hope this helps Derek - Original Message - From: Daniel Alsén [EMAIL PROTECTED] To: php [EMAIL PROTECTED]; _lallous [EMAIL PROTECTED] Sent: Thursday, October 25, 2001 11:27 AM Subject: RE: [PHP] Re: Loading message I will try experimenting with that. But my situation is: A page with multiple php file includes. The page loads on to the includes, loads them and continues to load the includes below. I want to display some sort of text while the include still isn´t loaded. Likewise i would like to display some sort of loading message while a database search is active. - Daniel -Original Message- From: _lallous [mailto:[EMAIL PROTECTED]] Sent: den 25 oktober 2001 13:14 To: [EMAIL PROTECTED] Subject: [PHP] Re: Loading message the page won't ever showup unless the webserver finishes processing the PHP file, therefore the Loading ... will appear while the page is waiting for its component to finish loading (images, javascripts, flash files, ) therefore what you're asking for has a javascript solution: 1)make a div with width and height about 1000 and absolute position w/ z-index=1000 2)add a body.onload event so that when the pages loads you hide that layer. 3)that layer can hold any text or tags as you want like: Please wait this division's code: div id='loadinglayer' style='left:0;top:0;width:1000;height:1000;position:absolute;z-ind ex:1000;ba ckground:black'Please wait/div body onload='hidelayer()' /body script function hidelayer() { if(document.all) document.all['loadinglayer'].style.visibility=hidden; else document.layers['loadinglayer'].visibility=hide; } /script hope that helps Daniel alsén [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, is there a easy way in php to display text like Loading... while elements on a page is being loaded from the server? Regards # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | # -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] ** This e-mail (and any attachment) is intended only for the attention of the addressee(s). Its unauthorised use, disclosure, storage or copying is not permitted. If you are not the intended recipient, please destroy all copies and inform the sender by return e-mail. This e-mail (whether you are the sender or the recipient) may be monitored, recorded and retained by Business Information Publications Limited (BiP). E-mail monitoring/ blocking software may be used, and e-mail content may be read at any time.You have a responsibility to ensure laws are not broken when composing or forwarding e-mails and their contents. ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] how can I do this !!
i have txt file have this words -- bla bla bla [phpcode] ? echo 'hello word'; ? [/phpcode] bla bla bla --- now I want to convert the code that are between [phpcode] and [/phpcode] to colorized code .. How I can do that
Re: [PHP] Re: Removing an Array Element
and what about array_slice(), array_splice(), array_pop() or array_unshift()? Please read the corresponding pages of the manual! - Original Message - From: Christian Reiniger [EMAIL PROTECTED] To: Jason Caldwell [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, October 25, 2001 11:03 AM Subject: Re: [PHP] Re: Removing an Array Element On Wednesday 24 October 2001 23:33, Jason Caldwell wrote: That won't work, as that will only unset the *value* not the *element*. Try again: $myArray = array('100'='jibberjabber','200'='morejibberjabber','0'=''); var_dump ($myArray); echo br; if(isset($myArray[0])) { unset ($myArray [0]); } var_dump ($myArray); Outputs: array(3) { [100]= string(12) jibberjabber [200]= string(16) morejibberjabber [0]= string(4) } array(2) { [100]= string(12) jibberjabber [200]= string(16) morejibberjabber } - index 0 is gone. -- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/) /* you are not expected to understand this */ - from the UNIX V6 kernel source -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] how can I do this !!
i have txt file have this words -- bla bla bla [phpcode] ? echo 'hello word'; ? [/phpcode] bla bla bla --- now I want to convert the code that are between [phpcode] and [/phpcode] to colorized code .. How I can do that Copy the file to .phps and access that page via the webserver? Chris
[PHP] intermediate pre-parsed or compiled PHP files possible?
Hello there, I was wondering if there was any intermediate format I could compile my PHP scripts to in order to gain speed. For example, having the format/validity of the scripts already formatted, function locations ready in an index, PHP function calls, etc etc. Sortof like obj files for C++. Is this available? If not, what is the easiest way to link in a few of my own fully compiled functions to be used from PHP? Thanks to everyone who has any clue what I am talking about :), Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Redirecting Using Header{} Function
Hi, I am writing a site which is available in different languages. The idea is that when the visitor selects a language on the first visit it is then set in a cookie and remembered so they aren't asked again, I also set the Language ID in a session to be used through that visit. The page that sets the cookie and session then moves on to the selected language using header(Refresh: 0;url=english.php) At first I used the Header(Location) rather than Header(Refresh) but I found that although the cookie and session were set the browser could not access them. A quick look on the php.net site gave me the Refresh bit which seemed to sort the problem. However with Netscape 4.75 when I call any page that has the Header(Refresh) function I get a nasty pop up box which says The document contains no data. I then click ok and the page loads exactly as it should but no matter what I do I can't stop this pop up box from appearing, IE, Netscape 6 and Opera all work fine. Does any have any ideas??? Cheers, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] = 0 and = 0
Rasmus Lerdorf [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... The integer 0 is equal to False, but not Null. Not quite true. 0 evaluates to false. They are not equal. Try this: [...] So be careful and try to think of 0 and false as distinct and separate entities and you will avoid coding mistakes like this. Is this seen as a strength or a weakness of PHP.? In C(++), direct comparisons to true/false are discouraged. In other words, instead of this: bool x; if(x==true) ... if(x==false) ... itt's always considered better to do this: if(x) ... if(!x) ... But PHP seems to require a direct comparison with false in certain situations. Are there any cases where you need to do a direct comparison with true? Are you coming to Ottawa in the future? -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ottawa If you followup, please do NOT e-mail me a copy: I will read it here -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: is there a commandline php.exe interpreter?
John A. Grant [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I've installed ActivePerl, which gives me a way to run .pl files, i.e. : c:\ perl someprogram.pl Does the Win32 php installation give me a command-line interpreter like that? [...] No replies. I guess not, just server-based... :( -- John A. Grant * I speak only for myself * (remove 'z' to reply) Radiation Geophysics, Geological Survey of Canada, Ottawa If you followup, please do NOT e-mail me a copy: I will read it here -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Redirecting Using Header{} Function
However with Netscape 4.75 when I call any page that has the Header(Refresh) function I get a nasty pop up box which says The document contains no data. I then click ok and the page loads exactly as it should but no matter what I do I can't stop this pop up box from appearing, IE, Netscape 6 and Opera all work fine. Does any have any ideas??? --- have you tried sending a few nbsp; chars after the header? that way your doc will have some data in it. unless it's a netscape bug :( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how can I do this !!
What do you mean, colorized code? At 02:26 PM 10/25/2001, Alawi wrote: i have txt file have this words -- bla bla bla [phpcode] ? echo 'hello word'; ? [/phpcode] bla bla bla --- now I want to convert the code that are between [phpcode] and [/phpcode] to colorized code .. How I can do that Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Header Refresh Function
Hi, I am writing a site which is available in different languages. The idea is that when the visitor selects a language on the first visit it is then set in a cookie and remembered so they aren't asked again, I also set the Language ID in a session to be used through that visit. The page that sets the cookie and session then moves on to the selected language using header(Refresh: 0;url=english.php) At first I used the Header(Location) rather than Header(Refresh) but I found that although the cookie and session were set the browser could not access them. A quick look on the php.net site gave me the Refresh bit which seemed to sort the problem. However with Netscape 4.75 when I call any page that has the Header(Refresh) function I get a nasty pop up box which says The document contains no data. I then click ok and the page loads exactly as it should but no matter what I do I can't stop this pop up box from appearing, IE, Netscape 6 and Opera all work fine. Does any have any ideas??? Cheers, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] how can I do this !!
show_source(basename($PHP_SELF)); At 02:26 PM 10/25/2001, Alawi wrote: i have txt file have this words -- bla bla bla [phpcode] ? echo 'hello word'; ? [/phpcode] bla bla bla --- now I want to convert the code that are between [phpcode] and [/phpcode] to colorized code .. How I can do that Sliante, Richard S. Crawford http://www.mossroot.com mailto:[EMAIL PROTECTED] AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] = 0 and = 0
Hi John! The integer 0 is equal to False, but not Null. Not quite true. 0 evaluates to false. They are not equal. Try this: [...] So be careful and try to think of 0 and false as distinct and separate entities and you will avoid coding mistakes like this. Is this seen as a strength or a weakness of PHP.? According to my experience I'd say both, depending on the context... If you have to determin its type before using a variable and then, when changing it, have to do an explicit typecast, programming gets cleaner and in many cases more safe. On the other hand, if let's say false == 0 and true == 1, you can do nice things like arithmetic operations using booleans: $x = $y * (-1 * (abs($z) == $z)); Get the idea? In C(++), direct comparisons to true/false are discouraged. In other words, instead of this: bool x; if(x==true) ... if(x==false) ... itt's always considered better to do this: if(x) ... if(!x) ... But PHP seems to require a direct comparison with false in certain situations. Are there any cases where you need to do a direct comparison with true? AFAIK it's only a matter of speed. Unary operators consume less time than binary ones... Correct me if I'm wrong. Are you coming to Ottawa in the future? This I don't know... ;) Cheers, Kiko - It's not a bug, it's a feature. christoph starkmann mailto:[EMAIL PROTECTED] http://www.fh-augsburg.de/~kiko ICQ: 100601600 - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: how can I do this !!
? $mem = ' -- bla bla bla [phpcode] ? echo \'hello word\'; ?? [/phpcode] bla bla bla --- '; //' $re = '/\[phpcode\](.+?)\[\/phpcode\]/is'; if (preg_match($re, $mem, $matches)) { ob_start(); highlight_string($matches[1]); $html = ob_get_contents(); ob_end_clean(); $out = preg_replace($re, $html, $mem); echo $out; } ? this should do! Alawi [EMAIL PROTECTED] wrote in message 008f01c15da2$ddf4fd30$d43f47d4@php">news:008f01c15da2$ddf4fd30$d43f47d4@php... i have txt file have this words -- bla bla bla [phpcode] ? echo 'hello word'; ? [/phpcode] bla bla bla --- now I want to convert the code that are between [phpcode] and [/phpcode] to colorized code .. How I can do that -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: regardnig receiving mails
there are lots of classes on http://phpclasses.upperdesign.com just search there. Nigam Chheda [EMAIL PROTECTED] wrote in message 006e01c15d43$63351620$26a8a8c0@bravo">news:006e01c15d43$63351620$26a8a8c0@bravo... Hi For sending mail php has a function mail() But how to receive mails(i.ie. POP3 access) can anyone send some sample code pl reply me mail at following id [EMAIL PROTECTED] Nigam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] htpasswd
Can php write to a htpasswd file? If it can will someone point me in the right direction. TIA Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] htpasswd
go to http://www.php.net/manual/en/ref.filesystem.php and read up on things like fopen, fclose, etc. This will explain how to write to any kind of file including htpasswd files if necessary. Good Luck Derek - Original Message - From: Gary [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, October 25, 2001 3:59 PM Subject: [PHP] htpasswd Can php write to a htpasswd file? If it can will someone point me in the right direction. TIA Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] ** This e-mail (and any attachment) is intended only for the attention of the addressee(s). Its unauthorised use, disclosure, storage or copying is not permitted. If you are not the intended recipient, please destroy all copies and inform the sender by return e-mail. This e-mail (whether you are the sender or the recipient) may be monitored, recorded and retained by Business Information Publications Limited (BiP). E-mail monitoring/ blocking software may be used, and e-mail content may be read at any time.You have a responsibility to ensure laws are not broken when composing or forwarding e-mails and their contents. ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: intermediate pre-parsed or compiled PHP files possible?
did you check www.zend.com and their caching/optimizing products? Thomas [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello there, I was wondering if there was any intermediate format I could compile my PHP scripts to in order to gain speed. For example, having the format/validity of the scripts already formatted, function locations ready in an index, PHP function calls, etc etc. Sortof like obj files for C++. Is this available? If not, what is the easiest way to link in a few of my own fully compiled functions to be used from PHP? Thanks to everyone who has any clue what I am talking about :), Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: FIGURED OUTQ:Why is my code returning this? Help?
Before anyone tries to hard to figure this out I looked over my code and fixed this. The answer was that I had more than one form on the same page calling to one php handler page, -Marcus Marcus James Christian wrote: Hello, As mainly a designer w/ HTML and JS php is usually just an end of site add on to process forms and I LOVE php! I've been away from PHP coding for about a month and I can't figure out what I'm forgetting here is partial of the form, the php handler, and the final email I get. If you see some syntax I'm botching let me know please. form action=../php/dc_rif_handler.php method=post select name=title option selectedTitle.../option optionMr./option optionMs./option optionMrs./option /select /td/tr trtd align=rightfont color=33b*First Name:/td tdinput type=text name=fname size=48/td/tr trtd align=rightfont color=33b*Last Name:/td tdinput type=text name=lname size=48/td/tr trtd align=rightfont color=33b*Mailing Address:/td tdinput type=text name=m_address size=48/td/tr trtd align=rightfont color=33b*City, State, Zip:/td tdinput type=text name=city_state_zip size=48/td/tr .. THE PHP HANDLER... Your form has been proccessed and sent to ... ?php $to = [EMAIL PROTECTED] ; $subject = A Dale Commons web site visitor is requesting information!; $message_raw = My name is $fname, $lname \r$r1a, $r2a, $r3a\r$r1b\rhere is my contact information:\r$title, $fname, $lname, \r$m_address,\r$city_state_zip,\rPhone Number: $phone\rFax: $fax\rThe best time to call is $time_to_call\rMy email address is $e_address; $message_stripped = stripslashes($message_raw); mail ($to, $subject, $message_stripped, From: [EMAIL PROTECTED] ); ? AND FINALLY THE SENSELESS EMAIL I GET AT THE END... My name is , , , I am looking for a loved one. here is my contact information: , , , , , Phone Number: Fax: The best time to call is My email address is .. What in the world? Did I forget everything PHP taught me? What the heck are those weird commas from and I could swear a form element named xname is called in php via $xname ??? Please let me know what you see, -Marcus PS, I just ran phpinfo(); on my server and it looks like all the others that work. -- Marcus James Christian UNLIMITED Multimedia Internet Design http://mjchristianunlimited.com Proudly presents the music of CHROMATICUS at http://www.mp3.com/chromaticus and http://chromaticus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HTTP Authentication
the HTTP authentication of using a form uses Sessions! Check out the following URL: http://www.devshed.com/Server_Side/PHP/Commerce2/ I followed the above URL to create a user authentication page using Sessions. Peter On Mon, 22 Oct 2001, [ISO-8859-1] Stig-Ørjan Smelror wrote: Wilbert Enserink wrote: Hi all, is it possible to do a HTTP Authentication with my own loginform instead of using the ugly pop up window? regards, Wilbert With a lot of thought, yes. You need to consider a few factors before you start. Security: Checking the IP address of the user. Performance: to DB or not to DB, that is the question! Security again: what kind of password algoritm are you going to use. And so on and so forth. I wish you the best of luck. I made such a script just a month ago :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Using PHP for server utilities
Hello- I am dreading having to break out my perl books, so here is a thought about using PHP on the server to handle a chore for me. I have a Linux ftp server that accepts files from a mainframe every night. I need to take those files, determine when the transfer is done and then re-send them to another machine across a wan. When that transfer is complete I need to make a new directory (date would be ok) and move all of the files into that directory, tar them and finally produce a status page. Thoughts? Has anyone tried this with php? BTW--it has to be automatic as a cron job. Thanks in advance. -Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] argument variable gets lost in function
I'm assigning a variable a value from an associative array. $variable = $array[key][value]; Then passing the $variable to a function. SomeFunction($variable) The variable exists (can be printed) until a built-in function (within the original function) is called. echo $variable; //prints out fine $variable2 = ereg_replace( , _, $variable); echo $variable; //prints out NOTHING... Why is this and how can I get around it? Thanks, Spunk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: intermediate pre-parsed or compiled PHP files possible?
did you check www.zend.com and their caching/optimizing products? They dont seem to have anything free, I need something free. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: argument variable gets lost in function
hmm...weird! is that the code? if you show us your real code...maybe you're missing a small detail... Spunk S. Spunk III [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I'm assigning a variable a value from an associative array. $variable = $array[key][value]; Then passing the $variable to a function. SomeFunction($variable) The variable exists (can be printed) until a built-in function (within the original function) is called. echo $variable; //prints out fine $variable2 = ereg_replace( , _, $variable); echo $variable; //prints out NOTHING... Why is this and how can I get around it? Thanks, Spunk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: Loading message
I agree with you Derek, It also depends on the webserver and your connection speed... perhaps the pages is already parsed and processed but your connection is slow somehow and you're getting the page partially as if it is beeing show while it is beeing processed/parsed. Actually i know why parts of the page is loading slow. I have a included php file that gathers data from another website. While that script is going off to the other website the main file make a pause parsing. - Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP File not found
Hi, I have just set up PHP on my webserver (IIS 4 on NT4). I have set up the script mapping so that I can save php files as .html and php processes them. This works fine until someone goes to a page that doesn't exist - instead of getting the customised error 404 page (i.e. the page you requested cannot be found), php prints: CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: And thats all I get. Does anyone know how to customise this page or set up a new one? Thankss.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Re: Loading message
Could i have a hint of what you have done Jon? - Daniel Totally incorrect. I have a page on our intranet that checks whois information against about 10 whois servers. Right at the top of the page it says Checking. As soon as a response comes back from a whois server it shows in the browser ie :- domain.com available domain.net unavailable The list grows as the results come back.. As soon as all the results have been returned the message Checking... changes to Finished even if all the images etc have not loaded yet... All done with PHP and a one line javascript call. Regards jon ] -- -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send blank email to [EMAIL PROTECTED] -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send blank email to [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: argument variable gets lost in function
hmm...weird! is that the code? if you show us your real code...maybe you're missing a small detail... Sorry about the variable names... I can print the variable inside the function until it goes through ereg_replace. Then it's gone. The code works fine if I replace the line '$song = $id3info[TIT2][data];' with '$song = some text string;' Since it's getting the variables value from an included file's functions that return and assoc. array... it's a bit confusing. I everything is fine up till the built-in function (inside my function) is called. Weird is right... ?php include(getid3.php); function RemoveSpaces($shittoreplace) { // Removes spaces and other characters that could cause problems. $shittoreplace = ereg_replace( , _, $shittoreplace); return $shittoreplace; } $id3info = (getID3(music.mp3)); $song = $id3info[TIT2][data]; $newsong = RemoveSpaces($song); echo $newsong; ? I'm assigning a variable a value from an associative array. $variable = $array[key][value]; Then passing the $variable to a function. SomeFunction($variable) The variable exists (can be printed) until a built-in function (within the original function) is called. echo $variable; //prints out fine $variable2 = ereg_replace( , _, $variable); echo $variable; //prints out NOTHING... Why is this and how can I get around it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Making a string from an Array
Hi all, this may be an easy question, but I'm stuck... how can this, $words = explode( , $keywordText); for ( $i = 0; $i count( $words ); $i++ ) { if ($words[$i]==on OR $words[$i]==the OR $words[$i]==in OR$words[$i]==at OR $words[$i]==is OR $words[$i]==it) { $ignored[] = $words[$i]; } else { $included[] = $words[$i]; } } How can I make $included and $ignored a string instead of an array. Thanks Sam Rose p.s. Also I'm only on the digest, so if you could reply directly to me as well, that would be a bonus.
[PHP] PHP-ASP
Can anyone show me the ASP equivalent to this PHP code I cut from a Weather script? I need to know how to get the response from the server into a string array fo process each line. $weather_url = http://iwin.nws.noaa.gov/iwin/tx/hourly.html;; $city_name = AUSTIN; exec ($wget_command $weather_url, $raw_contents); // We got the weather data we needed, so we can proceeed $located = 0; foreach ($raw_contents as $line) { // line may wrap in editor if (preg_match (/^$city_name\s+\S+\s+(-*\d{1,3})\s+(\d{1,3})\s+(\d{1,3})\s+ (\D+)(\d*)\S*\s+(\d{2}\.\d{2})([FRS]{1})/, $line, $regs)) { $temp = $regs[1]; $dewpoint = $regs[2]; $humidity = $regs[3]; $wind_direction = trim($regs[4]); $wind_speed = $regs[5]; $pressure = $regs[6]; $pressurechg = trim($regs[7]); // Falling, Rising, Steady $located = 1; break 1; } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Loading message
Yeah just call flush() when you want whats been parsed so far to go to the client.. -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send blank email to [EMAIL PROTECTED] - Original Message - From: Daniel Alsén [EMAIL PROTECTED] To: php [EMAIL PROTECTED]; Jon Farmer [EMAIL PROTECTED] Sent: Thursday, October 25, 2001 3:53 PM Subject: RE: [PHP] Re: Loading message Could i have a hint of what you have done Jon? - Daniel Totally incorrect. I have a page on our intranet that checks whois information against about 10 whois servers. Right at the top of the page it says Checking. As soon as a response comes back from a whois server it shows in the browser ie :- domain.com available domain.net unavailable The list grows as the results come back.. As soon as all the results have been returned the message Checking... changes to Finished even if all the images etc have not loaded yet... All done with PHP and a one line javascript call. Regards jon ] -- -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send blank email to [EMAIL PROTECTED] -- Jon Farmer Systems Programmer, Entanet www.enta.net Tel 01952 428969 Mob 07763 620378 PGP Key available, send blank email to [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Making a string from an Array
$ignored = ; $include = ; snip { $ignored.= $words[$i]; } else { $included.= $words[$i]; -Stewart -Original Message- From: Sam [mailto:[EMAIL PROTECTED]] Sent: 25 October 2001 16:18 To: 'php' Subject: [PHP] Making a string from an Array Hi all, this may be an easy question, but I'm stuck... how can this, $words = explode( , $keywordText); for ( $i = 0; $i count( $words ); $i++ ) { if ($words[$i]==on OR $words[$i]==the OR $words[$i]==in OR$words[$i]==at OR $words[$i]==is OR $words[$i]==it) { $ignored[] = $words[$i]; } else { $included[] = $words[$i]; } } How can I make $included and $ignored a string instead of an array. Thanks Sam Rose p.s. Also I'm only on the digest, so if you could reply directly to me as well, that would be a bonus. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: regardnig receiving mails
http://www.uebimiau.sili.com.br/ It's a script from my friend. Works with files (i.e, no database). You can analise his code, modify, fork, improve (that I know he would like ;-)) at will. -- Julio Nobrega. Um dia eu chego la: http://sourceforge.net/projects/toca Nigam Chheda [EMAIL PROTECTED] wrote in message 006e01c15d43$63351620$26a8a8c0@bravo">news:006e01c15d43$63351620$26a8a8c0@bravo... Hi For sending mail php has a function mail() But how to receive mails(i.ie. POP3 access) can anyone send some sample code pl reply me mail at following id [EMAIL PROTECTED] Nigam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Databases?
Can someone please give me the simplest tutorial to databases they can find?
RE: [PHP] Databases?
http://hotwired.lycos.com/webmonkey/programming/php/tutorials/tutorial4.html -Stewart -Original Message- From: Kyle Smith [mailto:[EMAIL PROTECTED]] Sent: 26 October 2001 00:49 To: [EMAIL PROTECTED] Subject: [PHP] Databases? Can someone please give me the simplest tutorial to databases they can find? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] stripslashes() not striping slashes
Anyone has an idea why stripslashes(); doesn't strip slashes? I have a form that when it's submitted with a ' sign ads slashes to the submit results. I'm taking the variable and sending it through stripslashes(); and yet the slashes remain. NE1? berber -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Making Setup Files Through A Web-Based Form
I'm writing an app that will be avaiable for the world to download and put on theri web sites. There will be a web-based form for them to customize the program on their site. This will record some basic variables like the filename for their site logo, what fonts they want to use in certain areas, etc... I've thought of 3 ways to this, but none seem perfect... 1. Have the script write a .php file that simply contains all of these variables. This file would be included in all the other scripts. Problems: Would have to create a directory with WORLD WRITE permissions. File would be owned by web or some other server-user preventing manual work to the file. Yes, I could use CHOWN to the user's name, but then the interface wouldn't be able to write over it in the future. I could CHMOD it, but wouldn't that allow the world to fiddle with it??? 2. Have the script display the PHP code and the user would copy it form teh browser, paste it into their text editor, save it, then upload it. Problems: Lame, lots of room for potential user error. 3. Have the script store the variables in a MySQL table and each script would query that table for the data. Problems: That seems like A LOT of MySQL queries to run. Would it be a noticeable resource hog?? Thanks for your advice! -Jeff Gannaway ___ Save 15% on 2002 Calendars and Holiday Cards! http://www.AvantGifts.com Discount Code: hopper22ct Offer Good Through October 31, 2001 ___ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] stripslashes() not striping slashes
Anyone has an idea why stripslashes(); doesn't strip slashes? I have a form that when it's submitted with a ' sign ads slashes to the submit results. I'm taking the variable and sending it through stripslashes(); and yet the slashes remain. You are perhaps thinking it does in-place modification of the argument? ie. stripslashes($a); echo $a; That's not how it works. It returns the stripped string. ie. $a = stripslashes($a); echo $a; -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] SIMPLE, secure user authentication
I'm looking for a good (simple) tutorial on user authentication. I want to create a login system that's secure, but I don't need all the features that PHPBuilder's A Complete, Secure User Login System scripts provide. (I don't need the the user to be able to register or confirm his account, change his email or password, etc.) Basically, I can/will set the usernames and passwords myself via MySQL. All I want the login system to do is securely check against the db and then create a session. That's the other problem. I'm a little confused about this cookie creation/session stuff. Am I correct in assuming that the way it works is that I should wrap every bit of PHP code around a isUserAuthenticated() function? I suppose what I need is a general tutorial on authentication, assuming the user of cookies, PHP4 and MySql. Any ideas?? (Thanks.) ...Rene --- Rene Fournier [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how can I do this !! color text in html
This should work. You can also use html code to use a style sheet ref. ? ECHO FONT COLOR='#2378A0' SIZE='3'Hello Word/FONT; ? i have txt file have this words -- bla bla bla [phpcode] ? echo 'hello word'; ? [/phpcode] bla bla bla --- now I want to convert the code that are between [phpcode] and [/phpcode] to colorized code .. How I can do that -- _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ Michael Seely 408-777-9949 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] how many data can a session hold?
On Thursday 25 October 2001 13:25, Christian Dechery wrote: I want to know how many data can a session (treated as cookie) can hold... The number of bytes... and if possible the max size of an - let's say - array of ints. I need this to know how many IDs I can hold in the session... Note: You should only store the session ID in the cookie and use this as a reference to the real data located e.g. in a database. -- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/) ...to paraphrase Churchill, while representative democracy may be terrible, it's still the best system that large corporations can buy. - David Weinberger JOHO January 25, 2000 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] conjob etc.
1. Just re-compile with the same options as before, just without --with-apxs or --with-apache (however you did it before). Run make all install and a php binary should be installed in $PREFIX/bin (default: /usr/local/bin). Then to use it to run shell scripts, put #!/usr/local/bin/php -q at the top of every php shell script. 2. Nothing wrong with that at all, as long as the process doesn't take longer than 5 minutes to execute ;) Mike Arnold Gamboa wrote: Hi there. Need your help / comments on this couple of issues. 1. I already have a php compiled in apache module running.. How can i install a cgi version that will also support mysql/postgresql/interbase (as it was also supported on the compiled version) 2. If I'll be running a cron job calling a php script that access mysql and reads data EVERY 5 MINS, will i exhaust my box's resources? That is the best /safest thing i have in mind in as far as doing an email account manipulation on the linux box. Any idea is also appreciated. Thanks.. Mabuhay! -- Arnold Gamboa Pres., Managing Dir. SparrowInteractive.com, Inc. [EMAIL PROTECTED] http://www.sparrowinteractive.com (63) 2 - 532-5373 / 532-5387 --- He chose the nails -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Making a string from an Array
A small addition: the code below would make a string, but it would be a single word (no spaces or other word boundaries). Use this instead: $ignored .= . $words[$i]; That inserts a space before each additional word. Unfortunately it also adds a space at the beginning but you can get rid of that after the processing is done. Mike Stewart Taylor [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... $ignored = ; $include = ; snip { $ignored.= $words[$i]; } else { $included.= $words[$i]; -Stewart -Original Message- From: Sam [mailto:[EMAIL PROTECTED]] Sent: 25 October 2001 16:18 To: 'php' Subject: [PHP] Making a string from an Array Hi all, this may be an easy question, but I'm stuck... how can this, $words = explode( , $keywordText); for ( $i = 0; $i count( $words ); $i++ ) { if ($words[$i]==on OR $words[$i]==the OR $words[$i]==in OR$words[$i]==at OR $words[$i]==is OR $words[$i]==it) { $ignored[] = $words[$i]; } else { $included[] = $words[$i]; } } How can I make $included and $ignored a string instead of an array. Thanks Sam Rose p.s. Also I'm only on the digest, so if you could reply directly to me as well, that would be a bonus. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Truncating Lines
Hi, I have the following code, which reads in an html file $fd = fopen(somefile.html, r); while (!feof($fd)) { $buffer = fgets($fd, 4096); $body .= $buffer; } fclose($fd); I am then mailing this: if (mail($username. .$email., $mailsubject, $body, From: .$Fromname. .$Fromaddress.\nContent-Type: text/html; charset=iso-8859-1 )) All works fine, except when a particular line in the html file is unusually long. Where this is the case, the mail gets sent but the long line truncates (the last character on the line being ! (exclamation mark)) followed by the remainder of the line on a new line. This obviously causes problems when trying to display the HTML. Strangely though, if the recipient of the mail is a local user (i.e. a user residing on this box), the line does not truncate and the HTML source remains intact. Equally, if I write out the contents of $body to the screen, the HTML source is intact. I suspect Sendmail may be the culprit, but I'm not sure. I realise I could keep my HTML source lines to a certain length, however these are often created dynamically so it's not that straight forward. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] SIMPLE, secure user authentication
Wish I could point you to a good tutorial, but instead I'll try and give you the gist of it, based on my experience. A great way to do what you want to do is to combine MySQL user lookups with .htaccess security. This prevents anyone from accessing the pages you don't want them to, and cuts down on coding time in that you don't need to create login scripts. You just need some simple code in a header that verifies $HTTP_SERVER_VARS['PHP_AUTH_USER'] and $HTTP_SERVER_VARS['PHP_AUTH_PASS'] against the entries in the database, and shoots back an error if they weren't found. The other thing you'll need is a program that automatically generates a .htpasswd file from the entries in your database.. that's as simple as: ?php $db = mysql_connect('localhost','user','pass'); mysql_select_db('users'); $sql = SELECT username,password FROM users ORDER BY username; $result = mysql_query($sql); $fp = fopen('/path/to/folder/below/document/root/.htpasswd','w'); while ($data =mysql_fetch_array($result)) { fputs($fp, $data['username'].':'.crypt($data['password']).\n); } fclose($fp); mysql_free_result($result); mysql_close($db); ? And, of course, you need to put in the folders you want to protect, the .htaccess file: AuthType Basic AuthName Protected Directory AuthUserFile /path/to/folder/below/document/root/.htpasswd AuthGroupFile /dev/null Require valid-user This is untested code, and should work fine, but it may have something silly like a syntax or parameters error or something I overlooked. Hope this helps. Mike Eheler Software Developer - Web Division SearchBC.com René Fournier wrote: I'm looking for a good (simple) tutorial on user authentication. I want to create a login system that's secure, but I don't need all the features that PHPBuilder's A Complete, Secure User Login System scripts provide. (I don't need the the user to be able to register or confirm his account, change his email or password, etc.) Basically, I can/will set the usernames and passwords myself via MySQL. All I want the login system to do is securely check against the db and then create a session. That's the other problem. I'm a little confused about this cookie creation/session stuff. Am I correct in assuming that the way it works is that I should wrap every bit of PHP code around a isUserAuthenticated() function? I suppose what I need is a general tutorial on authentication, assuming the user of cookies, PHP4 and MySql. Any ideas?? (Thanks.) ...Rene --- Rene Fournier [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Portland, Oregon
Rasmus, I'm not sure how I missed that, I would have liked to attend. where were you ? Jerry Lake -[EMAIL PROTECTED] Interface Engineering Technician -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 23, 2001 3:54 PM To: Richard Baskett Cc: PHP General Subject: Re: [PHP] Portland, Oregon So Rasmus.. how about coming to Portland, Oregon? I havent seen a PHP class, tutorial, anything in this area.. and I would love to attend one :) I was there 2 months ago. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: intermediate pre-parsed or compiled PHP files possible?
search for APC Cache or BWare Cache or PHP Accelerator on google Thomas [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... did you check www.zend.com and their caching/optimizing products? They dont seem to have anything free, I need something free. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Confused object in session variable.
Well, it's probably me that's confused. I have an authenticate() function which should start a session and if the user is not logged in then show the login screen otherwise return after storing and registering a user object in a session variable. This object has accessor methods to get the login name, access level, etc... This seems to work okay--within the authenticate function I can access the object in the HTTP_SESSION_VARS array. But as soon as I return to the main script it's gone. I must be doing something wrong with the scoping, but I can't see what. Any thoughts? Here's the code: ?php /* - */ /* index.php */ /* - */ require_once('ucautho/ucautho.inc'); authenticate(); print(From index testUser: . $testUser-getLogin() . br\n); print(From index HTTP_SESSION_VARS['ucAuthoUser']: ); print($HTTP_SESSION_VARS['ucAuthoUser']-getLogin() . br\n); //this is line 12 ? ?php /* --- */ /* ucautho/ucautho.inc */ /* --- */ function authenticate($appName=) { global $HTTP_SESSION_VARS, $HTTP_POST_VARS; global $testUser; session_name(UCAutho); session_start(); if (isset($HTTP_SESSION_VARS['ucAuthoUser']) $HTTP_SESSION_VARS['ucAuthoUser']-isValid()) { return; } else { if (isset($HTTP_POST_VARS['authoSubmit'])) { $HTTP_SESSION_VARS['ucAuthoUser'] = new UcAuthoUser($HTTP_POST_VARS['authoLogin'],$HTTP_POST_VARS['authoPword']); if ($HTTP_SESSION_VARS['ucAuthoUser']-isValid()) { session_register('ucAuthoUser'); $testUser = $HTTP_SESSION_VARS['ucAuthoUser']; print(From authenticate testUser: . $testUser-getLogin() . br\n); print(From authenticate HTTP_SESSION_VARS['ucAuthoUser']: ); print($HTTP_SESSION_VARS['ucAuthoUser']-getLogin() . br\n); return; } } showLogin($appName); } } /* more functions and the class declaration snipped */ ? Here's what I get when I login as 'steve' with a good password: From authenticate testUser: steve From authenticate HTTP_SESSION_VARS['ucAuthoUser']: steve From index testUser: steve From index HTTP_SESSION_VARS['ucAuthoUser']: Fatal error: Call to a member function on a non-object in /home/httpd/html/ucdamage/index.php on line 12 Note the testUser works in both instances, the session var only works inside the function. -Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]