phakebrill Posted August 18, 2008 Share Posted August 18, 2008 Hi everyone, I have a problem with a login script that I'm currently using. When I navigate to the page on my website, the email and password fields display the following: <br /> I apologise in advance because I'm a total newbie at PHP and MySQL. Hopefully someone can help me? I have also had to suppress an error message I was receiving which you will see from the code snippet I have pasted below. Not sure why I'm having to do this but I know it suppresses the error :-\ I can still log in with the correct email and password, but I would rather the <br /> tags not be on show in the boxes. I'm using Dreamweaver CS3 on my Mac. Hope someone can help me. <?php //login.php require_once("databaseauth.php"); if (@$_POST["submit"]) { // @ supressing error $strEmail = $_POST["strEmail"]; $strPassword = $_POST["strPassword"]; $dbMemberRecords = mysql_query("SELECT * FROM members WHERE Email='$strEmail' AND Password='$strPassword'", $dbLocalhost) or die("Problem reading table: " . mysql_error()); $intMemberCount = mysql_num_rows($dbMemberRecords); if ($intMemberCount > 0) { $arrMemberRecords = mysql_fetch_array($dbMemberRecords); session_start(); $_SESSION["Id"] = $arrMemberRecords["Id"]; header("location: calendar.php"); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <!-- DW6 --> <head> <!-- Copyright 2005 Macromedia, Inc. All rights reserved. --> <title>SU Calendar System</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" href="mm_travel2.css" type="text/css" /> <script type="text/javascript"> //--------------- LOCALIZEABLE GLOBALS --------------- var d=new Date(); var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December"); //Ensure correct for language. English is "January 1, 2004" var TODAY = monthname[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear(); //--------------- END LOCALIZEABLE --------------- </script> <style type="text/css"> <!-- .style1 {color: #FFFFFF} .style2 {color: #666666; } .style4 {color: #66FF33} a:link { color: #093B6D; } a:visited { color: #093B6D; } --> </style> </head> <body bgcolor="#C0DFFD"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr bgcolor="#3366CC"> <td colspan="2" rowspan="2" bgcolor="#003A6B"><img src="logo.png" alt="sulogo" width="211" height="99" /></td> <td width="85%" height="63" align="center" valign="bottom" bgcolor="#003A6B" class="style1" id="logo">Sunderland University Calendar System</td> <td width="0%" bgcolor="#003A6B"> </td> </tr> <tr bgcolor="#3366CC"> <td height="64" align="center" valign="top" bgcolor="#003A6B" class="style2" id="tagline">Wasting your time since 1979...</td> <td bgcolor="#003A6B"> </td> </tr> <tr> <td colspan="4" bgcolor="#003366"><img src="mm_spacer.gif" alt="" width="1" height="1" border="0" /></td> </tr> <tr bgcolor="#CCFF99"> <td width="4%" bgcolor="#FFFFFF"> </td> <td height="25" colspan="3" bgcolor="#FFFFFF" id="dateformat"><script type="text/javascript"> document.write(TODAY); </script> <a href="index.html">home</a> | <a href="login.php">login</a> |</td> </tr> <tr> <td colspan="4" bgcolor="#003366"><img src="mm_spacer.gif" alt="" width="1" height="1" border="0" /></td> </tr> <tr> <td> </td> <td colspan="2" valign="top"> <br> <br> <table border="0" cellspacing="0" cellpadding="2" width="500"> <tr> <td class="pageName">login</td> </tr> <tr> <td class="bodyText"><p>Welcome to the Sunderland University staff calendar login. In order to gain access to the SU Calendar System you will need to use the login form below. Please use your email address and password. If you have any problems please contact me using the link below.</p> <p>Thank you.</p> <form action='<?php echo $_SERVER["PHP_SELF"] ?>' method='post'> <p><label for="strEmail">Email: </label> <input type='text' name='strEmail' value='<?php echo $_POST["strEmail"] ?>' id='strEmail'/></p> <p><label for="strPassword">Password: </label> <input type='text' name='strPassword' value='<?php echo $_POST["strPassword"] ?>' id='strPassword'/></p> <p><input type='submit' name='submit'/></p> </form> <p> </p></td> </tr> </table> </td> <td> </td> </tr> <tr> <td> </td> <td width="11%"><span class="bodyText">© 2008 brill <span class="style4"><a href="#" id="rw_email_contact">Contact Me</a> <script type="text/javascript">var _rwObsfuscatedHref0 = "mai";var _rwObsfuscatedHref1 = "lto";var _rwObsfuscatedHref2 = ":j.";var _rwObsfuscatedHref3 = "gil";var _rwObsfuscatedHref4 = "ber";var _rwObsfuscatedHref5 = "t-1";var _rwObsfuscatedHref6 = "@su";var _rwObsfuscatedHref7 = "nde";var _rwObsfuscatedHref8 = "rla";var _rwObsfuscatedHref9 = "nd.";var _rwObsfuscatedHref10 = "ac.";var _rwObsfuscatedHref11 = "uk";var _rwObsfuscatedHref = _rwObsfuscatedHref0+_rwObsfuscatedHref1+_rwObsfuscatedHref2+_rwObsfuscatedHref3+_rwObsfuscatedHref4+_rwObsfuscatedHref5+_rwObsfuscatedHref6+_rwObsfuscatedHref7+_rwObsfuscatedHref8+_rwObsfuscatedHref9+_rwObsfuscatedHref10+_rwObsfuscatedHref11; document.getElementById('rw_email_contact').href = _rwObsfuscatedHref;</script> </span></span></td> <td> </td> <td> </td> </tr> </table> <div id="footer"><!-- Start Footer --> <p class="bodyText"> </p> </div> <!-- End Footer --> </body> </html> Link to comment https://forums.phpfreaks.com/topic/120160-solved-problem-with-a-n00bs-login-script/ Share on other sites More sharing options...
phakebrill Posted August 18, 2008 Author Share Posted August 18, 2008 Attached a screenshot in case it might help illustrate what's going on. Thanks again. [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/120160-solved-problem-with-a-n00bs-login-script/#findComment-619268 Share on other sites More sharing options...
phakebrill Posted August 18, 2008 Author Share Posted August 18, 2008 Zavaboy gave me a helping hand on the irc channel. I am so grateful for his technical genius!! He saved me a lot of time and I still have a little hair left for the next part of my project... Adding a calendar. OMG... Anyway, thanks again Zavaboy! The solution to anyone who was interested was excessive error/notice reporting on my university server. Zavaboy advised that I should suppress the warnings with: error_reporting(E_ALL ^ E_NOTICE); Link to comment https://forums.phpfreaks.com/topic/120160-solved-problem-with-a-n00bs-login-script/#findComment-619365 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.