Umaid123 Posted October 23, 2009 Share Posted October 23, 2009 This is Order now1.php code, it is working fine with Login and New User Registration. Now I am integrating my_area1.php in which I am implementing forget password and change password function, and need assistance on error removing. Plz help <?php //include('logincheck.php'); //include('forget_passwd.php'); include('my_area1.php'); //session_start(); $error = " You can't connect at this time"; $con=mysql_connect('localhost','root','') or die($error); $db=mysql_select_db('academyessay',$con) or die($error); // User registraton $cmdSubmit="Submit"; if(isset($_POST['Submit'])) { //Step # 1 get the data from html form $txtName=$_POST['txtName']; $txtNewPassword=$_POST['txtNewPassword']; $txtNewPassword2 =$_POST['txtNewPassword2']; $txtPhone =$_POST['txtPhone']; $txtPhoneExt = $_POST['txtPhoneExt']; $txtEmail = $_POST['txtEmail']; try { //if(!filled_out($_POST)) //{ // throw new exception (' You have not filled out form correctly, please go back and try again'); //} if (!valid_email($txtEmail)) { throw new exception ('This is not a valid email address, please go back and try again'); } if ($txtNewPassword = !$txtNewPassword2) { throw new exception ('The password you have entered donot match, please go back and try again'); } // check password length /*if ((strlen($txtNewPassword) < 6) || (strlen($txtNewPassword) > 12)) { throw new exception (' Your password must be between 6 and 16 character, please go back and try again'); }*/ // check phone number if ($txtPhone = ereg_replace("[^0-9]", "", $txtPhone)== FALSE) { throw new Exception ('Please enter phone number in digits'); } // attempt to register // this function can also throw an exception register($txtName,$txtNewPassword,$txtNewPassword2, $txtPhone,$txtPhoneExt, $txtEmail); //register session variable $_SESSION['txtName'] = $txtName; } catch (Exception $e) { //do_html_header('Problem:'); //$prob = "Unable to registetr at this time"; echo $e->getMessage(); exit; } } // step #2 generate Query function register($txtName,$txtNewPassword, $txtNewPassword2, $txtPhone,$txtPhoneExt, $txtEmail ) { // register new person with db // check if username is unique $sql = "select * from customers where UserName='".$txtName."'"; if (!$sql) { throw new Exception('could not execute query'); } if($sql-> num_rows>0){ throw new Exception ('That username is taken - go back and choose another one'); } mysql_query($sql); $sql="insert into customers(UserName,Password,ConfirmPassword,PhoneNo,Ext,EmailAddress) values('$txtName','$txtNewPassword','$txtNewPassword2','$txtPhone','$txtPhoneExt','$txtEmail')"; mysql_query($sql); echo "<script>alert('Your registration is successful, Now you can place order for the desired services');window.location='payment.html';</script>" ; if(!$sql){ throw new Exception ('Could not register you in the database - please try again later'); } return true; } $sql="select * from customers where UserID = '".$UserId."'"; $result=mysql_query($sql); if(mysql_num_rows($result)>0) { while($rs=mysql_fetch_array($result)) { $txtName=$rs['UserName']; $txtNewPassword=$rs['Password']; $txtNewPassword2=$rs['ConfirmPassword']; $txtPhone=$rs['PhoneNo']; $txtPhoneExt=$rs['Ext']; $txtEmail=$rs['EmailAddress']; } } /*function filled_out($form_vars) { // test that each variable has a value foreach ($form_vars as $key => $value) { if ((!isset($key)) || ($value == '')) { return false; } } return true; }*/ function valid_email($txtEmail){ // check eamail address is possibly valid if (ereg('^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-z0-9\-\.]+$', $txtEmail)){ return true; } else { return false; } } ?> <? //session_start(); $error = 'cannot establish connection with the database'; $conn = mysql_connect('localhost','root','') or die($error); $db = mysql_select_db('academyessay') or die($error); // CHECKS FORM DATA if ($_POST['Login']) { $txtOldEmail = addslashes(strip_tags($_POST['txtOldEmail'])); $txtPassword = addslashes(strip_tags($_POST['txtPassword'])); if (!$txtOldEmail || !$txtPassword) { echo "please enter username and password"; } else{ $find = mysql_query("Select * from members where EmailAddress = '".$txtOldEmail."'"); if(mysql_num_rows($find)== 0) { echo "Username not found"; } else { while($find_row = mysql_fetch_assoc($find)) { $password_hash =$find_row['txtPassword']; } } if ($txtPassword == FALSE) { ECHO "Incorrect password"; } else { $_SESSION['txtOldEmail'] = $txtOldEmail; echo "<script>alert('Your are successfully Logged in');window.location='payment.html';</script>" ; } } } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <title>www.academyessays.com </title> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT=""> <META NAME="Keywords" CONTENT=""> <META NAME="Description" CONTENT=""> <link rel="stylesheet" type="text/css" href="test1.css"> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; } } else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); function MM_timelinePlay(tmLnName, myID) { //v1.2 //Copyright 1997, 2000 Macromedia, Inc. All rights reserved. var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false; if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time tmLn = document.MM_Time[tmLnName]; if (myID == null) { myID = ++tmLn.ID; firstTime=true;}//if new call, incr ID if (myID == tmLn.ID) { //if Im newest setTimeout('MM_timelinePlay("'+tmLnName+'","'+myID+'")',tmLn.delay); fNew = ++tmLn.curFrame; for (i=0; i<tmLn.length; i++) { sprite = tmLn; if (sprite.charAt(0) == 's') { if (sprite.obj) { numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0]; if (fNew >= firstKeyFr && fNew <= sprite.keyFrames[numKeyFr-1]) {//in range keyFrm=1; for (j=0; j<sprite.values.length; j++) { props = sprite.values[j]; if (numKeyFr != props.length) { if (props.prop2 == null) sprite.obj[props.prop] = props[fNew-firstKeyFr]; else sprite.obj[props.prop2][props.prop] = props[fNew-firstKeyFr]; } else { while (keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]) keyFrm++; if (firstTime || fNew==sprite.keyFrames[keyFrm-1]) { if (props.prop2 == null) sprite.obj[props.prop] = props[keyFrm-1]; else sprite.obj[props.prop2][props.prop] = props[keyFrm-1]; } } } } } } else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value); if (fNew > tmLn.lastFrame) tmLn.ID = 0; } } } function MM_timelineGoto(tmLnName, fNew, numGotos) { //v2.0 //Copyright 1997, 2000 Macromedia, Inc. All rights reserved. var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,lastKeyFr,propNum,theObj; if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time tmLn = document.MM_Time[tmLnName]; if (numGotos != null) if (tmLn.gotoCount == null) tmLn.gotoCount = 1; else if (tmLn.gotoCount++ >= numGotos) {tmLn.gotoCount=0; return} jmpFwd = (fNew > tmLn.curFrame); for (i = 0; i < tmLn.length; i++) { sprite = (jmpFwd)? tmLn : tmLn[(tmLn.length-1)-i]; //count bkwds if jumping back if (sprite.charAt(0) == "s") { numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0]; lastKeyFr = sprite.keyFrames[numKeyFr - 1]; if ((jmpFwd && fNew<firstKeyFr) || (!jmpFwd && lastKeyFr<fNew)) continue; //skip if untouchd for (keyFrm=1; keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]; keyFrm++); for (j=0; j<sprite.values.length; j++) { props = sprite.values[j]; if (numKeyFr == props.length) propNum = keyFrm-1 //keyframes only else propNum = Math.min(Math.max(0,fNew-firstKeyFr),props.length-1); //or keep in legal range if (sprite.obj != null) { if (props.prop2 == null) sprite.obj[props.prop] = props[propNum]; else sprite.obj[props.prop2][props.prop] = props[propNum]; } } } else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value); } tmLn.curFrame = fNew; if (tmLn.ID == 0) eval('MM_timelinePlay(tmLnName)'); } function MM_initTimelines() { //v4.0 //MM_initTimelines() Copyright 1997 Macromedia, Inc. All rights reserved. var ns = navigator.appName == "Netscape"; var ns4 = (ns && parseInt(navigator.appVersion) == 4); var ns5 = (ns && parseInt(navigator.appVersion) > 4); document.MM_Time = new Array(1); document.MM_Time[0] = new Array(2); document.MM_Time["Timeline1"] = document.MM_Time[0]; document.MM_Time[0].MM_Name = "Timeline1"; document.MM_Time[0].fps = 30; document.MM_Time[0][0] = new String("sprite"); document.MM_Time[0][0].slot = 1; if (ns4) document.MM_Time[0][0].obj = document["Layer7"]; else if (ns5) document.MM_Time[0][0].obj = document.getElementById("Layer7"); else document.MM_Time[0][0].obj = document.all ? document.all["Layer7"] : null; document.MM_Time[0][0].keyFrames = new Array(1, 15, 30); document.MM_Time[0][0].values = new Array(2); if (ns5) document.MM_Time[0][0].values[0] = new Array("549px", "549px", "549px", "549px", "549px", "549px", "549px", "549px", "549px", "549px", "549px", "549px", "549px", "549px", "549px", "549px", "549px", "549px", "549px", "549px", "549px", "549px", "549px", "549px", "549px", "549px", "549px", "549px", "549px", "549px"); else document.MM_Time[0][0].values[0] = new Array(549,549,549,549,549,549,549,549,549,549,549,549,549,549,549,549,549,549,549,549,549,549,549,549,549,549,549,549,549,549); document.MM_Time[0][0].values[0].prop = "left"; if (ns5) document.MM_Time[0][0].values[1] = new Array("637px", "639px", "642px", "644px", "646px", "649px", "651px", "654px", "656px", "658px", "661px", "663px", "665px", "668px", "670px", "668px", "666px", "663px", "661px", "659px", "657px", "655px", "652px", "650px", "648px", "646px", "644px", "641px", "639px", "637px"); else document.MM_Time[0][0].values[1] = new Array(637,639,642,644,646,649,651,654,656,658,661,663,665,668,670,668,666,663,661,659,657,655,652,650,648,646,644,641,639,637); document.MM_Time[0][0].values[1].prop = "top"; if (!ns4) { document.MM_Time[0][0].values[0].prop2 = "style"; document.MM_Time[0][0].values[1].prop2 = "style"; } document.MM_Time[0][1] = new String("behavior"); document.MM_Time[0][1].frame = 31; document.MM_Time[0][1].value = "MM_timelineGoto('Timeline1','1')"; document.MM_Time[0].lastFrame = 31; for (i=0; i<document.MM_Time.length; i++) { document.MM_Time.ID = null; document.MM_Time.curFrame = 0; document.MM_Time.delay = 1000/document.MM_Time.fps; } } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}} } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc; } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> <body onLoad="MM_preloadImages('file:///D|/Projects/AcademyEssays/L4.JPG','file:///D|/Projects/AcademyEssays/ban-request-a-callback.gif');MM_timelinePlay('Timeline1')" bgcolor="#FFFFFF" > <div style="position:absolute; left: 3px; top: 2px;"> <map name="final"> <area shape="rect" coords="3,155,70,178" href="file:///D|/Projects/AcademyEssays/final1.html" target="_parent" alt="final1"> <area shape="rect" coords="87,153,159,178" href="file:///D|/Projects/AcademyEssays/services1.html" target="_parent" alt="services"> <area shape="rect" coords="197,151,284,179" href="file:///D|/Projects/AcademyEssays/Price Plan1.html" target="_parent" alt="price plan"> <area shape="rect" coords="317,150,442,182" href="file:///D|/Projects/AcademyEssays/writing process1.html" target="_parent" alt="writing process"> <area shape="rect" coords="479,152,574,178" href="file:///D|/Projects/AcademyEssays/compare us1.html"> <area shape="rect" coords="605,153,729,180" href="file:///D|/Projects/AcademyEssays/our guarantees.html"> <area shape="rect" coords="757,153,849,179" href="file:///D|/Projects/AcademyEssays/order now.htm"> <area shape="rect" coords="873,153,968,179" href="file:///D|/Projects/AcademyEssays/contact us.htm" target="_parent" alt="contact us"> <area shape="rect" coords="914,77,929,88" href="file:///D|/Projects/AcademyEssays/my area.htm" target="_parent" alt="my area"> <area shape="circle" coords="767,85,12" href="#"> <area shape="circle" coords="768,95,1" href="#"> </map> <div id="Layer4" style="position:absolute; width:702px; height:98px; z-index:4; left: 225px; top: 1171px;"> <div align="center"><a href="/index.asp" class="flink" title="Home">Home</a> | <a href="/essay/price-plan.asp" class="flink" title="Price Plan">Price Plan</a> | <a href="/essay/writing-process.asp" class="flink" title="Writing Process">Writing Process</a> | <a href="/essay/faq.asp" class="flink" title="FAQs">FAQs</a> | <a href="/essay/our-guarantees.asp" class="flink" title="Our Guarantees">Our Guarantees</a> | <a href="/EQ/ordernow.aspx" class="flink" title="Order Now">Order Now</a> | <a href="/AccountArea/MyAccount.aspx" class="flink">My Area</a> <br> <a href="/essay/contactus.asp" class="flink" title="Contact us">Contact us</a> | <a href="/EQ/order-login.aspx?t=2" class="flink" title="Revision Request">Revision Request</a> | <a href="/EQ/order-login.aspx?t=1" class="flink" title="Order Tracking">Order Tracking</a> <span class="ver11 bluef" style="padding:6px 0px"> <span class="ver11 bluef" style="padding:6px 0px">| <a href="/sitemap.asp" class="flink" title="Sitemap">Sitemap</a> </span><span class="ver11 bluef" style="padding:6px 0px"> <span class="ver11 bluef" style="padding:6px 0px"> <span class="ver11 bluef" style="padding:6px 0px">| <a href="/links/links.asp" class="flink" title="Links">Links</a></span></span></span></span> </div> <br> <tr align="center">Copyright © 2009 AcademyEssays.com. All rights reserved.</tr> <br> <tr align="center"><a href="/essay/cap.asp" class="flink" title="Conditions and Policies">Conditions and Policies</a></tr> </div> <span style="position:absolute; left: 6px; top: 1044px; width: 235px; height: 110px;"><img src="file:///D|/Projects/AcademyEssays/customer_support.gif" width="234" height="112" alt="csupport"></span><img src="file:///D|/Projects/AcademyEssays/header.jpg" border="0" width="990" height="180" usemap="#final"> <marquee style="font-family:Impact; color: #FFFFFF" bgcolor="205A93" scrolldelay="150" behavior="scroll" width="990"> Place your order NOW for your customised paper by Academy Papers</marquee> </div> </HEAD> <BODY> <table width="786" style="position:absolute; border:3px solid #225992; border-top:none; border-left:none; border-bottom:none; border-width: thin; padding-top:5px; width : 994px; height : 2048px valign : top; left: 2px; top: 205px; height: 963px;"> <tr> <td width="777" height="889"> <p> <p><BR> </p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <table id="Table1" cellspacing="0" cellpadding="0" style= "position:absolute; left: 0px; top: 6px; width: 255px;"> <tbody> <tr> <td style="BACKGROUND-IMAGE: url(Rounded Border/bubblecorner1.gif); WIDTH: 8px; HEIGHT: 8px"></td> <td style="BACKGROUND-IMAGE: url(Rounded Border/bubbletop.gif); BACKGROUND-REPEAT: repeat-x; width: 200 " ></td> <td style="BACKGROUND-IMAGE: url(Rounded Border/bubblecorner2.gif); WIDTH: 8px; HEIGHT: 8px"></td> </tr> <tr> <td style="BACKGROUND-IMAGE: url(Rounded Border/bubblecorner4.gif); BACKGROUND-REPEAT: no-repeat; height: 940; BACKGROUND-POSITION: 50% bottom"> </td> <td style="BACKGROUND-IMAGE: url(Rounded Border/bubblebottom.gif); BACKGROUND-REPEAT: repeat-x; width:190"><table border="0" cellspacing="0" cellpadding="0" width="200" style="position:absolute; left: 11px; top: 12px;"> <tbody> <tr> <td valign="top"><img style="MARGIN-TOP: 8px; MARGIN-LEFT: 8px; MARGIN-RIGHT: 0px" alt="Tutorials" src="Rounded Border/icon_green_sd.gif" /></td> <td align="left" valign="top"><h2 style="MARGIN-TOP: 0px; FONT-FAMILY: Arial; MARGIN-BOTTOM: 0px; COLOR: #404040; MARGIN-LEFT: 20px; FONT-SIZE: 170%"> <a href="">Writing Services</a> </h2></td> </tr> </tbody> </table> <table border="0" cellspacing="0" cellpadding="0" style="position:absolute; top: 78px;"> <tbody> <tr> <td width="5"></td> <td><ul style="MARGIN-TOP: 4px; MARGIN-BOTTOM: 15px"> <li> Essay</li> <li> Thesis </li> <li>Dissertation </li> <li> Book Summary </li> <li> Book Review </li> <li> Case Study </li> <li> Admission Essay </li> <li> Term Paper </li> </ul></td> </tr> </tbody> <tbody> <tr> <td valign="top"><img style="MARGIN-TOP: 8px; MARGIN-LEFT: 8px; MARGIN-RIGHT: 0px" alt="Tutorials" src="Rounded Border/icon_green_sd.gif" /></td> <td align="left"><h2 style="MARGIN-TOP: 0px; FONT-FAMILY: Arial; MARGIN-BOTTOM: 0px; COLOR: #404040; MARGIN-LEFT: 20px; FONT-SIZE: 170%"> <a href="">Application Services</a> </h2></td> </tr> </tbody> </table> <table border="0" cellspacing="0" cellpadding="0" style="position:absolute; top: 313px;"> <tbody> <tr> <td width="5"></td> <td><ul style="MARGIN-TOP: 4px; MARGIN-BOTTOM: 15px"> <li> Personal Statement </li> <li> Scholarship Essay </li> <li> Editing </li> </ul></td> </tr> </tbody> <tbody> <tr> <td valign="top"><img style="MARGIN-TOP: 8px; MARGIN-LEFT: 8px; MARGIN-RIGHT: 0px" alt="Tutorials" src="Rounded Border/icon_green_sd.gif" /></td> <td align="left"><h2 style="MARGIN-TOP: 0px; FONT-FAMILY: Arial; MARGIN-BOTTOM: 0px; COLOR: #404040; MARGIN-LEFT: 20px; FONT-SIZE: 170%"> <a href="">Editing Services</a> </h2></td> </tr> </tbody> </table> <table border="0" cellspacing="0" cellpadding="0" style="position:absolute; top: 492px;"> <tbody> <tr> <td width="5"></td> <td><ul style="MARGIN-TOP: 4px; MARGIN-BOTTOM: 15px"> <li> Formatting </li> <li> Editing </li> </ul></td> </tr> </tbody> <tbody> <tr> <td valign="top"><img style="MARGIN-TOP: 8px; MARGIN-LEFT: 8px; MARGIN-RIGHT: 0px" alt="Tutorials" src="Rounded Border/icon_green_sd.gif" /></td> <td align="left"><h2 style="MARGIN-TOP: 0px; FONT-FAMILY: Arial; MARGIN-BOTTOM: 0px; COLOR: #404040; MARGIN-LEFT: 20px; FONT-SIZE: 170%"> <a href="">Citation </a></h2> <h2 style="MARGIN-TOP: 0px; FONT-FAMILY: Arial; MARGIN-BOTTOM: 0px; COLOR: #404040; MARGIN-LEFT: 20px; FONT-SIZE: 170%"><a href="">Style</a> </h2></td> </tr> </tbody> </table> <table border="0" cellspacing="0" cellpadding="0" style="position:absolute; top: 614px; width: 195px;"> <tbody> <tr> <td width="5"> </td> <td><ul style="MARGIN-TOP: 4px; MARGIN-BOTTOM: 15px"> <li>Harvard </li> <li> MLA</li> <li> Chicago/Turabian </li> <li> APA </li> <li> Oxford </li> </ul></td> </tr> </tbody> <tbody> </tbody> </table></td> <td style="BACKGROUND-IMAGE: url(Rounded Border/bubblecorner3.gif); BACKGROUND-REPEAT: no-repeat; height: 940; BACKGROUND-POSITION: 50% bottom"></td> </tr> </tbody> </table> <BR> <BR> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <div id="Layer6" style="position:absolute; width:177px; height:75px; z-index:6; left: 301px; top: 850px;"><a href="file:///D|/Projects/AcademyEssays/Price Plan.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image5','','file:///D|/Projects/AcademyEssays/L4.JPG',1)"></a><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image13','','file:///D|/Projects/AcademyEssays/ban-request-a-callback.gif',1)"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image13','','file:///D|/Projects/AcademyEssays/ban-request-a-callback.gif',1)"><img src="file:///D|/Projects/AcademyEssays/ban-sales-support.jpg" alt="ordernow1" name="Image13" width="219" height="88" border="0"></a></div> <TABLE class="cmpbdr" style="position:absolute; left: 259px; top: 7px; width: 727px; height: 780px;" cellSpacing="0" cellPadding="0" width="780" bgColor="#E1E1E1" align="center" blue?=""> <TBODY> <TR> <TD height="100" vAlign="bottom" align="right"> <IMG src="file:///D:/Projects/AcademyEssays/L2.gif" width="363" height="153" /> </TD> </TR> <TR> <TD vAlign="top" align="left"> <form name="form1" method="POST" action="order now1.php" > <TABLE class="cmpbdr" id="borcolor" cellSpacing="0" cellPadding="0" width="686" align="center"> <TBODY> <TR> <TD style="PADDING-BOTTOM: 17px; PADDING-LEFT: 21px; PADDING-RIGHT: 21px; PADDING-TOP: 17px" class="ordertdstyle" vAlign="top" width="462" align="left"> <TABLE border="0" cellSpacing="0" cellPadding="0" width="100%"> <TBODY> <TR vAlign="middle" align="left"> <TD height="25" width="50%"> 1. Enter your e-mail address: </TD> <TD height="25" width="50%"> <INPUT id="txtOldEmail" class="boxbdr" maxLength="100" name="txtOldEmail" AUTOCOMPLETE="OFF" value="<?php echo htmlentities($txtOldEmail); ?>" /> </TD> </TR> <TR vAlign="middle" align="left"> <TD height="47" colSpan="2"> 2. Select one of the options below and click on "Sign in using our<BR />secure server" </TD> </TR> <TR vAlign="middle" align="left"> <TD class="ver13" height="25" colSpan="2"> <STRONG><SPAN class="ver13"><B><INPUT id="rbExist" onClick="document.form1.txtPassword.focus();" CHECKED type="radio" name="rbEmail" value="rbExist" /><LABEL for="rbExist">I am a returning customer, and my password is:</LABEL></B></SPAN> </STRONG> </TD> </TR> <TR vAlign="middle" align="left"> <TD height="25"> </TD> <TD height="30"> <INPUT id="txtPassword" class="boxbdr" onFocus="document.form1.rbEmail[0].checked = true;" onClick="document.form1.rbEmail[0].checked = true;" maxLength="20" type="password" name="txtPassword" value="<?php echo htmlentities($txtPassword); ?>" /> </TD> </TR> <TR align="center" > <TD height="65" vAlign="middle" colSpan="2"> <INPUT type="Submit" name="Login" value="Log in" /> </TD> </TR> </form> <Br> <form name="form2" method="POST" action="order now1.php" > <tbody> <table style="position:absolute; left: 468px; top: 3px;"> <TABLE border="0" cellSpacing="0" cellPadding="0" width="100%"> <TBODY> <TR vAlign="middle" align="left"> <TD class="ver13" height="25" colSpan="2"> <STRONG><SPAN class="ver13" DESIGNTIMEDRAGDROP="410"><B><INPUT id="rbNew" onClick="document.form1.txtName.focus();" type="radio" name="rbEmail" value="rbNew" /><LABEL for="rbNew">I am a new customer.</LABEL></B></SPAN></STRONG> </TD> </TR> <TR> <TD height="25" vAlign="middle" align="right"> Please create a new account </TD> <TD height="25"> </TD> </TR> <TR> <TD height="25" vAlign="middle" align="right"> Name </TD> <TD height="25"> <INPUT id="txtName" class="boxbdr" onFocus="document.form1.rbEmail[1].checked = true;" onClick="document.form1.rbEmail[1].checked = true;" maxLength="100" name=<?$txtName?> AUTOCOMPLETE="OFF" value="<?php echo htmlentities($txtName); ?>" > </TD> </TR> <TR> <TD height="25" vAlign="middle" align="right"> Password </TD> <TD height="25"> <INPUT id="txtNewPassword" class="boxbdr" maxLength="20" type="password" name="txtNewPassword" value="<?php echo htmlentities($txtNewPassword); ?>" /> </TD> </TR> <TR> <TD height="25" vAlign="middle" align="right"> Confirm Password </TD> <TD height="25"> <INPUT id="txtNewPassword2" class="boxbdr" maxLength="20" type="password" name="txtNewPassword2" value="<?php echo htmlentities($txtNewPassword2); ?>" /> </TD> </TR> <TR> <TD height="25" vAlign="middle" align="right"> Phone No. </TD> <TD height="25"> <INPUT id="txtPhone" class="boxbdr" maxLength="50" size="10" name="txtPhone" AUTOCOMPLETE="OFF" value="<?php echo htmlentities($txtPhone); ?>" /> <STRONG>EXT</STRONG> <INPUT id="txtPhoneExt" class="boxbdr" maxLength="10" size="1" name="txtPhoneExt" value="<?php echo htmlentities($txtPhoneExt); ?>" /> </TD> </TR> <TR> <TD height="25" vAlign="middle" align="right">Email </TD> <TD height="25"><INPUT id="txtEmail" class="boxbdr" maxLength="20" type="Email" name="txtEmail" value="<?php echo htmlentities($txtEmail); ?>" /></TD> </TR> <TR align="center"> <TD height="65" vAlign="middle" colSpan="2"> <a href="payment.html"><INPUT id="cmdSubmit" onClick="check_valid_user()" border="0" type="Submit" name=<?=$cmdSubmit?> value=<?=$cmdSubmit?> /></a> <BR /><BR /> </TD> </TR> <TR align="left"> <TD height="20" vAlign="middle" colSpan="2"> <P> <A class="clink" href="my_area1.php" ><Input type="Submit" name="ForgetPass" value="Forget Password"></A><font face="Arial, Helvetica, sans-serif" size="-1">Forgot your password? Click here.</font> </P> </TD> </TR> <TR align="left"> <TD height="20" vAlign="middle" colSpan="2"> </TD> </TR> <TR align="left"> <TD height="25" vAlign="middle" colSpan="2"> </TD> </TR> </TBODY> </TABLE> </form> <TD class="cmpbdr" vAlign="top" width="224" align="center"> <TABLE border="0" cellSpacing="0" cellPadding="0" width="29%" align="center"> <TBODY> <TR> <TD width="100%"> <IMG src="file:///D:/Projects/AcademyEssays/L3.jpg" width="200" height="120" /> </TD> </TR> </TBODY> </TABLE> <TABLE border="0" cellSpacing="0" cellPadding="0" width="29%" align="center"> <TBODY> <TR> <TD> <!-- BEGIN ProvideSupport.com Graphics Chat Button Code --> <div id="cibECI" style="position:absolute; width:184px; height:169px; z-index:3; left: 812px; top: 340px;"></div><div id="scbECI" style="display:inline"></div><div id="sdbECI" style="display:none"></div><script type="text/javascript">var sebECI=document.createElement("script");sebECI.type="text/javascript";var sebECIs=(location.protocol.indexOf("https")==0?"https":"http")+"://image.providesupport.com/js/umaid/safe-standard.js?ps_h=bECI&ps_t="+new Date().getTime();setTimeout("sebECI.src=sebECIs;document.getElementById('sdbECI').appendChild(sebECI)",1)</script><noscript><div style="display:inline"><a href="http://www.providesupport.com?messenger=umaid">Customer Support Chat</div></noscript> <!-- END ProvideSupport.com Graphics Chat Button Code --> </TD> </TR> </TBODY> </TABLE> <SCRIPT language="JavaScript" type="text/JavaScript"> <!-- function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } //--> </SCRIPT> <TABLE border="0" cellSpacing="0" cellPadding="0" width="99%" align="center"> <TBODY> <TR> <TD class="ver13 white spheadbgcolor" height="40" vAlign="middle" align="left"> <STRONG> Academy Essay Safe Shopping <BR /> Guarantee</STRONG> </TD> </TR> <TR> <TD> <IMG src="file:///D|/Projects/AcademyEssays/ban-request-a-callback.gif" alt="" width="220" /> </TD> </TR> <TR> <TD style="PADDING-BOTTOM: 14px; PADDING-LEFT: 14px; PADDING-RIGHT: 14px; PADDING-TOP: 14px" vAlign="top" align="left"> We guarantee that every transaction you make at Academy Essays will be 100% secure. We use the most sophisticated technology for meeting the standards required to conduct secure online transactions. <BR /><BR /><A class="clink" title="Read More" href="javascript:MM_openBrWindow('popup-shopping.aspx','shopping','scrollbars=yes,width=390,height=450');"><STRONG>Read More</STRONG></A> </TD> </TR> </TBODY> </TABLE> </TD> </TR> </TABLE> </form> <BR /><BR /><BR /> </TD> </TR> </TBODY> </TABLE> <p> </p> <p></p> <p> </p> <p><BR> </p> <p> </p> </td> </tr> </table> <table valign =top> <tr><td> <!--<marquee bgcolor=orange width=300 height=300 direction=up alig=right> <img src="ban-request-a-callback.gif" width="218" height="58" border="0" alt=""> </marquee>--> </td> </tr> </table> <!-- <br/> --> <!-- <a href="members_only.php"> Members Section </a> --> </BODY> </HTML> =============================================== Quote Link to comment https://forums.phpfreaks.com/topic/178792-need-assistance-on-forget-ur-password-and-change-password/ Share on other sites More sharing options...
Umaid123 Posted October 23, 2009 Author Share Posted October 23, 2009 my_area1.php which contains Forget password and change password code. I am integrating this code with above order now1.php Please view and integrate with above without errors <?php //require_once('order now1.php'); //session_start(); //include('forget_passwd.php'); $conn = mysql_connect("localhost", "root", "") or die(mysql_error()); $db = mysql_select_db("academyessay",$conn) or die(mysql_error()); // create short variable names $old_password = $_POST['old_password']; $new_password = $_POST['new_password']; $new_password2 = $_POST['new_password2']; try { check_valid_user(); //if(!filled_out($_POST)){ // throw new Exception('You have not filled out the completely, Please try again'); //} if ($new_password != $new_password2) { throw new Exception('Password entered were not the same. Not change'); } if((strlen($new_password) > 16 || (strlen($new_password)<6))) { throw new Exception('New password must be between 6 and 16 characters. Try again'); } // attempt update change_password($_SESSION['valid_user'], $old_password, $$new_password); echo 'Password changed'; } catch (Exception $e) { echo $e->getMessage(); } //display_user_menu(); function change_password($username , $old_password , $new_password){ // change password for username/ old to new password // if old password is right login($txtName , $old_password); $sql = " update customers set Password = sha1('".$new_password."') where UserName = '".$txtName."'"; if (!$sql) { throw new Exception ('Password could not be changed.'); } else { return true; // change successfully } } mysql_query($sql); $conn = mysql_connect("localhost", "root", "") or die(mysql_error()); $db = mysql_select_db("academyessay",$conn) or die(mysql_error()); $txtName = $_POST['txtName']; try { $txtNewPassword = reset_password($txtName); notify_password($txtName , $new_password); echo 'Your new password has been emailed to you.<br />'; } catch (Exception $e) { echo "Your password could not be reset - please try again later"; } //do_html_url('my_area1.php' , 'Login'); //echo "<script>alert('Login Details');window.location='my_area1.php';</script>" ; function reset_password($txtName) { // set password for username to a random value $new_password = get_random_word(6 , 13); if($new_password == false) { throw new Exception('Could not generate new password'); } // add a number between 0 to 99 to it // to make it a slightly better password $rand_number = rand(0,999); $new_password .= $rand_number; // set user's password to this in database or return false $sql = "update customers set Password = sha1('".$new_password."') where UserName = '".$txtName."'"; if (!$sql) { throw new Exception('Could not change password') ; } else{ return $new_password; } } mysql_query($sql); function get_random_word($min_length , $max_length) { // grab a random word from dictionary between the two lenghts // and return it // generate a random word $word = ''; // remember to change this path to suit your system $dictionary = '/usr/dict/words'; // ispell dictionary $fp = @fopen($dictionary , 'r'); if(!$fp) { return false; } $size = falsesize($dictionary); // go to random location in dictionary $rand_location = rand(0, $size); fseek($fp , $rand_location); // get the next whole word of the right length in the file while ((strlen($word) < $min_length) || (strlen($word)>$max_length) || (strstr($word,"'"))) { if (feof($fp)) { fseek($fp, 0); // if at end, go to start } $word = fgets($fp , 80); // skip first word as it could be partial $word = fgets($fp , 80); // the potntial password } $word = trim($word); // trim the trailing \n from fgets return $word; } function notify_password($txtName , $new_password) { // notify the user that their password has been changed $sql= "select EmailAddress from customers where UserName = '".$txtName."'"; if (!$sql) { throw new Exception('Could not find email address.'); } else if ($sql->num_rows == 0) { throw new Exception('Could not find email address'); // username not in db } else { $row = $sql->fetch_object(); $txtOldEmail = $row->email; $from = "From : [email protected] \r\n"; $mesg = "Your Academy Essay password has been changed to ".$new_password."\r\n"." Please change it next time you log in/ \r\n"; if(mail($txtOldEmail, 'Academy Essay Login Information' , $mesg , $from)) { return true; } else{ throw new Exception ('Could not send email. '); } } } function check_valid_user() { // see if somebody is logged in and notify them if not if (isset($_SESSION['valid_user'])) { echo "Logged in as ".$_SESSION['valid_user'].".<br />"; //do_html_url('payment.html', 'Place your order details'); echo "<script>alert('Place your order details');window.location='payment.html';</script>" ; } else { // they are not logged in //do_html_header('Problem'); try{ //echo 'You are not logged in.<br />'; //echo "<script>alert('You are not logged in');window.location='order now1.php';</script>" ; //exit; } catch (Exception $e) { echo ' This is an error'; } } } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>www.academyessays.com</title> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT=""> <META NAME="Keywords" CONTENT=""> <META NAME="Description" CONTENT=""> <title>www.academyessays.com</title> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT=""> <META NAME="Keywords" CONTENT=""> <META NAME="Description" CONTENT=""> <script type="text/javascript"> <!-- function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_nbGroup(event, grpName) { //v6.0 var i,img,nbArr,args=MM_nbGroup.arguments; if (event == "init" && args.length > 2) { if ((img = MM_findObj(args[2])) != null && !img.MM_init) { img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src; if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array(); nbArr[nbArr.length] = img; for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args)) != null) { if (!img.MM_up) img.MM_up = img.src; img.src = img.MM_dn = args[i+1]; nbArr[nbArr.length] = img; } } } else if (event == "over") { document.MM_nbOver = nbArr = new Array(); for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args)) != null) { if (!img.MM_up) img.MM_up = img.src; img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up); nbArr[nbArr.length] = img; } } else if (event == "out" ) { for (i=0; i < document.MM_nbOver.length; i++) { img = document.MM_nbOver; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; } } else if (event == "down") { nbArr = document[grpName]; if (nbArr) for (i=0; i < nbArr.length; i++) { img=nbArr; img.src = img.MM_up; img.MM_dn = 0; } document[grpName] = nbArr = new Array(); for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args)) != null) { if (!img.MM_up) img.MM_up = img.src; img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up; nbArr[nbArr.length] = img; } } } //--> </script> <div> <map name="final"> <area shape="rect" coords="1,149,112,175" href="final1.html" target="_parent" alt="final1"> <area shape="rect" coords="111,148,219,175" href="services.html" target="_parent" alt="services"> <area shape="rect" coords="218,148,331,176" href="Price Plan.html" target="_parent" alt="price plan"> <area shape="rect" coords="330,149,493,174" href="writing process.html" target="_parent" alt="writing process"> <area shape="rect" coords="495,148,612,178" href="compare us.html"> <area shape="rect" coords="613,146,764,178" href="our gurantees.html"> <area shape="rect" coords="765,147,877,175" href="order now.html"> <area shape="rect" coords="877,149,1024,177" href="contact us.html" target="_parent" alt="contact us"> <area shape="rect" coords="926,76,941,87" href="my area.html" target="_parent" alt="my area"> </map> <img src="final.jpg" border="0" width="1024" height="180" usemap="#final"> <marquee style="font-family:Impact; color: #FFFFFF" bgcolor="205A93" scrolldelay="60" behavior="scroll" width="1024"> Place your order NOW for your customised paper by Academy Papers<</marquee> </div> <table id="Table1" cellspacing="0" cellpadding="0" style= "position:absolute; left: 0px; top: 6px;"> <tbody> <tr> <td style="BACKGROUND-IMAGE: url(Rounded Border/bubblecorner1.gif); WIDTH: 8px; HEIGHT: 8px"></td> <td style="BACKGROUND-IMAGE: url(Rounded Border/bubbletop.gif); BACKGROUND-REPEAT: repeat-x; width: 200 " ></td> <td style="BACKGROUND-IMAGE: url(Rounded Border/bubblecorner2.gif); WIDTH: 8px; HEIGHT: 8px"></td> </tr> <tr> <td style="BACKGROUND-IMAGE: url(Rounded Border/bubblecorner4.gif); BACKGROUND-REPEAT: no-repeat; height: 940; BACKGROUND-POSITION: 50% bottom"> </td> <td style="BACKGROUND-IMAGE: url(Rounded Border/bubblebottom.gif); BACKGROUND-REPEAT: repeat-x; width:190"><table border="0" cellspacing="0" cellpadding="0" width="200" style="position:absolute; left: 11px; top: 12px;"> <tbody> <tr> <td valign="top"><img style="MARGIN-TOP: 8px; MARGIN-LEFT: 8px; MARGIN-RIGHT: 0px" alt="Tutorials" src="Rounded Border/icon_green_sd.gif" /></td> <td align="left" valign="top"><h2 style="MARGIN-TOP: 0px; FONT-FAMILY: Arial; MARGIN-BOTTOM: 0px; COLOR: #404040; MARGIN-LEFT: 20px; FONT-SIZE: 170%"> <a href="">Writing Services</a> </h2></td> </tr> </tbody> </table> <table border="0" cellspacing="0" cellpadding="0" style="position:absolute; top: 78px;"> <tbody> <tr> <td width="5"></td> <td><ul style="MARGIN-TOP: 4px; MARGIN-BOTTOM: 15px"> <li> Essay</li> <li> Thesis </li> <li>Dissertation </li> <li> Book Summary </li> <li> Book Review </li> <li> Case Study </li> <li> Admission Essay </li> <li> Term Paper </li> </ul></td> </tr> </tbody> <tbody> <tr> <td valign="top"><img style="MARGIN-TOP: 8px; MARGIN-LEFT: 8px; MARGIN-RIGHT: 0px" alt="Tutorials" src="Rounded Border/icon_green_sd.gif" /></td> <td align="left"><h2 style="MARGIN-TOP: 0px; FONT-FAMILY: Arial; MARGIN-BOTTOM: 0px; COLOR: #404040; MARGIN-LEFT: 20px; FONT-SIZE: 170%"> <a href="">Application Services</a> </h2></td> </tr> </tbody> </table> <table border="0" cellspacing="0" cellpadding="0" style="position:absolute; top: 313px;"> <tbody> <tr> <td width="5"></td> <td><ul style="MARGIN-TOP: 4px; MARGIN-BOTTOM: 15px"> <li> Personal Statement </li> <li> Scholarship Essay </li> <li> Editing </li> </ul></td> </tr> </tbody> <tbody> <tr> <td valign="top"><img style="MARGIN-TOP: 8px; MARGIN-LEFT: 8px; MARGIN-RIGHT: 0px" alt="Tutorials" src="Rounded Border/icon_green_sd.gif" /></td> <td align="left"><h2 style="MARGIN-TOP: 0px; FONT-FAMILY: Arial; MARGIN-BOTTOM: 0px; COLOR: #404040; MARGIN-LEFT: 20px; FONT-SIZE: 170%"> <a href="">Editing Services</a> </h2></td> </tr> </tbody> </table> <table border="0" cellspacing="0" cellpadding="0" style="position:absolute; top: 492px;"> <tbody> <tr> <td width="5"></td> <td><ul style="MARGIN-TOP: 4px; MARGIN-BOTTOM: 15px"> <li> Formatting </li> <li> Editing </li> </ul></td> </tr> </tbody> <tbody> <tr> <td valign="top"><img style="MARGIN-TOP: 8px; MARGIN-LEFT: 8px; MARGIN-RIGHT: 0px" alt="Tutorials" src="Rounded Border/icon_green_sd.gif" /></td> <td align="left"><h2 style="MARGIN-TOP: 0px; FONT-FAMILY: Arial; MARGIN-BOTTOM: 0px; COLOR: #404040; MARGIN-LEFT: 20px; FONT-SIZE: 170%"> <a href="">Citation </a></h2> <h2 style="MARGIN-TOP: 0px; FONT-FAMILY: Arial; MARGIN-BOTTOM: 0px; COLOR: #404040; MARGIN-LEFT: 20px; FONT-SIZE: 170%"><a href="">Style</a> </h2></td> </tr> </tbody> </table> <table border="0" cellspacing="0" cellpadding="0" style="position:absolute; top: 614px; left: 11px;"> <tbody> <tr> <td width="5" style="position:absolute"> </td> <td width="4"><ul style="MARGIN-TOP: 4px; MARGIN-BOTTOM: 15px"> <li>Harvard </li> <li> MLA</li> <li> Chicago/Turabian </li> <li> APA </li> <li> Oxford </li> </ul></td> </tr> </tbody> </table></td> <td style="BACKGROUND-IMAGE: url(Rounded Border/bubblecorner3.gif); BACKGROUND-REPEAT: no-repeat; height: 940; BACKGROUND-POSITION: 50% bottom"></td> </tr> </tbody> </table> </head> <body onLoad="MM_preloadImages('L4.JPG','Education_Web500.jpg')"> <div id="Layer7" style="position:absolute; width:137px; height:158px; z-index:7; left: 826px; top: 823px;"> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td><a href="compare us.htm" target="_top" onClick="MM_nbGroup('down','group1','Education','L4.JPG',1)" onMouseOver="MM_nbGroup('over','Education','Education_Web500.jpg','L4.JPG',1)" onMouseOut="MM_nbGroup('out')"><img src="Education.jpg" alt="hello" name="Education" width="136" height="136" border="0" onload=""></a></td> </tr> </table> </div> <p ><font face="Times New Roman, Times, serif" size="+2"> Change Password </font></p> <b> Please Enter new Password</b> <br> <table width="431" border="1" bgcolor="#CCCCCC" align="center"> <tr> <td width="211" height="33"> Old Password</td> <td width="204"><form name="form1" method="post" action=""> <label> <input type="text" name="old_password" id="old_password" width="204"> </label> </form></td> </tr> <tr> <td height="36"> New Password</td> <td><input type="text" name="new_password" id="new_password" width="204"></td> </tr> <tr> <td height="34"> Confirm New Password</td> <td><input type="text" name="new_password2" id="new_password2" width="204"></td> </tr> <tr > <td height="44" colspan="2"><form name="form2" method="post" action=""> <input type="submit" name="Submit" id="Submit" value="Submit" align="center" style="width:84px"> </form></td> </tr> </table> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/178792-need-assistance-on-forget-ur-password-and-change-password/#findComment-943165 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.