maui Posted November 22, 2008 Posted November 22, 2008 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
Baloo Posted November 22, 2008 Posted November 22, 2008 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
Recommended Posts
This topic is 6105 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now