File size: 1.89Kb
<?php
/************************************
Script : Adnetwork
Website : http://facebook.com/mohd.arshadsaifi79
Script is created and provided by Arshad (http://facebook.com/mohd.arshadsaifi79)
**************************************/
include 'db.php';
include 'functions.php';
headtag("$SiteName - Edit My Account");
if($userlog==1){
$pincode=dump_udata("pincode");
$mobile=dump_udata("mobile");
echo '<div class="title">Edit Account</div>';
$uid=dump_udata("id");
if(isset($_POST['firstname']) AND isset($_POST['state']) AND isset($_POST['city']) AND isset($_POST['pincode'])){
$firstname=formpost("firstname");
$state=formpost("state");
$city=formpost("city");
$pincode1=formpost("pincode");
if(!is_numeric($pincode1)){
$errors[]='Pincode Must Be A Numeric Value!';
}
if(strlen($firstname)<1){
$errors[]='Full Name Field Cannot Left Empty!';
}
if(strlen($city)<1){
$errors[]='City Field Left Cannot Empty!';
}
if($pincode!=$pincode1){
$errors[]='Wrong Pin!';
}
if(empty($errors)){
$edac=mysql_query("UPDATE userdata SET firstname='$firstname',state='$state',city='$city' WHERE id='$uid'");
if($edac){
echo '<div class="success">Account Successfully Edited! <a href="/myaccount">Continue</a></div>';
}
else {
echo 'unk';
}
}
else {
dump_error($errors);
}
}
echo '<div class="form"><form method="post">
Full Name:<br/><input type="text" name="firstname" value="'.dump_udata("firstname").'"/><br/>
State/Religion:<br/><input type="text" name="state" value="'.dump_udata("state").'"/><br/>
City:<br/><input type="text" name="city" value="'.dump_udata("city").'"/><br/>';
echo'Enter Pin:<br/><input type="text" name="pincode" maxlength="5" /><br/><input type="submit" value="Edit"/></form></div>';
echo '<div class="page"><a href="/user/dashboard">Go Back To Dashboard</a></div>';
include 'foot.php';
}
else {
header('Location:/');
}
?>