November 22, 200817 yr I need help on passing variables. How do i get a variable into a hidden field so that when user creates new record, the variable poupulates the field. I am passing it in the URL '/name=mike'. How do i place the into a new field on another table in my db? -dbCustomers;&name=mike passed to a new table & new field ...orders::name?? thanks
November 22, 200817 yr Those variables are stored in PHP's Predefined variables. http://www.php.net/manual/en/reserved.variables.php variables passed through the URL are specifically in the $_GET and $_REQUEST associative arrays. will set the value to Mike and add 'name' => 'Mike' to the $_REQUEST and $_GET or $_POST arrays of the page the form is submitted to. Be sure to read the FAQ about register_globals, which is turned off by default in current installations. http://www.php.net/manual/en/faq.using.php#faq.register-globals I'll also add that instead of passing variables around using hidden fields you could session them or session an object containing them and grab them when ever you want. http://www.php.net/manual/en/ref.session.php
Create an account or sign in to comment