0byt3m1n1
Path:
/
data
/
17
/
1
/
18
/
11
/
1670011
/
user
/
1801231
/
htdocs
/
includes
/
[
Home
]
File: pagerequest.php
<? session_start(); require('includes/config.php'); $page=$_GET['page']; $_SESSION['create_account_error']=""; if($_POST['Submit']=="Register Now") { $name=trim($_POST['name']); $pass=trim($_POST['password']); $email=trim($_POST['email']); $contact=trim($_POST['contact']); $country=trim($_POST['country']); if($country=="United States of America") { $state=trim($_POST['us_state']); } else { $state=trim($_POST['state']); } $postcode=trim($_POST['postcode']); if($name=="") { $_SESSION['create_account_error']=$_SESSION['create_account_error']."Please insert your name.<br>"; } if(strlen($pass)<6) { $_SESSION['create_account_error']=$_SESSION['create_account_error']."Password must be atleast 6 characters.<br>"; } if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $email)) { $_SESSION['create_account_error']=$_SESSION['create_account_error']."Email Address is not in proper format<br>"; } if($contact=="") { $_SESSION['create_account_error']=$_SESSION['create_account_error']."Please insert contact number.<br>"; } if($state=="Select a State" || $state=="") { $_SESSION['create_account_error']=$_SESSION['create_account_error']."Please select / enter state from the list.<br>"; } if($_SESSION['create_account_error']=="") { $q_account_insert="insert into subscriber (`subscriber_id`, `subscriber_name`, `password`, `subscriber_email`, `subscriber_contact_no`, `subscriber_country`, `subscriber_zone`, `subscriber_postcode`) values(NULL, '".$name."', '".$pass."', '".$email."', '".$contact."', '".$country."', '".$state."', '".$postcode."')"; $r_account_insert=mysql_query($q_account_insert); if(!$r_account_insert) { echo mysql_error(); } else { $_SESSION['login']="true"; $page="myaccount"; } } else { $page="login"; } } if($_POST['Submit']=="Login") { $q_login="select * from subscriber where subscriber_email='".trim($_POST['login_email'])."' and password='".trim($_POST['login_password'])."'"; $r_login=mysql_query($q_login); if(mysql_num_rows($r_login)>0) { $page="myaccount"; $_SESSION['login']="true"; $row_login=mysql_fetch_array($r_login); $_SESSION['login_id']=$login_id=$row_login['subscriber_id']; $_SESSION['login_email']=$row_login['subscriber_email']; ?> <script language="JavaScript" type="text/javascript"> window.location='index.php?page=myaccount&&page2=account_info'; </script> <? } else { $page="login"; $_SESSION['login_error']="User-email and Password mismatched .. If you have not registered yet, please do register first."; } } if($_POST['Submit']=="Send Password") { $q_fp="select * from subscriber where subscriber_email='".trim($_POST['email'])."'"; $r_fp=mysql_query($q_fp); if(mysql_num_rows($r_fp)>0) { $row_fp=mysql_fetch_array($r_fp); $pass=$row_fp['password']; $to=trim($_POST['email']); $from="Password@".$_SERVER['HTTP_HOST']; $subject="Your Password"; $msg="Hi, ".$row_fp['subscriber_name']."/n/r/n/rYour Password : <b>".$row_fp['password']."</b>\n\r\n\r\n\rThanks,\n\rSupport"; $headerss = 'MIME-Version: 1.0' . "\r\n"; $headerss .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headerss .= 'To: '.$to. "\r\n"; $headerss .= 'From:' .$from. "\r\n"; $page="login"; $_SESSION['login_error']="Email has been sent with password information"; mail($to, $subject, $msg, $headerss); } else { $page="login"; $_SESSION['login_error']="User-email Not found .. If you have not registered yet, please do register first."; } } if($page=="") { $bodypage="pages/index.php"; } else if($page=="logout") { unset($_SESSION['login']); ?> <script language="JavaScript" type="text/javascript"> window.location='index.php'; </script> <? } else { $bodypage="pages/".$page.".php"; } //echo $bodypage; //exit(); ?>