Pull value from address and cookie
Posted: Wed Nov 16, 2005 11:28 pm
So i want to put data into a database that is 1/2 from a cookie and 1/2 from the address.
What i want is to have the database table (which has 2 fields, uname and friend_uname) to be filled in first with the uname from the cookie: And the friend_uname to be filled in from the address that will look like:
user.php?user=usernamehere
I cant figure out how to get the value from the address to be put into a database.
It would be ideal to have a submit button with 2 hidden fields, one being uname and the other being friend_uname so when the submit button is pressed it puts the data in to a database but once again, i cant seem to figure it out. Any ideas would be great.
Note, i have the first mysql query as:
Thanks for the help.
What i want is to have the database table (which has 2 fields, uname and friend_uname) to be filled in first with the uname from the cookie:
Code: Select all
if($_SESSION['Uname'] == '' || $_SESSION['lp'] == '')user.php?user=usernamehere
I cant figure out how to get the value from the address to be put into a database.
It would be ideal to have a submit button with 2 hidden fields, one being uname and the other being friend_uname so when the submit button is pressed it puts the data in to a database but once again, i cant seem to figure it out. Any ideas would be great.
Note, i have the first mysql query as:
Code: Select all
$result = mysql_query("SELECT * FROM loginphp
WHERE Uname='{$_SESSION['Uname']}'") or die(mysql_error());
$row = mysql_fetch_array( $result );