Re: [PHP] no default value
At 1:46 PM +0100 7/17/07, Stut wrote: ... but you can get some of the way there by enabling the display of notices which will tell you whenever a variable is used without being initialised. How? Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] no default value
tedd wrote: At 1:46 PM +0100 7/17/07, Stut wrote: ... but you can get some of the way there by enabling the display of notices which will tell you whenever a variable is used without being initialised. How? Look in php.ini for error_reporting. With it enabled if you try to use a variable without assigning a value to it it will generate a notice. There are a lot of situations this won't cover, but it covers more than having it disabled. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] no default value
Is there a parameter in php.ini that requires all variables to be explicitly initialized, rather than being automatically assigned the value of false? -- @~@ Might, Courage, Vision, SINCERITY. / v \ Simplicity is Beauty! May the Force and Farce be with you! /( _ )\ (Xubuntu 7.04) Linux 2.6.22.1 ^ ^ 20:00:01 up 5 days 22:04 0 users load average: 0.00 0.00 0.00 news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] no default value
On Tue, Jul 17, 2007 at 08:01:59PM +0800, Man-wai Chang wrote: Is there a parameter in php.ini that requires all variables to be explicitly initialized, rather than being automatically assigned the value of false? Well, I am not aware of such php.ini variable, but I may recomment to increase your error level and you will be warned when you use uninicialized variable. -- Best regards, Daniel Gerzo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] no default value
Man-wai Chang wrote: Is there a parameter in php.ini that requires all variables to be explicitly initialized, rather than being automatically assigned the value of false? I think you'll find they get assigned the value of null, not false. There is no setting that enforces such a requirement, but you can get some of the way there by enabling the display of notices which will tell you whenever a variable is used without being initialised. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] no default value
On Tue, July 17, 2007 7:01 am, Man-wai Chang wrote: Is there a parameter in php.ini that requires all variables to be explicitly initialized, rather than being automatically assigned the value of false? No. There is a parameter in php.ini that tells you when you USE an uninitialized variable, however. error_reporting = E_ALL E_ALL includes E_NOTICE which is off by default which is just plain daft, if you ask me... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php as default value in html
hi... i have the following html line: input type=text name=referred value=?echo $old['Referred'];? accesskey=d id=id-referred the php variable $old['Referred'] was pulled from a mysql table. the full string that this variable holds is I work for you... but when used as a default value in an input text field for html the only part that shows up in the form itself is I. is there anything going on that im missing somewhere??
Re: [PHP] php as default value in html
--- Andy B [EMAIL PROTECTED] wrote: hi... i have the following html line: input type=text name=referred value=?echo $old['Referred'];? accesskey=d id=id-referred the php variable $old['Referred'] was pulled from a mysql table. the full string that this variable holds is I work for you... but when used as a default value in an input text field for html the only part that shows up in the form itself is I. is there anything going on that im missing somewhere?? Yes. Perform the subsitution manually. You'll get input type=text name=referred value=I work for you... accesskey=d id=id-referred You need quotes around the PHP code. input type=text name=referred value=?echo $old['Referred'];? accesskey=d id=id-referred = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway http://promotions.yahoo.com/design_giveaway/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php as default value in html
tnx that works now - Original Message - From: Mark [EMAIL PROTECTED] To: Andy B [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, April 04, 2004 11:32 AM Subject: Re: [PHP] php as default value in html --- Andy B [EMAIL PROTECTED] wrote: hi... i have the following html line: input type=text name=referred value=?echo $old['Referred'];? accesskey=d id=id-referred the php variable $old['Referred'] was pulled from a mysql table. the full string that this variable holds is I work for you... but when used as a default value in an input text field for html the only part that shows up in the form itself is I. is there anything going on that im missing somewhere?? Yes. Perform the subsitution manually. You'll get input type=text name=referred value=I work for you... accesskey=d id=id-referred You need quotes around the PHP code. input type=text name=referred value=?echo $old['Referred'];? accesskey=d id=id-referred = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway http://promotions.yahoo.com/design_giveaway/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php as default value in html
Mark wrote: --- Andy B [EMAIL PROTECTED] wrote: i have the following html line: input type=text name=referred value=?echo $old['Referred'];? accesskey=d id=id-referred the php variable $old['Referred'] was pulled from a mysql table. the full string that this variable holds is I work for you... but when used as a default value in an input text field for html the only part that shows up in the form itself is I. is there anything going on that im missing somewhere?? Yes. Perform the subsitution manually. You'll get input type=text name=referred value=I work for you... accesskey=d id=id-referred You need quotes around the PHP code. input type=text name=referred value=?echo $old['Referred'];? accesskey=d id=id-referred To prevent a cross site scripting vulnerability, you'll want to use htmlentities(), also. input type=text name=referred value=?echo htmlentities($old['Referred']);? accesskey=d id=id-referred Other wise the value could have a double quote within it and a malicious user could effectively end your input text box and inject their own HTML. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php as default value in html
htmlentities(), also. input type=text name=referred value=?echo htmlentities($old['Referred']);? accesskey=d id=id-referred Other wise the value could have a double quote within it and a malicious user could effectively end your input text box and inject their own HTML. is there any way to keep multiple users using the same form from mixing up variables -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php as default value in html
Andy B wrote: input type=text name=referred value=?echo htmlentities($old['Referred']);? accesskey=d id=id-referred Other wise the value could have a double quote within it and a malicious user could effectively end your input text box and inject their own HTML. is there any way to keep multiple users using the same form from mixing up variables I have no idea what you mean here. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php as default value in html
On Monday 05 April 2004 00:34, Andy B wrote: [non-standard quoting snipped] Please use a standard quoting mechanism, eg prefix each line of the quoted message with a ''. Why? Because most mail clients understands the standard quoting styles and are able to display the quoted parts of previous messages in a different format making it easy to distinguish the new stuff from the old. is there any way to keep multiple users using the same form from mixing up variables Each user requesting your form is serviced by a separate HTTP request. There are no variables to mix up and nothing to worry about. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* If you must work on your flight, you will experience turbulence as soon as you touch pen to paper -- Murphy's Laws for Frequent Flyers n5 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php as default value in html
is there any way to keep multiple users using the same form from mixing up variables I have no idea what you mean here. if user #1 logs in and starts using a form and then user #2 logs in and starts using the same one as user #1, say by chance they submit it at the same time... is there any way to keep the forms from overwriting each other... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php as default value in html
When someone pulls up a form and fills it out, they subsequently submit that form. When submitting a form your browser creates a one on one connection with the server where the server inputs the data from your form before or after the next person without mixing the two. (no matter if the two submitted simultaneously it know who is who) -Original Message- From: Andy B [mailto:[EMAIL PROTECTED] Sent: Sunday, April 04, 2004 1:35 PM To: [EMAIL PROTECTED] Subject: [PHP] php as default value in html is there any way to keep multiple users using the same form from mixing up variables I have no idea what you mean here. if user #1 logs in and starts using a form and then user #2 logs in and starts using the same one as user #1, say by chance they submit it at the same time... is there any way to keep the forms from overwriting each other... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [solved][PHP] php as default value in html
When someone pulls up a form and fills it out, they subsequently submit that form. When submitting a form your browser creates a one on one connection with the server where the server inputs the data from your form before or after the next person without mixing the two. (no matter if the two submitted simultaneously it know who is who) didnt know that tnx for the info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php