| | |
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
Views: 605 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class clean cms code countingeverycharactersfromastring cron curl database date directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail match menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions simple sms soap source space spam speed sql structure syntax system table tutorial update updates upload url validation validator variable video web xml youtube





