peedee567 Posted October 27, 2007 Share Posted October 27, 2007 How do I get the following script to show all the details in the edit account form/template. Can any one help. YourAccount.php: <? require_once("conn.php"); require_once("includes.php"); require_once("access.php"); if(isset($_POST[s1])) { $q1 = "update class_members set password = '$_POST == $a1[p1]', FirstName = '$_POST[FirstName]', LastName = '$_POST[LastName]', Address = '$_POST[Address]', City = '$_POST[City]', State = '$_POST[state]', ZipCode = '$_POST[ZipCode]', Phone = '$_GET[phone]', email = '$_POST', news = '$_POST[news]', format = '$_POST[format]' where MemberID = '$_SESSION[MemberID]' "; mysql_query($q1); if(!mysql_error()) { $error = "<font face=verdana size=2 color=green>You account was updated!</font>"; } } //get the member info $q1 = "select * from class_members where MemberID = '$_SESSION[MemberID]' "; $r1 = mysql_query($q1) or die(mysql_error()); $a1 = mysql_fetch_array($r1); //check the Expire Date $after5_1 = mktime(0,0,0,date(m),date(d) + 5,date(Y)); $after5_2 = mktime(23,59,59,date(m),date(d) + 5,date(Y)); if(($after5_1 <= $a1[ExpDate]) && ($a1[ExpDate] <= $after5_2 )) { $ExpireMessage = "<br><br><center><a class=RedLink href=\"renew.php\">Renew Account</a></center><br>"; } if($a1[news] == 'y') { $ch1 = "checked"; } else { $ch2 = "checked"; } if($a1[format] == 'html') { $ch3 = "checked"; } else { $ch4 = "checked"; } //get the number of posted ads by this user $qp = "select count(*) from class_catalog where MemberID = '$_SESSION[MemberID]' "; $rp = mysql_query($qp) or die(mysql_error()); $ap = mysql_fetch_array($rp); $RemainingCredits = $a1[standardAds] + $a1[FeaturedAds] - $ap[0]; $PostedAds = $ap[0]; Editaccount.php: <br> <table align=center width=200 cellspacing=0 rules=rows border=0 bordercolor=black> <tr> <td width=150 align=right bgcolor=dddddd><b>Remaining Credits:</b></td> <td width=50 align=right bgcolor=dddddd><b> <?=$RemainingCredits?> </b></td> </tr> <tr> <td align=right>Posted Ads:</td> <td align=right> <?=$PostedAds?> </td> </tr> <tr> <td colspan="2" align=right><div align="center"><a href="AddAsset.php"><br> <strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Post New Ad</font></strong></a></div></td> </tr> </table> <?=$BuyMore?> <?=$ExpireMessage?> <form method=post action="YourAccount.php" name=RegForm onsubmit="return CheckProfile();"> <table align=center width=400> <caption align=center><font face=verdana size=2><b>Update Your Info or Do one of the above</b></font><br><?=$error?></caption> <tr> <td align=right>Username:</td> <td><input type=text name=Username value="<?$a1[username]?>"></td> </tr> <tr> <td align=right>Password:</td> <td><input type=password name=p1></td> </tr> <tr> <td align=right>Confirm Password:</td> <td><input type=password name=p2></td> </tr> <tr> <td align=right>First Name:</td> <td><input type=text name=FirstName value="<?=$a1[FirstName]?>"></td> </tr> <tr> <td align=right>Last Name:</td> <td><input type=text name=LastName value="<?=$a1[LastName]?>"></td> </tr> <tr> <td align=right>Address:</td> <td><input type=text name=Address value="<?=$a1[Address]?>"></td> </tr> <tr> <td align=right>City:</td> <td><input type=text name=City value="<?=$a1[City]?>"></td> </tr> <tr> <td align=right>State:</td> <td><input type=text name=State value="<?=$a1[state]?>"></td> </tr> <tr> <td align=right>ZIP/Postal Code:</td> <td><input type=text name=ZipCode value="<?=$a1[ZipCode]?>"></td> </tr> <tr> <td align=right>Phone:</td> <td><input type=text name=phone value="<?=$a1[Phone]?>"></td> </tr> <tr> <td align=right>Email:</td> <td><input type=text name=email value="<?=$a1?>"></td> </tr> <tr> <td align=right>Receive updates:</td> <td> <input type=radio name=news value="y" <?=$ch1?>>yes <input type=radio name=news value="n" <?=$ch2?>>no </td> </tr> <tr> <td align=right>Newsletter format:</td> <td> <input type=radio name=format value="html" <?=$ch3?>>html <input type=radio name=format value="plain" <?=$ch4?>>plain text </td> </tr> <tr> <td> </td> <td><input type=submit name=s1 value="Update"></td> </tr> </table> </form> <br><br> Link to comment https://forums.phpfreaks.com/topic/74967-editaccountphpyouraccountphp/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.