Russia Posted December 6, 2009 Share Posted December 6, 2009 Hello, I currently have this page: http://rune-host.info/accounts-forgot2.php When you load it, its a fan site, the page is for a forgotten password script and you will see a form. Type in any email address in the correct (ex: your@site.com) format and you will see that the page gets cut off once you submit. You will notice the footer of the page is cut off. Pictures if you don't want to load the page: Front page. loads perfectly. ERROR PAGE: see the missing footer: --- SOURCE: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Language" content="en, English"> <meta name="keywords" content="Runescape, Jagex, free, games, online, multiplayer, magic, spells, java, MMORPG, MPORPG, gaming"> <meta name="description" content="RuneScape is a massive 3d multiplayer adventure, with monsters to kill, quests to complete, and treasure to win. You control your own character who will improve and become more powerful the more you play."> <title>RuneScape - the massive online adventure game by Jagex Games Studio</title> <style type="text/css">/*\*/@import url(css/global-17.css);/**/</style> <script type="text/javascript"> function getPages(loc) { if (loc=="top") { var item=document.myformtop; var toupdate=document.myformbottom; } else { var item=document.myformbottom; var toupdate=document.myformtop; } var pagetoget=parseInt(item.page.value); var numpages=parseInt(item.numpages.value); if (pagetoget<=numpages) item.submit(); else { try { item.page.value=item.currentpage.value; toupdate.page.value=item.currentpage.value; }catch(err){} } } </script> <style type="text/css">/*\*/@import url(css/news-2.css);/**/</style> </head> <body id="nav"> <a name="top"></a> <div id="scroll"> <div id="head"><div id="headBg"> <div id="headOrangeTop"></div> <img src="img/main/layout/head_image_mob.jpg" alt="RuneScape"> <div id="headImage"><a href="title.php" id="logo_select"></a> <div id="lang"> <a href="" title="English"><img src="img/main/layout/union_flag.png" alt="English"></a> <a href="#" title="Deutsch"><img src="img/main/layout/german_flag.png" alt="Deutsch"></a> <a href="#" title="Français"><img src="img/main/layout/french_flag.png" alt="Français"></a> <a href="#" title="Português (BR)"><img src="img/main/layout/brazilian_flag.png" alt="Português (BR)"></a> </div> <div id="sessionText"> You are logged in as <span id="accountName"> l8er </span> </div> </div> <div id="headOrangeBottom"></div> <div class="navigation"> <div class="location"> <b>Location: </b> <a href="accounts.php">Home</a> > <a href="accounts-settings.php">Settings</a> > Forgotten Password </div> </div> </div></div> <div id="content"> <div id="article"> <div class="sectionHeader"> <div class="left"> <div class="right"> <div class="plaque"> Forgotten Password </div> </div> </div> </div> <div class="section"> <div class="article"> <div class="topshadow"> <div class="bottombordershad"> <div class="leftshadow"> <div class="rightshadow"> <div class="leftcorner"> <div class="rightcorner"> <div class="bottomleftshad"> <div class="bottomrightshad"> <div class="pagepad"> <div class="centre" id="newsitemMenu"> <script type="text/javascript" language="Javascript"> <!-- //Simple Switch Image Bucket Inc. //Made By Bucket if (document.images) { button1 = new Image button2 = new Image button1.src = 'img/logout_off.gif' button2.src = 'img/logout_on.gif' } if (document.images) { button3 = new Image button4 = new Image button3.src = 'img/btl_off.gif' button4.src = 'img/btl_on.gif' } //--> </script> <img src="img/spacer.gif" alt="This is spacer.gif" height="37"> <hr> </div> <div class="newsJustify"> <?php // This is displayed if all the fields are not filled in $empty_fields_message = "<p>Please go back and complete all the fields in the form.</p>Click <a class=\"two\" href=\"javascript:history.go(-1)\">here</a> to go back"; // Convert to simple variables $email_address = $_POST['email_address']; if (!isset($_POST['email_address'])) { ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST"> <span style="float: left;"> Email Address: </span> <span style="float: right;"> <input size="40" class="only" style="border:solid 1px #675f39; padding:4px 2px; font-size:12px;" type="text" name="email_address"> </span> <br><br> <hr> <center> <input id="submit" class="submit-button" type="submit" value="Reset Password" > </center> </form> <?php } elseif (empty($email_address)) { echo $empty_fields_message; } else { require_once("inc/config.php"); $email_address = mysql_real_escape_string($email_address); $status = "OK"; $msg=""; //error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR); if (!stristr($email_address,"@") OR !stristr($email_address,".")) { $msg="<p>Your email address is not in the correct format.</p>Click <a class=\"two\" href=\"javascript:history.go(-1)\">here</a> to go back"; $status= "NOTOK"; } if($status=="OK") { $query = "SELECT email, username FROM admin WHERE admin.email = '$email_address'"; $st = mysql_query($query); $recs = mysql_num_rows($st); $row = mysql_fetch_object($st); $em = $row->email_address;// email is stored to a variable if ($recs == 0) { echo "<p>Sorry your address is not there in our database. Please try again.</p>Click <a class=\"two\" href=\"javascript:history.go(-1)\">here</a> to go back"; exit; } function makeRandomPassword() { $salt = "abchefghjkmnpqrstuvwxyz0123456789"; srand((double)microtime()*1000000); $i = 0; while ($i <= 7) { $num = rand() % 33; $tmp = substr($salt, $num, 1); $pass = $pass . $tmp; $i++; } return $pass; } $random_password = makeRandomPassword(); $db_password = md5($random_password); $sql = mysql_query("UPDATE admin SET password='$db_password' WHERE email='$email_address'"); $subject = "Your New Password"; $message = "Hello, you have chosen to reset your password. New Password: $random_password http://www.yoursite.com/login Once logged in you can change your password Thanks! Site admin This is an automated response, please do not reply!"; mail($email_address, $subject, $message, "From: yoursite.com Webmaster<admin@jyoursite.com>\n X-Mailer: PHP/" . phpversion()); echo "<p>Your new password has been send! Please check your email!</p>"; } else { echo $msg; } } ?> <hr> </div> <div class="clear"></div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <div id="footer"> <div class="contain"> <div class="footerdesc"> This website and its contents are copyright 1999 - 2009 Bucket Ltd<br> Use of this website is subject to our <a href="terms/terms.ws">Terms & Conditions</a> and <a href="privacy/privacy.ws">Privacy Policy</a>. </div> <a class="jagex.com" href="http://www.jagex.com" target="_blank"> <img src="img/main/layout/jagex2.png?5"> </a> </div> </div> </div> </body> </html> Quote Link to comment Share on other sites More sharing options...
haku Posted December 7, 2009 Share Posted December 7, 2009 Please post formatted HTML output only in the HTML section. PHP is irrelevant to HTML. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 7, 2009 Share Posted December 7, 2009 Why did you even start another thread for this same problem. It is not a HTML problem. Your logic on the page is incorrect and is not outputting the correct content when your code detects invalid user supplied input. Your existing thread where several people tried to help with the logic - http://www.phpfreaks.com/forums/index.php/topic,279665.0.html Until you fix the logic on the page to output what you want when you want it, your page won't work. That is the whole point of programming. Quote Link to comment Share on other sites More sharing options...
haku Posted December 7, 2009 Share Posted December 7, 2009 Well there's the solution. The footer isn't visible because it doesn't exist. Thread over. Quote Link to comment Share on other sites More sharing options...
Russia Posted December 8, 2009 Author Share Posted December 8, 2009 I have figured out that I had an error with the html not the actual PHP. Thank You All. Quote Link to comment Share on other sites More sharing options...
haku Posted December 8, 2009 Share Posted December 8, 2009 No you didn't. I saw your code on the other thread you started. It was a php issue. Quote Link to comment 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.