RE: [PHP] form variables issue
I'm not sure I understand the problem. Can you send a link to the page and post some code? Sincerely berber Visit the Weber Sites Today, To see where PHP might take you tomorrow. PHP code examples : http://www.weberdev.com Free Uptime Monitor : http://uptime.weberdev.com PHP content for your site : http://content.weber-sites.com -Original Message- From: All U Want [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 31, 2006 1:04 PM To: [php] PHP General List Subject: [PHP] form variables issue Hi folks, I'm sure it is a very simple question for you but I'm getting almost crazy. I've got a simple form with several form objects, one of them is a text field. After submitting the form if one of the form objects hasn't been modified I will show the same form but keeping the data previously introduced. My problem is the text field, I can't show any special characters again, even if there was any space only the first word is shown, etc. I've been playing with different function like urldecode, urlencode, stripslashes, htmlspecialchars, etc. but couldn't show the same text. Do you know how I can fix this? Thanks a lot, David. Note that magic_quotes_gpc is enabled. -- 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
Re: [PHP] form variables issue
Can you check the source code? are there values in source, but it is not displayed on the browser? input type=text value=My Name is Richard name=first_name check this code snippet ?php echo get_magic_quotes_gpc(); // 1 echo $_POST['lastname']; // O\'reilly echo addslashes($_POST['lastname']); // O\\\'reilly if (!get_magic_quotes_gpc()) { $lastname = addslashes($_POST['lastname']); } else { $lastname = $_POST['lastname']; } echo $lastname; // O\'reilly $sql = INSERT INTO lastnames (lastname) VALUES ('$lastname'); ? Thanks Richard On 1/31/06, All U Want [EMAIL PROTECTED] wrote: Hi folks, I'm sure it is a very simple question for you but I'm getting almost crazy. I've got a simple form with several form objects, one of them is a text field. After submitting the form if one of the form objects hasn't been modified I will show the same form but keeping the data previously introduced. My problem is the text field, I can't show any special characters again, even if there was any space only the first word is shown, etc. I've been playing with different function like urldecode, urlencode, stripslashes, htmlspecialchars, etc. but couldn't show the same text. Do you know how I can fix this? Thanks a lot, David. Note that magic_quotes_gpc is enabled. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form variables issue
On Tue, January 31, 2006 5:03 am, All U Want wrote: I'm sure it is a very simple question for you but I'm getting almost crazy. I've got a simple form with several form objects, one of them is a text field. After submitting the form if one of the form objects hasn't been modified I will show the same form but keeping the data previously introduced. My problem is the text field, I can't show any special characters again, even if there was any space only the first word is shown, etc. I've been playing with different function like urldecode, urlencode, stripslashes, htmlspecialchars, etc. but couldn't show the same text. Do you know how I can fix this? The first big problem is that you are outputting stuff like this: input name=foo value=this value has whitespace so is not a value / instead of this: input name=foo value=this value has whitespace but quotes matter / You should call http://php.net/htmlentities on the data right before you print it into the HTML page. ?php $value_html = htmlentities($value)? input name=foo value=?php echo $value_html? / Note that magic_quotes_gpc is enabled. In that case, you need to call http://php.net/stripslashes on the data before you do anything with it, except to cram it into a database. magic_quotes_gpc *ONLY* made sense in the context of the early days of PHP when 99.999% of the data was just getting tossed into a MySQL database and there were a lot less Bad Guys around -- when it was all guestbooks and lovey-dovey surfers. In today's world, Magic Quotes should probably just die... It's a shame, in a way, in that Magic Quotes is a nice simple solution to those simplistic applications that are just tossing data into a database, and not doing much else. But PHP has grown up a lot since then, and the world is a different place. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form variables
On Thursday 05 May 2005 17:46, Anasta wrote: Can anyone tell me how a submit button can be used to send set a variable so there is only a button --no textfield. Use hidden input fields. -- Cyberly yours, Petar Nedyalkov Devoted Orbitel Fan :-) PGP ID: 7AE45436 PGP Public Key: http://bu.orbitel.bg/pgp/bu.asc PGP Fingerprint: 7923 8D52 B145 02E8 6F63 8BDA 2D3F 7C0B 7AE4 5436 pgpwgBwu3MgP6.pgp Description: PGP signature
Re: [PHP] form variables
hi On 5/5/05, Anasta [EMAIL PROTECTED] wrote: Can anyone tell me how a submit button can be used to send set a variable so there is only a button --no textfield. use value= in the button html component -- bala balachandar muruganantham blog lynx http://chandar.blogspot.com web http://www.chennaishopping.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form variables
A hidden INPUT would be better... FORM ... INPUT TYPE=hidden NAME=yourVariableName VALUE=yourValue ... /FORM Bala Chandar [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] hi On 5/5/05, Anasta [EMAIL PROTECTED] wrote: Can anyone tell me how a submit button can be used to send set a variable so there is only a button --no textfield. use value= in the button html component -- bala balachandar muruganantham blog lynx http://chandar.blogspot.com web http://www.chennaishopping.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form variables + sessions, is this how it is supposed to work?
On Sunday 25 January 2004 04:02, Paul wrote: If I register a session variable, set its value with one form and then try to change its value with another form, it seems to retain only the original value and is not replaced with the newly posted one? Is this how it is supposed to work and I have to unset the variable to do this? Please include some *concise* code illustrating your problem. -- 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 -- /* I am ready to meet my Maker. Whether my Maker is prepared for the great ordeal of meeting me is another matter. -- Winston Churchill */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form variables + sessions, is this how it is supposed to work?
OK thanks. I figured out my problem but I am not sure why this is. I am trying to impliment a back button to allow the user to go back and change form values. If I uses sessions and register $test then this does not work, it sticks does not change the value of $test if the user re-submits: input name=test type=text value=?php echo $test;?/ Thanks for any help! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form variables + sessions, is this how it is supposed to work? - Grammar corrected
I figured out my problem but I am not sure why this is. I am trying to implement a back button to allow the user to go back and change form values. If I use sessions and register $test then this does not work, the value of $test does not change if the user re-submits: input name=test type=text value=?php echo $test;?/ Thanks for any help! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] form variables
-Oorspronkelijk bericht- Van: Nitin [mailto:[EMAIL PROTECTED] Verzonden: zaterdag 20 december 2003 7:30 Aan: PHP-General Onderwerp: [PHP] form variables i've an application, where i'm receiving variables from an html form and process them in the script. depending on the values, i may want to get some extra information from user through another form. now, problem is how can i keep the vaiables received from the first form, without passing them as query string to the next script or specifying as hidden form fields. You could use sessions to keep track of your data between different scripts without reposting anything http://www.php.net/manual/en/ref.session.php Regards, Ewout -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form variables
On Sat, 2003-12-20 at 01:29, Nitin wrote: hi all, i've an application, where i'm receiving variables from an html form and process them in the script. depending on the values, i may want to get some extra information from user through another form. now, problem is how can i keep the vaiables received from the first form, without passing them as query string to the next script or specifying as hidden form fields. i'll really appreciate a quick help. thanx in advance Sessions. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form variables
thanx for a quick reply and i'm sorry for it was so dumb qu nitin - Original Message - From: Robert Cummings [EMAIL PROTECTED] To: Nitin [EMAIL PROTECTED] Cc: PHP-General [EMAIL PROTECTED] Sent: Saturday, December 20, 2003 11:59 AM Subject: Re: [PHP] form variables On Sat, 2003-12-20 at 01:29, Nitin wrote: hi all, i've an application, where i'm receiving variables from an html form and process them in the script. depending on the values, i may want to get some extra information from user through another form. now, problem is how can i keep the vaiables received from the first form, without passing them as query string to the next script or specifying as hidden form fields. i'll really appreciate a quick help. thanx in advance Sessions. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- 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
Re: [PHP] Form variables lost when duplicate records are found!
[snip] then the forms variables are stored and NOT LOST ?? [/snip] Have you looked into sessions? http://www.php.net/manual/en/ref.session.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form variables lost when duplicate records are found !
--- Pushpinder Singh Garcha [EMAIL PROTECTED] wrote: I am making use of a php form to add company details to a MySQL Database. Before I add the form variables I am checking to see if the SAME company name exists in the DB. If the same company exists, then a notification is provided. In between this , the variables that were entered on the form are LOST. Is there anyway I can store the variables so that if a duplicate record was found to be present, then the forms variables are stored and NOT LOST ?? Of course. However, I don't understand what you need help with. Is there anyway I can store the variables... There are many ways to store data with PHP. You can use the filesystem, a database, etc. Are you asking how to store data? Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form variables lost when duplicate records are found !
From: Pushpinder Singh Garcha [EMAIL PROTECTED] I am making use of a php form to add company details to a MySQL Database. Before I add the form variables I am checking to see if the SAME company name exists in the DB. If the same company exists, then a notification is provided. In between this , the variables that were entered on the form are LOST. Is there anyway I can store the variables so that if a duplicate record was found to be present, then the forms variables are stored and NOT LOST ?? Any suggestions would be greatly appreciated ! Thanks in advance How do you display the form again when there is a notification? Something as simple as: input type=text name=some_name value=? echo htmlentities($_POST['some_name']); ? will (safely) remember POSTed variables when you show the form again. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form variables lost when duplicate records are found !
I am currently using sessions on my site // are you suggesting that I store all the possible 30 form variables in a temp session array. ?? and destroy it afterwards Thanks -Pushpinder On Tuesday, September 2, 2003, at 04:41 PM, Matt Matijevich wrote: [snip] then the forms variables are stored and NOT LOST ?? [/snip] Have you looked into sessions? http://www.php.net/manual/en/ref.session.php -- 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
Fwd: Re: [PHP] Form variables lost when duplicate records arefound !
The approach of using $_GET variables would just make the URL very very long, like imagine having to pass close to 33 variables on the form. The other option wud be to use $_SESSION array to store the form variables. Does anyone have nay other suggestion.? Thanks in advance ! /pS On Tuesday, September 2, 2003, at 05:13 PM, Matt Matijevich wrote: [snip] when the user comes back to the add_new.php [/snip] I would use session vars in this case. You could also use get variables. Say the company name is in the database and you have to redirect back to add_new.php, in your header call you could say something like: header(Location: add_new.php?field1=$_POST[field1]field2=$_POST[field2]) but I would just use session vars. Pushpinder Singh Garcha [EMAIL PROTECTED] 09/02/03 04:03PM This is the way it works there is a table with company name as the primary key. 1. A logged in User enters details of the company he/she wants to ad to to the MySQL DB. This form is embedded in add_new.php which call add_new_result.php as a POST method. 2. if the company name exists in the DB the user is alerted and and asked to choose a different company name. Now my question is , when the user comes back to the add_new.php page he looses all the data that he had entered. I hope this makes it clear. Thanks again --pS On Tuesday, September 2, 2003, at 04:51 PM, Matt Matijevich wrote: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form Variables not getting passed || Apache, MySql, Win2k Setup
Mind giving a code snippet? Noah wrote: Thanks for the pleasant acronym, Leif. However, setting register_globals on or off makes no difference. The variables are still not getting evaluated BTW works fine on my laptop (Apache, MySql, Linux) --Noah - Original Message - From: Leif K-Brooks [EMAIL PROTECTED] To: CF High [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, January 29, 2003 1:38 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup RTFM! Your problem is register_globals. CF High wrote: Hey all. This driving me nuts: I've got Apache, MySql, and Windows 2000 running on my local machine. In order to get passed php variables evaluated, whether via a url query string, or through a form post, I have to use this syntax: $_REQUEST[$my_passed_variable] I have no such problem with our hosting company servers; i.e. I can access query_string and form posted variables as $my_passed_variable. What is going on here? Is there something in php.ini that needs to be adjusted? Any help whatsoever here is much appreciated, --Noah -- -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
Re: [PHP] Form Variables not getting passed || Apache, MySql, Win2k Setup
One too many $'s in your code, use: $_REQUEST['my_passed_variable'] This is how all arrays work, autoglobals are the same. See also: http://www.php.net/variables.external http://www.php.net/variables.predefined Regards, Philip On Wed, 29 Jan 2003, CF High wrote: Hey all. This driving me nuts: I've got Apache, MySql, and Windows 2000 running on my local machine. In order to get passed php variables evaluated, whether via a url query string, or through a form post, I have to use this syntax: $_REQUEST[$my_passed_variable] I have no such problem with our hosting company servers; i.e. I can access query_string and form posted variables as $my_passed_variable. What is going on here? Is there something in php.ini that needs to be adjusted? Any help whatsoever here is much appreciated, --Noah -- -- 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
Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup
At 01:36 30.01.2003, CF High said: [snip] However, setting register_globals on or off makes no difference. The variables are still not getting evaluated [snip] I _BET_ it's register_globals. Did you restart the webserver in case PHP is loaded as a module? Anyway: it's a lot safer having register_globals set to off (see http://www.php.net/manual/en/security.registerglobals.php#security.registerg lobals for a discussion on security issues). For example, assuming that a certain cookie value is available, with register_globals on this value may be forged by passing the value as part of the url. A lot of different possibilities arise. -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup
Yup. Restarted Apache. PHP's still not evaluating the passed form vars whether register globals is set to On or Off --Noah - Original Message - From: Ernest E Vogelsinger [EMAIL PROTECTED] To: CF High [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, January 29, 2003 2:23 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup At 01:36 30.01.2003, CF High said: [snip] However, setting register_globals on or off makes no difference. The variables are still not getting evaluated [snip] I _BET_ it's register_globals. Did you restart the webserver in case PHP is loaded as a module? Anyway: it's a lot safer having register_globals set to off (see http://www.php.net/manual/en/security.registerglobals.php#security.registerg lobals for a discussion on security issues). For example, assuming that a certain cookie value is available, with register_globals on this value may be forged by passing the value as part of the url. A lot of different possibilities arise. -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup
I don't want to use $_REQUEST['my_passed_variable'] at all. Right now when I do an sql insert on my local machine I have to use the following syntax: INSERT into tablename (field name list) VALUES ($_REQUEST['var1'], $_REQUEST['var2'], $_REQUEST['var3']) I just want to use $var1, $var2, $var3 --Noah - Original Message - From: Philip Olson [EMAIL PROTECTED] To: CF High [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, January 29, 2003 2:23 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup One too many $'s in your code, use: $_REQUEST['my_passed_variable'] This is how all arrays work, autoglobals are the same. See also: http://www.php.net/variables.external http://www.php.net/variables.predefined Regards, Philip On Wed, 29 Jan 2003, CF High wrote: Hey all. This driving me nuts: I've got Apache, MySql, and Windows 2000 running on my local machine. In order to get passed php variables evaluated, whether via a url query string, or through a form post, I have to use this syntax: $_REQUEST[$my_passed_variable] I have no such problem with our hosting company servers; i.e. I can access query_string and form posted variables as $my_passed_variable. What is going on here? Is there something in php.ini that needs to be adjusted? Any help whatsoever here is much appreciated, --Noah -- -- 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
Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup
At 02:48 30.01.2003, Noah said: [snip] Yup. Restarted Apache. PHP's still not evaluating the passed form vars whether register globals is set to On or Off [snip] Just thinking the unthinkable... Most of the time, default settings are commented out in php.ini, like this: ; register_globals = Off I fell into this trap sometimes by overseeing the semicolon and simply changing the value with no effect whatsoever. Would you mind to take a look? If this isn't the case here I don't have a clue as to what's going on... Did you mention the version? Possibly there's a special build here that never allows to register globals? (config gurus chime in here please) -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup
then run extract($_REQUEST); just above where you want to use the var1 var2... and it will place all the key = value pairs into the local scope. Jim - Original Message - From: Noah [EMAIL PROTECTED] To: Philip Olson [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, January 29, 2003 5:55 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup I don't want to use $_REQUEST['my_passed_variable'] at all. Right now when I do an sql insert on my local machine I have to use the following syntax: INSERT into tablename (field name list) VALUES ($_REQUEST['var1'], $_REQUEST['var2'], $_REQUEST['var3']) I just want to use $var1, $var2, $var3 --Noah - Original Message - From: Philip Olson [EMAIL PROTECTED] To: CF High [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, January 29, 2003 2:23 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup One too many $'s in your code, use: $_REQUEST['my_passed_variable'] This is how all arrays work, autoglobals are the same. See also: http://www.php.net/variables.external http://www.php.net/variables.predefined Regards, Philip On Wed, 29 Jan 2003, CF High wrote: Hey all. This driving me nuts: I've got Apache, MySql, and Windows 2000 running on my local machine. In order to get passed php variables evaluated, whether via a url query string, or through a form post, I have to use this syntax: $_REQUEST[$my_passed_variable] I have no such problem with our hosting company servers; i.e. I can access query_string and form posted variables as $my_passed_variable. What is going on here? Is there something in php.ini that needs to be adjusted? Any help whatsoever here is much appreciated, --Noah -- -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup
On Thursday 30 January 2003 09:55, Noah wrote: I don't want to use $_REQUEST['my_passed_variable'] at all. Right now when I do an sql insert on my local machine I have to use the following syntax: INSERT into tablename (field name list) VALUES ($_REQUEST['var1'], $_REQUEST['var2'], $_REQUEST['var3']) I just want to use $var1, $var2, $var3 Are you trying to use these inside a function? If so, look up variable scope in the manual. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Most people have a mind that's open by appointment only. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup
Sure. In the code below, class_type is passed in the query_string (e.g. index.php?section_id=12page_type=class_submitclass_type=apartments) Also, below sql values are sent via a post. Code Snippet *** switch($_REQUEST['class_type']) { case 'apartments'; dbConnect(INSERT into c_apart_data (submit_date, apart_type_id, location, bedrooms, rent, heat, lease, deposit, pets, phone, email, blurb) Values('$submit_date', '$apart_type_id', '$location', '$bedrooms', '$rent', '$heat', '$lease', '$deposit', '$pets', '$phone', '$email', '$blurb')); break; more code ** Let me know if you need more info, --Noah - Original Message - From: Leif K-Brooks To: Noah Cc: [EMAIL PROTECTED] Sent: Wednesday, January 29, 2003 2:19 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup Mind giving a code snippet? Noah wrote: Thanks for the pleasant acronym, Leif. However, setting register_globals on or off makes no difference. The variables are still not getting evaluated BTW works fine on my laptop (Apache, MySql, Linux) --Noah - Original Message - From: Leif K-Brooks mailto:[EMAIL PROTECTED] To: CF High mailto:[EMAIL PROTECTED]; mailto:[EMAIL PROTECTED] Sent: Wednesday, January 29, 2003 1:38 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup RTFM! Your problem is register_globals. CF High wrote: Hey all. This driving me nuts: I've got Apache, MySql, and Windows 2000 running on my local machine. In order to get passed php variables evaluated, whether via a url query string, or through a form post, I have to use this syntax: $_REQUEST[$my_passed_variable] I have no such problem with our hosting company servers; i.e. I can access query_string and form posted variables as $my_passed_variable. What is going on here? Is there something in php.ini that needs to be adjusted? Any help whatsoever here is much appreciated, --Noah -- -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup
At 02:55 30.01.2003, Noah said: [snip] I don't want to use $_REQUEST['my_passed_variable'] at all. Right now when I do an sql insert on my local machine I have to use the following syntax: INSERT into tablename (field name list) VALUES ($_REQUEST['var1'], $_REQUEST['var2'], $_REQUEST['var3']) I just want to use $var1, $var2, $var3 [snip] You can always resort to extract($_REQUEST); -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup
why would it matter if he does it just above the place that he is going to use them? doesn't matter if he is in a function or not. the $_REQUEST var will always be available. if he calls a function then he would have to do it just inside the function or pass it to the function. Jim - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 29, 2003 2:59 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup On Thursday 30 January 2003 09:55, Noah wrote: I don't want to use $_REQUEST['my_passed_variable'] at all. Right now when I do an sql insert on my local machine I have to use the following syntax: INSERT into tablename (field name list) VALUES ($_REQUEST['var1'], $_REQUEST['var2'], $_REQUEST['var3']) I just want to use $var1, $var2, $var3 Are you trying to use these inside a function? If so, look up variable scope in the manual. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Most people have a mind that's open by appointment only. */ -- 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
Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup
Checked out the php.ini file. register_globals is set to On -- there is no semicolon or other character that would cause a problem. This might be a problem with the Apache, Win2k combination -- I don't know.. --Noah - Original Message - From: Ernest E Vogelsinger [EMAIL PROTECTED] To: Noah [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, January 29, 2003 2:55 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup At 02:48 30.01.2003, Noah said: [snip] Yup. Restarted Apache. PHP's still not evaluating the passed form vars whether register globals is set to On or Off [snip] Just thinking the unthinkable... Most of the time, default settings are commented out in php.ini, like this: ; register_globals = Off I fell into this trap sometimes by overseeing the semicolon and simply changing the value with no effect whatsoever. Would you mind to take a look? If this isn't the case here I don't have a clue as to what's going on... Did you mention the version? Possibly there's a special build here that never allows to register globals? (config gurus chime in here please) -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup
H. Sounds like resorting to extract($REQUEST) might have a downside? Otherwise, I'll use it for now. Thanks, --Noah - Original Message - From: Ernest E Vogelsinger [EMAIL PROTECTED] To: Noah [EMAIL PROTECTED] Cc: Philip Olson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, January 29, 2003 2:58 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup At 02:55 30.01.2003, Noah said: [snip] I don't want to use $_REQUEST['my_passed_variable'] at all. Right now when I do an sql insert on my local machine I have to use the following syntax: INSERT into tablename (field name list) VALUES ($_REQUEST['var1'], $_REQUEST['var2'], $_REQUEST['var3']) I just want to use $var1, $var2, $var3 [snip] You can always resort to extract($_REQUEST); -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup
You never answered if this was in a function or class method. Is it? Did you say whether it was Apache 1 or 2? ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -Original Message- From: Noah [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 30, 2003 12:35 AM To: Ernest E Vogelsinger Cc: Philip Olson; [EMAIL PROTECTED] Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup H. Sounds like resorting to extract($REQUEST) might have a downside? Otherwise, I'll use it for now. Thanks, --Noah - Original Message - From: Ernest E Vogelsinger [EMAIL PROTECTED] To: Noah [EMAIL PROTECTED] Cc: Philip Olson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, January 29, 2003 2:58 PM Subject: Re: [PHP] Form Variables not getting passed || Apache, MySql, Win 2k Setup At 02:55 30.01.2003, Noah said: [snip] I don't want to use $_REQUEST['my_passed_variable'] at all. Right now when I do an sql insert on my local machine I have to use the following syntax: INSERT into tablename (field name list) VALUES ($_REQUEST['var1'], $_REQUEST['var2'], $_REQUEST['var3']) I just want to use $var1, $var2, $var3 [snip] You can always resort to extract($_REQUEST); -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- 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
RE: [PHP] Form Variables not getting passed || Apache, MySql, Win2k Setup
You never answered if this was in a function or class method. Is it? Did you say whether it was Apache 1 or 2? Also, to check what the register_globals setting really is, make a call to phpinfo() as it will tell you the true setting. Sometimes the wrong php.ini is edited or the web server wasn't restarted or .htaccess/httpd.conf gets in the way or ... ... Regards, Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form variables not working
Because it isn't? Instead of echoing $PHP_SELF, echo $_SERVER['PHP_SELF']. With the $_POST problem, it's complaining that you're using a variable that isn't defined. Use? ?php if(array_key_exists('formfieldnamegoeshere',$_POST)){ print $_POST['formfieldnamegoeshere']; } ? Chris Jackson wrote: Im an experianced ASP developer and im getting frustrated with PHP. why is it so dificult to do the simplest things in php? thanks -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form variables not working
At 17:36 16.11.2002, Chris Jackson said: [snip] I am havein troubles gettin my form variables to work. The register_globals in php.ini is set to its default of off. the ?php echo $PHP_SELF ? dosent print anything in the action of the form That's because register_globals is off :) The PHP_SELF value is contained in the $_SERVER superglobal array and you may access it anytime, everywhere as $_SERVER['PHP_SELF']. and the echo $_POST[answered]; on the first run gives an error that says that answered is an undefined variable. but on the second submit this error is gone with the submitted data displaying correctly. This is not an error you see but a Notice or Warning that you are using a variable (or an array index) that has not been defined yet. While this is not necessary in this siziation it might point out a possible source of problems under other circumstances, allowing you to spot why your script doesn't work as expected. You could either if (array_key_exists('answered', $_POST)) to avoid the warning, or error_reporting(E_ALL ~(E_NOTICE|E_WARNING)) to switch off notices or warnings for this script, if you are prepared to do so... Im an experianced ASP developer and im getting frustrated with PHP. why is it so dificult to do the simplest things in php? It's not difficult at all, it's just slightly different to ASP. You'll love PHP, promised... -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form variables not working
On Sunday 17 November 2002 00:36, Chris Jackson wrote: I am havein troubles gettin my form variables to work. The register_globals in php.ini is set to its default of off. [snip] the ?php echo $PHP_SELF ? dosent print anything in the action of the form and the Because register globals is disabled you have to use $_SERVER['PHP_SELF'], that's covered in the manual. echo $_POST[answered]; on the first run gives an error that says that answered is an undefined variable. That's because the first time you run it you have not submitted a form yet so it's undefined. Various ways to get around this, most straight forward (IMO) being: if (isset($_post['answered'])) { echo $_post['answered']; } -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* This is a test of the emergency broadcast system. Had there been an actual emergency, then you would no longer be here. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form variables vs Sessions
Follow your instincts and do some research into sessions. I've put enormous amounts of data into sessions before on high-traffic sites without much trouble. You need to have the memory for it, of course, but it takes a lot of form data to equate to any significant amount. Chances are you'll be just fine. Also, consider that the more data you have in the session, the less data you're passing along in every single request and every single response. You might notice some significant performance improvements. Chris John W wrote: I am having a problem with a form system that I am developing. It is a multi page form with over a hundred different possible variables. The problem that I'm having is that when a user enters invalid data on one page and then submits to the next page I want that page to go back to the previous page with the form fields already filled in. Currently I have the form going to the previous page with a custom error message, but am having a problem with getting the fields filled in. I pass the variables from page to page by using PHP to convert them to hidden form fields. I have considered using sessions but am concerned with the high overhead due to the number of variables. Any help with this problem would be greatly appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form variables
I am guessing you mean the input is a textarea. At any rate, I believe what you want is nl2br() Happy hacking. Chris Hans Prins wrote: Hello, I have a form field of the type scrolling text box it lets users input a multiline string. I then pass this string as a variable to a php document that prints this string to the screen: print $mailingAddressbr; however. this outputs it all in one line. Does anyone have an idea as to how I can print this to the screen in the same way the user has input the info: in multiple lines? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form variables
thank you very much :-) Chris Shiflett [EMAIL PROTECTED] schreef in bericht [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I am guessing you mean the input is a textarea. At any rate, I believe what you want is nl2br() Happy hacking. Chris Hans Prins wrote: Hello, I have a form field of the type scrolling text box it lets users input a multiline string. I then pass this string as a variable to a php document that prints this string to the screen: print $mailingAddressbr; however. this outputs it all in one line. Does anyone have an idea as to how I can print this to the screen in the same way the user has input the info: in multiple lines? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form variables
The text field only has newlines (\n) not breaks. For starters, in the text area tag, you need wrap=virtual: TEXTAREA name=mailingAddress wrap=virtual rows=6 cols=40/TEXTAREA Then instead of print $mailingAddressbr; try print nl2br($mailingAddress).br; ... which converts all new lines (\n) into breaks (br /) Regards, Justin on 10/09/02 2:21 PM, Hans Prins ([EMAIL PROTECTED]) wrote: Hello, I have a form field of the type scrolling text box it lets users input a multiline string. I then pass this string as a variable to a php document that prints this string to the screen: print $mailingAddressbr; however. this outputs it all in one line. Does anyone have an idea as to how I can print this to the screen in the same way the user has input the info: in multiple lines? Thanks in advance :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form Variables
On Saturday, June 8, 2002 at 1:56:35 AM, you wrote: I recently installed PHP 4.2.1 on my G4 Powerbook (OS X v10.1.4) running Apache 1.3.2. I have verified that php is running and apache is running. When I access a page locally http://127.0.0.1/simple_form.php, fill in the only text box and submit the form to form_act.php. The variable doesn't exist (as far as PHP is concerned. I have tested for its existance using an IF ELSE). This happens with POST as well as GET, but when using GET I can obviously see the variable name and value in the URL. Do I need to change the default config for apache?? Or PHP? Can anyone please help before I go completely crazy. Are you using $_GET['varname']/$_POST['varname'] or just $varname? If you are trying to use the latter, I suggest you read the release note for the software you just installed: http://www.php.net/release_4_2_1.php (specifically the 'External Variables' section). -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form Variables
I just read the release notes and do not believe they are referring to my dilemma. Here is the code I am using. Just a basic form Form.php body form action=form_act.php method=get enctype=multipart/form-data pPhrase: input name=phrase type=text id=phrase /p input name=Submit type=submit value=Submit /form /body Form_act.php ? if ($phrase){ echo Phrase-- $phrase;} Else{ echo No Variables;} ? On 6/7/02 9:08 PM, Stuart Dallas [EMAIL PROTECTED] wrote: On Saturday, June 8, 2002 at 1:56:35 AM, you wrote: I recently installed PHP 4.2.1 on my G4 Powerbook (OS X v10.1.4) running Apache 1.3.2. I have verified that php is running and apache is running. When I access a page locally http://127.0.0.1/simple_form.php, fill in the only text box and submit the form to form_act.php. The variable doesn't exist (as far as PHP is concerned. I have tested for its existance using an IF ELSE). This happens with POST as well as GET, but when using GET I can obviously see the variable name and value in the URL. Do I need to change the default config for apache?? Or PHP? Can anyone please help before I go completely crazy. Are you using $_GET['varname']/$_POST['varname'] or just $varname? If you are trying to use the latter, I suggest you read the release note for the software you just installed: http://www.php.net/release_4_2_1.php (specifically the 'External Variables' section). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form Variables
Actually, they are. You are assuming the PHP directive register_globals = on when using $phrase from the form below. register_globals = on is what creates $phrase. As of PHP 4.2.0 the default value for register_globals has become off. Regardless, there are other options: Try either: // Worked since PHP 3 (forever) print $HTTP_GET_VARS['phrase']; // Worked since PHP 4.1.0 print $_GET['phrase']; print $_REQUEST['phrase']; // Worked since PHP 4.1.0 too // See docs for details (see also extract()) import_request_variables('gpc', 'r_'); print $r_phrase; Those are some options. See also: http://www.php.net/manual/en/language.variables.predefined.php Regards, Philip Olson On Fri, 7 Jun 2002, Beeman wrote: I just read the release notes and do not believe they are referring to my dilemma. Here is the code I am using. Just a basic form Form.php body form action=form_act.php method=get enctype=multipart/form-data pPhrase: input name=phrase type=text id=phrase /p input name=Submit type=submit value=Submit /form /body Form_act.php ? if ($phrase){ echo Phrase-- $phrase;} Else{ echo No Variables;} ? On 6/7/02 9:08 PM, Stuart Dallas [EMAIL PROTECTED] wrote: On Saturday, June 8, 2002 at 1:56:35 AM, you wrote: I recently installed PHP 4.2.1 on my G4 Powerbook (OS X v10.1.4) running Apache 1.3.2. I have verified that php is running and apache is running. When I access a page locally http://127.0.0.1/simple_form.php, fill in the only text box and submit the form to form_act.php. The variable doesn't exist (as far as PHP is concerned. I have tested for its existance using an IF ELSE). This happens with POST as well as GET, but when using GET I can obviously see the variable name and value in the URL. Do I need to change the default config for apache?? Or PHP? Can anyone please help before I go completely crazy. Are you using $_GET['varname']/$_POST['varname'] or just $varname? If you are trying to use the latter, I suggest you read the release note for the software you just installed: http://www.php.net/release_4_2_1.php (specifically the 'External Variables' section). -- 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
Re: [PHP] Form Variables
You are correct. My web server is Running 4.2.1 and all of the sites are still working.. That is why I assumed that it was a problem locally, but after looking at the web server the globals is turned on. Thanks.. I can go forward now. I appreciate your help On 6/7/02 9:33 PM, Philip Olson [EMAIL PROTECTED] wrote: Actually, they are. You are assuming the PHP directive register_globals = on when using $phrase from the form below. register_globals = on is what creates $phrase. As of PHP 4.2.0 the default value for register_globals has become off. Regardless, there are other options: Try either: // Worked since PHP 3 (forever) print $HTTP_GET_VARS['phrase']; // Worked since PHP 4.1.0 print $_GET['phrase']; print $_REQUEST['phrase']; // Worked since PHP 4.1.0 too // See docs for details (see also extract()) import_request_variables('gpc', 'r_'); print $r_phrase; Those are some options. See also: http://www.php.net/manual/en/language.variables.predefined.php Regards, Philip Olson On Fri, 7 Jun 2002, Beeman wrote: I just read the release notes and do not believe they are referring to my dilemma. Here is the code I am using. Just a basic form Form.php body form action=form_act.php method=get enctype=multipart/form-data pPhrase: input name=phrase type=text id=phrase /p input name=Submit type=submit value=Submit /form /body Form_act.php ? if ($phrase){ echo Phrase-- $phrase;} Else{ echo No Variables;} ? On 6/7/02 9:08 PM, Stuart Dallas [EMAIL PROTECTED] wrote: On Saturday, June 8, 2002 at 1:56:35 AM, you wrote: I recently installed PHP 4.2.1 on my G4 Powerbook (OS X v10.1.4) running Apache 1.3.2. I have verified that php is running and apache is running. When I access a page locally http://127.0.0.1/simple_form.php, fill in the only text box and submit the form to form_act.php. The variable doesn't exist (as far as PHP is concerned. I have tested for its existance using an IF ELSE). This happens with POST as well as GET, but when using GET I can obviously see the variable name and value in the URL. Do I need to change the default config for apache?? Or PHP? Can anyone please help before I go completely crazy. Are you using $_GET['varname']/$_POST['varname'] or just $varname? If you are trying to use the latter, I suggest you read the release note for the software you just installed: http://www.php.net/release_4_2_1.php (specifically the 'External Variables' section). -- 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
Re: [PHP] form variables
On Mon, 4 Mar 2002, Craig Westerman wrote: form action=quotestestphp method=post input type=text name=quote maxlength=10 size=10 input type=submit name=submitquote VALUE=Get Quote /form The above form passes $quote to the page quotestestphp How can I also pass the $quote to the URL so that the page with variable can be bookmarked? Do I have to modify both pages or just the input form? form action=quotestestphp?quote=?=$quote? method=post -- --- Greg Donald - http://destineycom/ http://phpratedcom/ | http://phplinksorg/ | http://phptopsitescom/ --- -- PHP General Mailing List (http://wwwphpnet/) To unsubscribe, visit: http://wwwphpnet/unsubphp
RE: [PHP] form variables
Thanks Donald, I tried that before and this is URL returnedquotestest.php?quote= Craig [EMAIL PROTECTED] -Original Message- From: Greg Donald [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 7:17 PM To: Craig Westerman Cc: php-general-list Subject: Re: [PHP] form variables On Mon, 4 Mar 2002, Craig Westerman wrote: form action=quotestest.php method=post input type=text name=quote maxlength=10 size=10 input type=submit name=submitquote VALUE=Get Quote /form The above form passes $quote to the page quotestest.php How can I also pass the $quote to the URL so that the page with variable can be bookmarked? Do I have to modify both pages or just the input form? form action=quotestest.php?quote=?=$quote? method=post -- --- Greg Donald - http://destiney.com/ http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/ --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] form variables
Do you mean to have the extra '=' in there? Should it be: form action=quotestest.php?quote=?$quote? method=post instead of form action=quotestest.php?quote=?=$quote? method=post ? -Original Message- From: Craig Westerman [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 6:27 PM To: php-general-list; Greg Donald Subject: RE: [PHP] form variables Thanks Donald, I tried that before and this is URL returnedquotestest.php?quote= Craig [EMAIL PROTECTED] -Original Message- From: Greg Donald [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 7:17 PM To: Craig Westerman Cc: php-general-list Subject: Re: [PHP] form variables On Mon, 4 Mar 2002, Craig Westerman wrote: form action=quotestest.php method=post input type=text name=quote maxlength=10 size=10 input type=submit name=submitquote VALUE=Get Quote /form The above form passes $quote to the page quotestest.php How can I also pass the $quote to the URL so that the page with variable can be bookmarked? Do I have to modify both pages or just the input form? form action=quotestest.php?quote=?=$quote? method=post -- --- Greg Donald - http://destiney.com/ http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/ --- -- 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
Re: [PHP] form variables
hi Use form action=quotestest.php method=get This will work as long as the form is not too big Tom At 11:14 AM 5/03/2002, Craig Westerman wrote: form action=quotestest.php method=post input type=text name=quote maxlength=10 size=10 input type=submit name=submitquote VALUE=Get Quote /form The above form passes $quote to the page quotestest.php How can I also pass the $quote to the URL so that the page with variable can be bookmarked? Do I have to modify both pages or just the input form? Thanks Craig [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] form variables
change post to get -Original Message- From: Dan Vande More [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 05, 2002 12:48 PM To: php-general-list Subject: RE: [PHP] form variables Do you mean to have the extra '=' in there? Should it be: form action=quotestest.php?quote=?$quote? method=post instead of form action=quotestest.php?quote=?=$quote? method=post ? -Original Message- From: Craig Westerman [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 6:27 PM To: php-general-list; Greg Donald Subject: RE: [PHP] form variables Thanks Donald, I tried that before and this is URL returnedquotestest.php?quote= Craig [EMAIL PROTECTED] -Original Message- From: Greg Donald [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 7:17 PM To: Craig Westerman Cc: php-general-list Subject: Re: [PHP] form variables On Mon, 4 Mar 2002, Craig Westerman wrote: form action=quotestest.php method=post input type=text name=quote maxlength=10 size=10 input type=submit name=submitquote VALUE=Get Quote /form The above form passes $quote to the page quotestest.php How can I also pass the $quote to the URL so that the page with variable can be bookmarked? Do I have to modify both pages or just the input form? form action=quotestest.php?quote=?=$quote? method=post -- --- Greg Donald - http://destiney.com/ http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/ --- -- 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
RE: [PHP] form variables
OK, changing from post to get gets me what I'm after. Thanks guys. Something odd though. If I type in RHAT and hit enter, I get this URL which is what I want. quotestest.php?quote=RHAT If I type in RHAT and click submit button, I get this URL which I don't like. quotestest.php?quote=RHATsubmitquote=Get+Quote How do I get rid of the extrasubmitquote=Get+Quote in the URL? Why is enter and submit acting differently? Thanks Craig [EMAIL PROTECTED] -Original Message- From: Tom Rogers [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 8:07 PM To: Craig Westerman; php-general-list Subject: Re: [PHP] form variables hi Use form action=quotestest.php method=get This will work as long as the form is not too big Tom form action=quotestest.php method=post input type=text name=quote maxlength=10 size=10 input type=submit name=submitquote VALUE=Get Quote /form -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] form variables
remove the name from the submit so it's just: input type=submit VALUE=Get Quote -Original Message- From: Craig Westerman [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 05, 2002 1:52 PM To: php-general-list; Tom Rogers Subject: RE: [PHP] form variables OK, changing from post to get gets me what I'm after. Thanks guys. Something odd though. If I type in RHAT and hit enter, I get this URL which is what I want. quotestest.php?quote=RHAT If I type in RHAT and click submit button, I get this URL which I don't like. quotestest.php?quote=RHATsubmitquote=Get+Quote How do I get rid of the extrasubmitquote=Get+Quote in the URL? Why is enter and submit acting differently? Thanks Craig [EMAIL PROTECTED] -Original Message- From: Tom Rogers [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 8:07 PM To: Craig Westerman; php-general-list Subject: Re: [PHP] form variables hi Use form action=quotestest.php method=get This will work as long as the form is not too big Tom form action=quotestest.php method=post input type=text name=quote maxlength=10 size=10 input type=submit name=submitquote VALUE=Get Quote /form -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] form variables
On Tuesday 05 March 2002 10:52, Craig Westerman wrote: OK, changing from post to get gets me what I'm after. Thanks guys. Something odd though. If I type in RHAT and hit enter, I get this URL which is what I want. quotestest.php?quote=RHAT If I type in RHAT and click submit button, I get this URL which I don't like. quotestest.php?quote=RHATsubmitquote=Get+Quote How do I get rid of the extrasubmitquote=Get+Quote in the URL? Why is enter and submit acting differently? I think whether the submitquote=Get+Quote appears in the URL or not depends on the browser. Some browsers (Opera), submits the 'whole' form when you press enter, and it's equivalent to clicking on Submit. Others (IE), do not send the 'whole' form and is not equivalent to clicking on Submit. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Patageometry, n.: The study of those mathematical properties that are invariant under brain transplants. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form variables
Michael George wrote: I read this after I'd created a script which generates a form with a 2D array on it. But as I test it, it seems to work. In short, it the 1D array a limitation of HTML or PHP? I think it is a limitation of PHP 3. It should work with PHP 4. HTML is not responsible here. If it's a risky structure to use, I'll find a way to work it into a single dimensional array... This shouldn't be necessary, unless you want to be PHP3-compatible. regards Wagner -- Assumption is the mother of all fuck-ups. -- 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] Form Variables!!!!!
My problem is: I wanna know the names of the variables that my actual page recives from the last page (using the POST method). while( list( $formVarName, $formVarValue = each( $HTTP_POST_VARS )) { echo "$formVarName = $formVarValuebr\n"; } Chris
Re: [PHP] form variables showing blank but query shows non-blank ??
Show us all the code you chopped out, or at least every single line that mentions $pass_category. Or, faster for you to figure it out: Echo out $pass_category immediately before the if () statement. I'm betting you set it accidentally in the other code. if ($pass_category "") $sql2 = $sql2 . " and cat = '$pass_category' "; -- 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] form variables showing blank but query shows non-blank ??
what about the form itself? I see no problems in here (except of course that you disclosed your mySQL host, login and password) Cheers, Maxim Maletsky -Original Message- From: Andre Bajew [mailto:[EMAIL PROTECTED]] Sent: Friday, February 16, 2001 2:57 PM To: [EMAIL PROTECTED] Subject: [PHP] form variables showing blank but query shows non-blank ?? Hi, I have a form that has 4 variables, one, $pass_category, being a select list. The form posts a php script. Once inside the PHP script if I have not selected one of the select list variables the value should be blank. If I echo this out the value shows as blank. However, I later check the value of the passed select list variable and it passes a "if "" test which has me baffled. I don't have this problem with my three other variables that are just form fields versus a select list. Am I missing something basic or ?? What I'm doing here is building a SQL statement based on form variables. A snippet of the script is below. I'd sincerely appreciate any help or guidance!! Andre ?php mysql_close; $pass_category = $HTTP_POST_VARS["form_cat"]; $pass_company = $HTTP_POST_VARS["form_company"]; $pass_contact = $HTTP_POST_VARS["form_contact"]; $pass_sort = $HTTP_POST_VARS["form_sort"]; if ($debug =="y") { echo "Pass_category=$pass_categorybr"; /* This shows as blank */ echo "Pass_company=$pass_companybr"; echo "Pass_contact=$pass_contactbr"; echo "Pass_sort=$pass_sortbr"; } $db = mysql_pconnect("mysql1:katychamber.com", "katyc2", "katyc2"); ... ... if ($pass_category "") $sql2 = $sql2 . " and cat = '$pass_category' "; /* this statement passes this test even though it appears to be blank */ ... -- 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]