i have an if else situation wherein if a user registers with a name that is already available in the database i redirect them to duplicateuser.p hp or else redirect to thankyou.php
presently i am able to pass value of a variable $username as part of the url and i am able to read using GET by doing so the value appears in the browser address bar and i would like to use hidden and also be able to read this value
following is the code i am presently using
if($usernamerow s > 0)
{
header("Locatio n: duplicateuser.p hp?duplicateuse r=".$username );
}
else
{
header("Locatio n: thankyou.php?fn ame=".$fname);
}
how can i use hidden so that the url does not get appended in the address bar and still the read the value of the variables i want to pass and how should i read the variables in the other pages, is it $_POST[]
i tried using this code just before the header() statement but it does not work and i get an error.
echo "<input type ='hidden' name='duplicate user' value='$usernam e'>";
echo "<input type ='hidden' name='fname' value='$fname'> ";
please advice.
thanks.
presently i am able to pass value of a variable $username as part of the url and i am able to read using GET by doing so the value appears in the browser address bar and i would like to use hidden and also be able to read this value
following is the code i am presently using
if($usernamerow s > 0)
{
header("Locatio n: duplicateuser.p hp?duplicateuse r=".$username );
}
else
{
header("Locatio n: thankyou.php?fn ame=".$fname);
}
how can i use hidden so that the url does not get appended in the address bar and still the read the value of the variables i want to pass and how should i read the variables in the other pages, is it $_POST[]
i tried using this code just before the header() statement but it does not work and i get an error.
echo "<input type ='hidden' name='duplicate user' value='$usernam e'>";
echo "<input type ='hidden' name='fname' value='$fname'> ";
please advice.
thanks.
Comment