tomks77 Posted May 27, 2013 Share Posted May 27, 2013 some body in an other post helped me with this problem, sending variables to an other page.using $_SESSION.. it worked>>, but only when i search for one record only, becouse the SESSION takes the id number that i will use in an other page when user click on "Edit".. now when i show all the records in a table, there will be one more column that have the word 'Edit'so when you find the record in the table just click on "edit" to take you to the edit page, so i did like this in the first page: print ("<td><a href=\"edit2.php?id='$db_field[id]'\">Edit</a></td></tr>" ); when you click on "Edit", you jump to the page Edit2.php, taking the variable 'id'. the problem is this: in the page edit2.php, the variable id is shown in the address bar, but an error keep happenning..UnDefined Variable id in line... i found its strange: why the program can not see the variable id, although it appears in the address bar!! Link to comment Share on other sites More sharing options...
jeffman Posted May 27, 2013 Share Posted May 27, 2013 View the page source of edit2.php. Look at the href of that link. Does the value of id look correctly formatted? I suspect it does not. For one thing, there should not be 'single' quotation marks arount the value. Link to comment Share on other sites More sharing options...
tomks77 Posted May 28, 2013 Author Share Posted May 28, 2013 if i put it like this:print ("<td><a href=\"edit2.php?id='$db_field[id]'\">Edit</a></td></tr>" ); // ' $db_field[id] ' Or like this:print ("<td><a href=\"edit2.php?id=$db_field[id]\">Edit</a></td></tr>" ); / / id=$db_field[id] i still have the same error, in the address bar its like this: ocalhost/edit2.php?id=4so as you see, its right there.. id=4, but in the top of the page i have the error undefind variable. Link to comment Share on other sites More sharing options...
justsomeguy Posted May 28, 2013 Share Posted May 28, 2013 That's not going to be in the $_SESSION array, variables passed through the URL are in the $_GET array. Link to comment Share on other sites More sharing options...
MarkT Posted May 29, 2013 Share Posted May 29, 2013 <?PHP include "/variables.php" ?> then in variables write<?PHP $var1 = {VARIABLE DETAIL};$var2 = {VARIABLE DETAIL};$var3 = {VARIABLE DETAIL}; ?> Thats all i can think of. Link to comment Share on other sites More sharing options...
tomks77 Posted May 29, 2013 Author Share Posted May 29, 2013 ill try that Link to comment Share on other sites More sharing options...
MarkT Posted May 31, 2013 Share Posted May 31, 2013 ill try thatPost evaluation Question; Did it work? If not, please give details etc. Link to comment Share on other sites More sharing options...
Recommended Posts
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