Home Tutorial Php Examples Session Register


Share on Google+Share on Google+
Session Register
Posted on: July 31, 2009 at 12:00 AM
In this example you will learn how to create session register in PHP.

Session Register

For session register, you will have to first create an action form in HTML that calls the php session_register code.  

In PHP form, we have created email field, and added submit button while for calling php code, we have used server[PHP_SELF] call. 

session_start ();
session_register ("email");
echo "Your Email ID is ".$email;

Creating HTML form action

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<head><title>Session Register</title></head>
<form name="session" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" >
<table width="80%" border="0" cellspacing="0" cellpadding="0" style="color:#333333;"> 

<td width="20%" height="27" style="padding-left:10px;">Email</td> 
<td width="32%">: <input type="text" name="email" class="inputbox" /></td> 
<td width="48%" align="left"></td>
<tr><td><input name="submit" type="submit" value="Submit" onClick="return validate(this);"/></td></tr> 

In the output, you will get your email id.


Related Tags for Session Register:

Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: July 31, 2009

Recommend the tutorial

Advertisements Advertisements