| | |
Capturing username and displaying on another page
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Ok, you need to look at a few tutorials (there's millions on the net) about user logins and sessions. In a nutshell:
Now please do some research so you understand that code and how your using it.
[code untested]
form.html This contains the textbox. html Syntax (Toggle Plain Text)
<form action="submit.php" method="GET"> <!--or "POST"--> <input type="text" name="username" /> </form>
submit.php Set the session variable php Syntax (Toggle Plain Text)
<?php session_start(); //so you can use the session variable &username = $_GET['username']; //or $_POST depending on form method echo "Hello $username. I have learnt your name!"; SESSION['username']=$username; ?> <a href="/page.php">Return</a>
page.php //Content page php Syntax (Toggle Plain Text)
<?php start_session(); if isset($_SESSION['username']){ echo "Hey $_SESSION['username'], I remembered your name!"; } ?> ...rest of page content
Now please do some research so you understand that code and how your using it.
[code untested]
★ "If your not having fun, your doing something wrong." - Humbug
★ Did I help you out? Did I piss you off? Add to my reputation!
★ The Gabriel Method is a great book for losing weight and keeping healthy - I know Jon Gabriel Personally.
★ Did I help you out? Did I piss you off? Add to my reputation!
★ The Gabriel Method is a great book for losing weight and keeping healthy - I know Jon Gabriel Personally.
![]() |
Other Threads in the PHP Forum
- Previous Thread: Video to FLV
- Next Thread: problem uploading photo in webserver
| Thread Tools | Search this Thread |
apache api array basic beginner binary broken cache cakephp checkbox class cms code computing confirm cron curl customizableitems database date delete display dynamic echo email error external file files filter folder form forms forum function functions gc_maxlifetime google headmethod host howtowriteathesis href htaccess html iframe image include insert ip javascript joomla limit link login mail malfunction memmory memory menu mlm multiple mysql navigation oop parsing paypal pdf php phpmysql problem query question radio random recursion remote script search select server sessions sms snippet source space sql syntax system table thesishelp trouble tutorial update upload url validator variable video web youtube





