[PHP] Re: problem with form values
show us a snippet so we can evaluate the cause -A -- 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: problem with form values
This is what my form returns with search 'great port': http://domain/file.php4?Parent=1Keyword=\ and this with search 'great port' (no quotas): http://domain/file.php4?Parent=1Keyword=great portName=Province=---Submit=SearchType=text I need to get quotas to the keyword-field, so I can create better search engine. How to do that? Niklas -Original Message- From: Adam [mailto:[EMAIL PROTECTED]] Sent: 12. syyskuuta 2001 11:24 To: [EMAIL PROTECTED] Subject: [PHP] Re: problem with form values show us a snippet so we can evaluate the cause -A -- 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: problem with form values
How to do anything to the strings in php BEFORE the form is sent? Niklas -Original Message- From: James Holloway [mailto:[EMAIL PROTECTED]] Sent: 12. syyskuuta 2001 11:28 To: Niklas lampén Subject: Re: problem with form values Hi Niklas, use htmlentities() or htmlspecialchars() on the string before the form is sent. See the manual for more info. James - Original Message - From: Niklas lampén Newsgroups: php.general To: Php-General Sent: Wednesday, September 12, 2001 8:32 AM Subject: problem with form values If a user enters a quota ( ) to a form field and sends it, the page trying to process values gets only a backslash ( \ ). No matter if I use GET or POST. How to get the right kind of a value? Niklas -- 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: problem with form values
Sorry, I didn't mean it quite like that. After the user presses submit $string = htmlentities($string); // now, do whatever with the string J - Original Message - From: Niklas Lampén To: James Holloway ; Php-General Sent: Wednesday, September 12, 2001 9:52 AM Subject: RE: problem with form values How to do anything to the strings in php BEFORE the form is sent? Niklas -Original Message- From: James Holloway [mailto:[EMAIL PROTECTED]] Sent: 12. syyskuuta 2001 11:28 To: Niklas lampén Subject: Re: problem with form values Hi Niklas, use htmlentities() or htmlspecialchars() on the string before the form is sent. See the manual for more info. James - Original Message - From: Niklas lampén Newsgroups: php.general To: Php-General Sent: Wednesday, September 12, 2001 8:32 AM Subject: problem with form values If a user enters a quota ( ) to a form field and sends it, the page trying to process values gets only a backslash ( \ ). No matter if I use GET or POST. How to get the right kind of a value? Niklas
Re: [PHP] Re: problem with form values
i would say do this urlencode the string (it should use %22 or something for the quote marks) then un encode on the recieving page -- one thing you might try is this $sql = 'SELECT * FROM whatever WHERE'; while ( $quotes = explode('', $Keywords) ) { $q = 0; $s = 0; if ($q *= 2) { }else { if ($q == 0) { $or = ' '; } else { $or=' or' } $sql = $sql . $or . ' Keywords=/'' . $quotes[$q] . '/ ' ; $q++; } }else{ if ($s == 0) { $or = ''; } else { $or=' or'; $s = 0; while ( $spaces = explode(' ', $quotes[$q] ) { $sql = $sql . ' Keyword=/''. $spaces[$s] . '/'; $s++ } } this is most defnitly wrong in many ways, but i'm not gonna spend another hour thinking up what's wrong with it and bug hunt. this gives an idea. heh, you were probably just woundering about urlencode or stripslashes... oh well just a thought. maybe a pro could step in and say something useful. -A -- 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: problem with form values
Heh, we seem to have a bit of a problem with communicating with each other.. :) What I ment with the question is that how can I do something to the string before the form sends information to the next page? So can I somehow modify strings after pressing submit but before next page? Something like onSubmit=blah(). Niklas -Original Message- From: James Holloway [mailto:[EMAIL PROTECTED]] Sent: 12. syyskuuta 2001 12:01 To: Niklas Lampén Cc: [EMAIL PROTECTED] Subject: [PHP] Re: problem with form values Sorry, I didn't mean it quite like that. After the user presses submit $string = htmlentities($string); // now, do whatever with the string J - Original Message - From: Niklas Lampén To: James Holloway ; Php-General Sent: Wednesday, September 12, 2001 9:52 AM Subject: RE: problem with form values How to do anything to the strings in php BEFORE the form is sent? Niklas -Original Message- From: James Holloway [mailto:[EMAIL PROTECTED]] Sent: 12. syyskuuta 2001 11:28 To: Niklas lampén Subject: Re: problem with form values Hi Niklas, use htmlentities() or htmlspecialchars() on the string before the form is sent. See the manual for more info. James - Original Message - From: Niklas lampén Newsgroups: php.general To: Php-General Sent: Wednesday, September 12, 2001 8:32 AM Subject: problem with form values If a user enters a quota ( ) to a form field and sends it, the page trying to process values gets only a backslash ( \ ). No matter if I use GET or POST. How to get the right kind of a value? Niklas -- 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: problem with form values
PHP Is server side. The form data, until it is submitted is client side. If you need to manipulate the form data before processing it (i.e for validation, etc) you can either build that logic into your processing code, or have the form call an intermediate set of code that does what you need to do, and then passes control to the form processing code. If you really need to work with the data before it is sent back to the server, you need to look at a javascript solution. -Jason - Original Message - From: Niklas Lampén [EMAIL PROTECTED] To: James Holloway [EMAIL PROTECTED]; Php-General [EMAIL PROTECTED] Sent: Wednesday, September 12, 2001 3:08 AM Subject: RE: [PHP] Re: problem with form values Heh, we seem to have a bit of a problem with communicating with each other.. :) What I ment with the question is that how can I do something to the string before the form sends information to the next page? So can I somehow modify strings after pressing submit but before next page? Something like onSubmit=blah(). Niklas -Original Message- From: James Holloway [mailto:[EMAIL PROTECTED]] Sent: 12. syyskuuta 2001 12:01 To: Niklas Lampén Cc: [EMAIL PROTECTED] Subject: [PHP] Re: problem with form values Sorry, I didn't mean it quite like that. After the user presses submit $string = htmlentities($string); // now, do whatever with the string J - Original Message - From: Niklas Lampén To: James Holloway ; Php-General Sent: Wednesday, September 12, 2001 9:52 AM Subject: RE: problem with form values How to do anything to the strings in php BEFORE the form is sent? Niklas -Original Message- From: James Holloway [mailto:[EMAIL PROTECTED]] Sent: 12. syyskuuta 2001 11:28 To: Niklas lampén Subject: Re: problem with form values Hi Niklas, use htmlentities() or htmlspecialchars() on the string before the form is sent. See the manual for more info. James - Original Message - From: Niklas lampén Newsgroups: php.general To: Php-General Sent: Wednesday, September 12, 2001 8:32 AM Subject: problem with form values If a user enters a quota ( ) to a form field and sends it, the page trying to process values gets only a backslash ( \ ). No matter if I use GET or POST. How to get the right kind of a value? Niklas -- 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]