PHP
-
Hi...!! I am beginner of PHP. I want to make registration page which displays user name after the successful registration. I have made three files : register.html ==> to make form and enter the data which redirects to another file called submit.php submit.php ==> to enter the values to the database and redirects to the home.php home.php ==> This must display " Welcome registering user name !" message. how to retrieve the name in the last file ??
-
Hi...!! I am beginner of PHP. I want to make registration page which displays user name after the successful registration. I have made three files : register.html ==> to make form and enter the data which redirects to another file called submit.php submit.php ==> to enter the values to the database and redirects to the home.php home.php ==> This must display " Welcome registering user name !" message. how to retrieve the name in the last file ??
It depends on how you are submitting your form for the username and password. If you are using POST, then something like:
$username = $_POST['username'];
$password = $_POST['password'];Otherwise, if you use GET:
$username = $_GET['username'];
$password = $_GET['password'];The "username" and "password" names are whatever you named your username and password input boxes in the html form. Let me know if this helps
-
Hi...!! I am beginner of PHP. I want to make registration page which displays user name after the successful registration. I have made three files : register.html ==> to make form and enter the data which redirects to another file called submit.php submit.php ==> to enter the values to the database and redirects to the home.php home.php ==> This must display " Welcome registering user name !" message. how to retrieve the name in the last file ??
Hi, You can post the username with the redirecting url, and from that page you can access the name by Let the redirecting URL should be like this, URL: http://localhost/home.php?user='Sunu'
$user_name = $_REQUEST['user'];
Cheers
-
Hi...!! I am beginner of PHP. I want to make registration page which displays user name after the successful registration. I have made three files : register.html ==> to make form and enter the data which redirects to another file called submit.php submit.php ==> to enter the values to the database and redirects to the home.php home.php ==> This must display " Welcome registering user name !" message. how to retrieve the name in the last file ??
After the post you cn also asign user information to a session variable so you do not need to repost it from page to page. To do this just assign the post to a session variable like...
$_SESSION["uname"]=$_POST["uname"];
To set and use the session values you must start your pages with...
This brings up an important topic too. You must scrub your input from users so you can avoid sql injection (if you are storing your data in a database). Please be sure to read up on this topic in any live code you make.
Chris J
www.redash.org -
Hi...!! I am beginner of PHP. I want to make registration page which displays user name after the successful registration. I have made three files : register.html ==> to make form and enter the data which redirects to another file called submit.php submit.php ==> to enter the values to the database and redirects to the home.php home.php ==> This must display " Welcome registering user name !" message. how to retrieve the name in the last file ??
-
Hi...!! I am beginner of PHP. I want to make registration page which displays user name after the successful registration. I have made three files : register.html ==> to make form and enter the data which redirects to another file called submit.php submit.php ==> to enter the values to the database and redirects to the home.php home.php ==> This must display " Welcome registering user name !" message. how to retrieve the name in the last file ??
Apply Sessions or Cookies.