View Single Post
Old 02-12-2013, 01:45 PM   PM User | #3
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
They've complicated it by writing ajax and assuming that has something to do with PHP.
Input Id's are not provided to PHP as HTML doesn't consider them values upon success. Autocomplete.php will only have access to $_GET['user'] since the JS doesn't provide it with any other value. Result.php cannot read $_GET['user'] nor $_GET['tag'] as neither are provided. You will find a $_POST['tag'], but no corresponding user offset.
Choose either GET or POST method and stick with it for every step. If you use GET, than you can add the user to the form action as a querystring. If you choose post and don't want to mix get, than you can pass it to the form as a hidden input. IMO it'd be easier to do this and use the JS to iterate the field's within the form to build its post request.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote