$_SERVER['PHP_SELF'] doesn't work? - php

Everything works out just fine until I changed the below code from
<form method='post' action='re.php'>
to
<form method='post' action='<?php echo $_SERVER["PHP_SELF"];?>'>
It gives me HTTP error 500. I have done some googling but still have no idea why this is happening! Thanks so much for help!
Below is the whole script
<?php
$hostname = 'localhost';
$username = 'Ciara';
$password = 'mypass';
$database = 'users';
$conn = mysqli_connect($hostname,$username, $password, $database);
if (!$conn) {
die ("Databas connect failed: " . mysqli_connect_error());
} else {
echo "Connected successfully. <br>";
}
echo <<<_END
<html>
<head>
<title>Register</title>
</head>
<body><center>
<form method='post' action='<?php echo $_SERVER["PHP_SELF"];?>'>
Firstname: <input type='text' name='firstname'><br>
Lastname: <input type='text' name='lastname'><br>
E-mail: <input type='text' name='email'><br>
Gender: <input type='radio' value='female' name='gender'>Female
<input type='radio' value='male' name='gender'>Male<br>
Username: <input type='text' name='username'><br>
Password: <input type='text' name='password'><br>
<input type='submit' value='Submit Form'>
</form></center>
_END;
if (isset($_POST['firstname']) &&
isset($_POST['lastname']) &&
isset($_POST['email']) &&
isset($_POST['gender']) &&
isset($_POST['username']) &&
isset($_POST['password'])) {
$firstname = get($conn, 'firstname');
$lastname = get($conn, 'lastname');
$email = get($conn, 'email');
$gender = get($conn, 'gender');
$username = get($conn, 'username');
$password = get($conn, 'password');
$query = "insert into useracc values" . "(null, '$firstname','$lastname','$email','$gender','$username','$password')";
if (mysqli_query($conn, $query)) {
echo "You have successfully registered! <br>";
} else {
echo "Failed to register." . mysqli_error($conn);
}
}
mysqli_close($conn);
echo "</body></html>";
function get($conn, $var) {
return mysqli_real_escape_string($conn, $_POST[$var]);
}
?>

You can't add PHP inside your HTML when you're using echo
<?php
$hostname = 'localhost';
$username = 'Ciara';
$password = '0950767';
$database = 'users';
$conn = mysqli_connect($hostname,$username, $password, $database);
if (!$conn) {
die ("Databas connect failed: " . mysqli_connect_error());
} else {
echo "Connected successfully. <br>";
}
?>
<html>
<head>
<title>Register</title>
</head>
<body><center>
<form method='post' action='<?php echo $_SERVER["PHP_SELF"];?>'>
Firstname: <input type='text' name='firstname'><br>
Lastname: <input type='text' name='lastname'><br>
E-mail: <input type='text' name='email'><br>
Gender: <input type='radio' value='female' name='gender'>Female
<input type='radio' value='male' name='gender'>Male<br>
Username: <input type='text' name='username'><br>
Password: <input type='text' name='password'><br>
<input type='submit' value='Submit Form'>
</form></center>
<?php
if (isset($_POST['firstname']) &&
isset($_POST['lastname']) &&
isset($_POST['email']) &&
isset($_POST['gender']) &&
isset($_POST['username']) &&
isset($_POST['password'])) {
$firstname = get($conn, 'firstname');
$lastname = get($conn, 'lastname');
$email = get($conn, 'email');
$gender = get($conn, 'gender');
$username = get($conn, 'username');
$password = get($conn, 'password');
$query = "insert into useracc values" . "(null, '$firstname','$lastname','$email','$gender','$username','$password')";
if (mysqli_query($conn, $query)) {
echo "You have successfully registered! <br>";
} else {
echo "Failed to register." . mysqli_error($conn);
}
}
mysqli_close($conn);
echo "</body></html>";
function get($conn, $var) {
return mysqli_real_escape_string($conn, $_POST[$var]);
}
?>
Check this code :).

Related

Unable to send data from html form into mysql

I am unable to send the information from a from into mysql. I get the following error:
Fatal error: call to undefined function mysqli_connect()
I know the db connection is working because I am able to send other data into the database. I have added the connection information on the signupcontact.php but that did nothing.
I am not sure what the issue is since the database is connected.
Thanks for your help in advance.
form:
<?php
echo "<div class='wrapper'>";
require ('header.php');
include ('signupcontact.php');
include ('db_connect2.php');
?>
<head>
<title>Contac Information</title>
<meta charset="utf-8"/>
<link rel="stylesheet" href="style.css"/>
</style>
<script>
function validateForm() {
if (document.forms[0].userName.value == "") {
alert("Name field cannot be empty.");
return false;
} //end if
if (document.forms[0].userLastName.value == "") {
alert("Last Name field cannot be empty.");
return false;
} // end if
if (document.forms[0].userEmail.value == "") {
alert("Email field cannot be empty.");
return false;
} // end if
alert ("Successful!");
return true;
} //end function validateForm
</script>
</head>
<body>
<?php
echo '<form method="POST"
action="db_connect2.php"
onsubmit="return validateForm();">
<fieldset style="width:900px; margin:auto;">
<legend class="pcenter">Subscribe for updates</legend>
<label for="userName">Name: </label><br />
<input type="text" name="userName" id="userName"/><br /><br />
<label for="Last_Name">Last Name: </label><br />
<input type="text" name="userLastName" id="userLastName"/><br /><br />
<label for="userEmail">Email: </label><br />
<input type="text" name="userEmail" id="userEmail"/>
<br /><br />
<input type="submit" value="submit" id="submit"/><br />
</fieldset>
</form>
dbconnect:
<?php
$conn = mysqli_connect('localhost', 'root', '', 'happy_blog');
if(!$conn) {
die("connection failed: ".mysqli_connect_error());
}
signupcontact (I added the connection here again to see if it helps, nothing)
<?php
$dBServername = "localhost";
$dBUsername = "root";
$dBPassword = "";
$dBName = "happy_blog";
// Create connection
$conn = mysqli_connect($dBServername, $dBUsername, $dBPassword, $dBName);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
if (isset($_POST['submit'])){
$Name = $_POST['userName'];
$LName = $_POST['userLastName'];
$Email = $_POST['userEmail'];
$Name = mysqli_real_escape_string($conn,$_POST['userName']);
$LName = mysqli_real_escape_string($conn,$_POST['userLastName']);
$Email = mysqli_real_escape_string($conn,$_POST['userEmail']);
//$sql = "INSERT INTO contact (userName, userLastName, userEmail) VALUES ('".$_POST["userName"]."', '".$_POST["userLastName"]."', '".$_POST["userEmail"]."')";
$sql = "INSERT INTO contact (userName, userLastName, userEmail) VALUES ($Name, $LName, $Email)";
$result = mysqli_query($conn, $sql);
if ($conn->query($sql) === TRUE) {
echo "Form submitted successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
}

PHP Login system with PDO

I have 1 page (index.php) with 2 forms, login n signup.
All i want is when i click the login button, i stay at this page with the forms gone!
Just index.php with welcome message.
I have 2 files:
1. index.php contains 2 forms.
2. user.php (User class) with 2 functions, login n addNewUser.
This my index file
<?php
$user = new User();
if (isset($_POST['login'])) {
$username = $_POST['username'];
$password = $_POST['password'];
$user->login($username, $password);
}
if (isset($_POST['signup'])) {
$username = $_POST['username'];
$password = $_POST['password'];
$email = $_POST['email'];
$user->add($username, $password, $email);
}
?>
<form action='' method='post' accept-charset='utf-8'>
<input type='text' name='username' placeholder='Username' autofocus=''>
<input type='password' name='password' placeholder='Password'>
<input type='submit' name='login' value='Login' />
</form>
<form action='' method='post' accept-charset='utf-8'>
<input type='text' name='username' placeholder='Username'></br>
<input type='email' name='email' placeholder='Email'></br>
<input type='password' name='password' placeholder='Password'></br></br>
<input type='submit' name='signup' value='Sign Up' />
</form>
And this is my login function in User.php
public function login($username, $password){
session_start();
if (!empty($username) && !empty($password)) {
$stmt = $this->db->prepare("SELECT * FROM user WHERE username=? and password=?");
$stmt->bindParam(1, $username);
$stmt->bindParam(2, $password);
$stmt->execute();
if ($stmt->rowCount() == 1) {
$_SESSION['login'] = true;
$_SESSION['username'] = $username;
} else {
echo "Wrong username or password";
}
} else {
echo "Please enter username and password";
}
}
Pls help me get this done!
So why not put something like
<?php if (!$_SESSION['login']) { ?>
... show forms ..
<?php } ?>
so the forms show ONLY when no login has been performed?
All of this in index.php:
<?php
function login($username, $password){
session_start();
if (!empty($username) && !empty($password)) {
$stmt = $this->db->prepare("SELECT * FROM user WHERE username=? and password=?");
$stmt->bindParam(1, $username);
$stmt->bindParam(2, $password);
$stmt->execute();
if ($stmt->rowCount() == 1) {
$_SESSION['login'] = true;
$_SESSION['username'] = $username;
} else {
echo "Wrong username or password";
}
} else {
echo "Please enter username and password";
}
}
$user = new User();
if (isset($_POST['login'])) {
$username = $_POST['username'];
$password = $_POST['password'];
$user->login($username, $password);
}
elseif (isset($_POST['signup'])) {
$username = $_POST['username'];
$password = $_POST['password'];
$email = $_POST['email'];
$user->add($username, $password, $email);
}
else
{
?>
<form action='index.php' method='post' accept-charset='utf-8'>
<input type='text' name='username' placeholder='Username' autofocus=''>
<input type='password' name='password' placeholder='Password'>
<input type='submit' name='login' value='Login' />
</form>
<form action='index.php' method='post' accept-charset='utf-8'>
<input type='text' name='username' placeholder='Username'></br>
<input type='email' name='email' placeholder='Email'></br>
<input type='password' name='password' placeholder='Password'></br></br>
<input type='submit' name='signup' value='Sign Up' />
</form>
<?php
}
?>

PHP / Mysqli Insert Statement isn't writing to database

My problem is my PHP insert code is not writing to the database -- I feel it will be a small error with the HTML form below but I cannot place it.
HTML form (sorry for indenting)
<form method='post' action='form.php'>
<div class='form-group'>
<input type='email' class='form-control' id='email' placeholder='Email : xyz#domain.com'>
</div>
<div class='form-group'>
<input type='text' class='form-control' id='name' placeholder='Name : Joe Bloggs'>
</div>
<div class='form-group'>
<input type='textarea' class='form-control' id='message' placeholder='Message : Hey, can you do this job?'>
</div>
<button type='submit' class='btn btn-default'>Submit</button>
</form>
Below is my "form.php" code I am using to send data to the database.
<?php
//PHP Opened
// Insert Data
$username = "username";
$password = "password";
$dbname = "dbname" ;
// Create connection
$con=mysqli_connect("localhost",$username,$password,$dbname);
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
// From Form
$email = isset($_POST['email']) ? $_POST['email'] : '';
$name = isset($_POST['name']) ? $_POST['name'] : '';
$message = isset($_POST['message']) ? $_POST['message'] : '';
echo '<p>'.$email.'</p>';
$sql="INSERT INTO comment (id, email, name, message)VALUES(null,.$email.,.$name.,.$message.)";
$result = (mysqli_query($con,$sql));
if (false === $result){
echo 'failed';
}
else{
echo 'Record added';
}
mysqli_close($con)
//Close PHP
?>
It is because you did not define an name attribute for those tags.
New HTML code:
<form method='post' action='form.php'>
<div class='form-group'>
<input type='email' name='email' class='form-control' id='email' placeholder='Email : xyz#domain.com'>
</div>
<div class='form-group'>
<input type='text' name='name' class='form-control' id='name' placeholder='Name : Joe Bloggs'>
</div>
<div class='form-group'>
<input type='textarea' name='message' class='form-control' id='message' placeholder='Message : Hey, can you do this job?'>
</div>
<button type='submit' name='post' class='btn btn-default'>Submit</button>
</form>
Also, you need a bit of fixing in PHP:
<?php
//PHP Opened
// Insert Data
$username = "username";
$password = "password";
$dbname = "dbname" ;
// Create connection
$con=mysqli_connect("localhost",$username,$password,$dbname);
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
// From Form
if(isset($_POST['post'])) {
$email = isset($_POST['email']) ? $_POST['email'] : '';
$name = isset($_POST['name']) ? $_POST['name'] : '';
$message = isset($_POST['message']) ? $_POST['message'] : '';
echo '<p>'.$email.'</p>';
$sql = "INSERT INTO comment (id, email, name, message) VALUES(null, " . $email . " , " . $name . ", " . $message . ")";
$result = (mysqli_query($con,$sql));
if (false === $result){
echo 'failed';
}
else{
echo 'Record added';
}
}
mysqli_close($con)
//Close PHP
?>

how to save the $_post in the table

im just askin how to create a form that will save the input in the $_post thingy into the table much appreciated thanks!! or can you help me fix this code or create a new one to work please? i need your help please thanks again!
<?php
$servername = "localhost";
$username = "root";
$password = "root";
$dbname = "tsukishiro";
$id = $_POST['id'];
$name = $_POST['name'];
$comment = $_POST['comment'];
$input = $_POST['input'];
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO connection(ID, name, comment, input) VALUES ('null', '$name', '$comment', 'input')";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (empty($_POST["name"])) {
$nameErr = "Name is required";
} else {
$name = test_input($_POST["name"]);
// check if name only contains letters and whitespace
if (!preg_match("/^[a-zA-Z ]*$/",$name)) {
$nameErr = "Only letters and white space allowed";
}
}
if (empty($_POST["comment"])) {
$comment = "";
} else {
$comment = test_input($_POST["comment"]);
}
if (empty($_POST["input"])) {
$input = "";
} else {
$input = test_input($_POST["input"]);
}
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
echo "<input type='text' name='id'>";<br><br>
echo "<input type='text' name='name'>";
echo "<input type='text' name='comment'>";
echo "<input type='text' name='input'>";
echo "<input type='submit' name='submit'>";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>`
You miss $ sign for input variable
$sql = "INSERT INTO connection(ID, name, comment, input) VALUES ('null', '$name', '$comment', '$input')";
Add the <form> tag.
<form name="form_name" action="your_page.php" method="post">
<input type='text' name='id'>
<input type='text' name='name'>
<input type='text' name='comment'>
<input type='text' name='input'>
<input type='submit' name='submit'>
</form>
Updated:
<?php
$servername = "localhost";
$username = "root";
$password = "root";
$dbname = "tsukishiro";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$id = $_POST['id'];
$name = $_POST['name'];
$comment = $_POST['comment'];
$input = $_POST['input'];
if (empty($_POST["name"])) {
$nameErr = "Name is required";
} else {
$name = test_input($_POST["name"]);
// check if name only contains letters and whitespace
if (!preg_match("/^[a-zA-Z ]*$/",$name)) {
$nameErr = "Only letters and white space allowed";
}
}
if (empty($_POST["comment"])) {
$comment = "";
} else {
$comment = test_input($_POST["comment"]);
}
if (empty($_POST["input"])) {
$input = "";
} else {
$input = test_input($_POST["input"]);
}
$sql = "INSERT INTO connection(ID, name, comment, input) VALUES ('null', '$name', '$comment', 'input')";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
}
$conn->close();
?>
<form name="form_name" action="" method="post">
<input type='text' name='id'>
<input type='text' name='name'>
<input type='text' name='comment'>
<input type='text' name='input'>
<input type='submit' name='submit'>
</form>

How do I get updated data to reflect when I input data to an html file that makes a php update query?

I have an html file that calls a DB table to pull up a record, and a php file that updates changes to the DB table, and directs the user back to the html file (to reload the updated record).
The html file loads the user data, takes the input, posts it to the php file, and php file writes it to DB table, and reloads the html file. However, upon reload, it shows the old record info and not the newly updated info. I look in DB table, and the update ran correctly and I see the new info. But it does not reflect on the page. How do I fix this?
Is there a better way to do this? Thanks.
HTML file:
<?php
session_start();
$_SESSION['email'] = $email;
if(isset($_SESSION['email'])) {
echo $_SESSION['email'], " is logged in."; // echoes 1
}
else {
echo "User not logged in";
}
?>
<?php
$query = "SELECT email, username, address1, city, state, postalcode, country
FROM users
WHERE email = '$_SESSION[email]';";
$result = mysql_query($query);
if ($result) {
$_SESSION['userdata'] = mysql_fetch_array($result, MYSQL_ASSOC);
}
mysql_close();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<body>
<form name="userprofile" action="update.php" method="post">
<fieldset>
<legend>Update User Profile</legend>
<br class="clear" />
<label for="username">Username</label>
<input type='text' name='username' value='<?php echo $_SESSION['userdata']['username']; ?>'/>
<br class="clear" />
<label for="address1">Address</label>
<input type='text' name='address1' value='<?php echo $_SESSION['userdata']['address1']; ?>'/><br>
<br class="clear" />
<label for="city">City</label>
<input type='text' name='city' value='<?php echo $_SESSION['userdata']['city']; ?>'/><br>
<br class="clear" />
<label for="state">State</label>
<input type='text' name='state' value='<?php echo $_SESSION['userdata']['state']; ?>'/><br>
<br class="clear" />
<label for="postalcode">Postal code</label>
<input type='text' name='postalcode' value='<?php echo $_SESSION['userdata']['postalcode']; ?>'/><br>
<br class="clear" />
<label for="country">Country</label>
<input type='text' name='country' value='<?php echo $_SESSION['userdata']['country']; ?>'/><br>
<br class="clear" />
<br class="clear" />
</fieldset>
<input type="submit" value="Update" />
</form>
</body>
</html>
<br class="clear" />
</form>
</html>
PHP file:
<?php
session_start();
$_SESSION['email'] = $email;
if(isset($_SESSION['email'])) {
echo $_SESSION['email'], " is logged in."; // echoes 1
}
else {
echo "User not logged in";
}
$username = $_POST['username'];
$address1 = $_POST['address1'];
$city = $_POST['city'];
$state = $_POST['state'];
$postalcode = $_POST['postalcode'];
$country = $_POST['country'];
$dbhost = 'localhost';
$dbname = 'dbtable';
$dbuser = 'dbuser';
$dbpass = 'password'; //not really
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname, $conn);
$query = "UPDATE users
SET username ='$username',
address1 = '$address1',
city = '$city',
state = '$state',
postalcode = '$postalcode',
country = '$country'
WHERE email = '$_SESSION[email]';";
if(! $conn )
{
die('Could not connect: ' . mysql_error());
}
//echo $query;
mysql_query($query);
$retval = mysql_query($query);
if(! $retval )
{
die('Could not update data: ' . mysql_error());
}
echo "Updated data successfully\n";
mysql_close();
header('Location: update.html');
?>
you need to re assign updated data into your session once the data gets updated into the database table. you may need to modify your code like this
<?php
session_start();
$_SESSION['email'] = $email;
if(isset($_SESSION['email'])) {
echo $_SESSION['email'], " is logged in."; // echoes 1
}
else {
echo "User not logged in";
}
$username = $_POST['username'];
$address1 = $_POST['address1'];
$city = $_POST['city'];
$state = $_POST['state'];
$postalcode = $_POST['postalcode'];
$country = $_POST['country'];
$dbhost = 'localhost';
$dbname = 'dbtable';
$dbuser = 'dbuser';
$dbpass = 'password'; //not really
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname, $conn);
$query = "UPDATE users
SET username ='$username',
address1 = '$address1',
city = '$city',
state = '$state',
postalcode = '$postalcode',
country = '$country'
WHERE email = '$_SESSION[email]';";
if(! $conn )
{
die('Could not connect: ' . mysql_error());
}
//echo $query;
$retval = mysql_query($query);
if($retval){
$_SESSION['userdata']['username']=$username;
$_SESSION['userdata']['address1']=$address1;
$_SESSION['userdata']['city']=$city;
$_SESSION['userdata']['state']=$state;
$_SESSION['userdata']['postalcode']=$postalcode;
$_SESSION['userdata']['country']=$country;
echo "Updated data successfully\n";
mysql_close();
header('Location: update.html');
}else{
die('Could not update data: ' . mysql_error());
}
?>
You can do it in index.html page. no need of index.php
<?php
session_start();
$dbhost = 'localhost';
$dbname = 'test';
$dbuser = 'root';
$dbpass = ''; //not really
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname, $conn);
$email='ripon';
$_SESSION['email'] = $email;
if(isset($_SESSION['email'])) {
echo $_SESSION['email'], " is logged in."; // echoes 1
}
else {
echo "User not logged in";
}
?>
<?php
if(isset($_POST['submit']))
{
$username = $_POST['username'];
$address1 = $_POST['address1'];
$city = $_POST['city'];
$state = $_POST['state'];
$postalcode = $_POST['postalcode'];
$country = $_POST['country'];
echo $address1;
$dbhost = 'localhost';
$dbname = 'test';
$dbuser = 'root';
$dbpass = ''; //not really
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname, $conn);
$query = "UPDATE user SET password = '$address1' WHERE username = '$_SESSION[email]';";
if(! $conn )
{
die('Could not connect: ' . mysql_error());
}
//echo $query;
mysql_query($query) or die(mysql_error());
$retval = mysql_query($query);
if(! $retval )
{
die('Could not update data: ' . mysql_error());
}
echo "Updated data successfully\n";
//mysql_close();
}
?>
<?php
$query = "SELECT username, password, fullname FROM user WHERE username = '$_SESSION[email]';";
$result = mysql_query($query);
if ($result) {
$_SESSION['userdata'] = mysql_fetch_array($result, MYSQL_ASSOC);
}
else
{
echo "error";
echo $query;
}
//mysql_close();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<body>
<?php var_dump($_SESSION['userdata']);?>
<form name="userprofile" action="update.html" method="post">
<fieldset>
<legend>Update User Profile</legend>
<br class="clear" />
<label for="username">Username</label>
<input type='text' name='username' value='<?php echo $_SESSION['userdata']['username']; ?>'/>
<br class="clear" />
<label for="address1">Address</label>
<input type='text' name='address1' value='<?php echo $_SESSION['userdata']['password']; ?>'/><br>
<br class="clear" />
<label for="city">City</label>
<input type='text' name='city' value='<?php echo $_SESSION['userdata']['city']; ?>'/><br>
<br class="clear" />
<label for="state">State</label>
<input type='text' name='state' value='<?php echo $_SESSION['userdata']['state']; ?>'/><br>
<br class="clear" />
<label for="postalcode">Postal code</label>
<input type='text' name='postalcode' value='<?php echo $_SESSION['userdata']['postalcode']; ?>'/><br>
<br class="clear" />
<label for="country">Country</label>
<input type='text' name='country' value='<?php echo $_SESSION['userdata']['country']; ?>'/><br>
<br class="clear" />
<br class="clear" />
</fieldset>
<input type="submit" value="Update" name="submit"/>
</form>
</body>
</html>
<br class="clear" />
</form>
</html>

Categories