Jump to content

unknown1

Members
  • Posts

    128
  • Joined

  • Last visited

Everything posted by unknown1

  1. Here is an example //select info from database $sql = "SELECT * FROM tableName some condition "; // error if you have a problem $resultSet = mysql_query($sql) or die (mysql_error()); // Check if info exists in database if(mysql_num_rows($resultSet) > 0) { // if selected info exists while($row = mysql_fetch_array($resultSet)) { echo "$row[fieldName]"; } Hope it helps
  2. Hello boys and girls I'm having an issue with the following code working in internet explorer. It's a jquery sliding div that contains login form... it works 100% fine in firefox but only works in internet explorer if I take the form out of the sliding div. Not 100% sure whats going on... is it a session issue or something else but the code works fine if I put it in another page without the sliding div. If anyone has any ideas of what the problem maybe it sure would be helpful. Thanks in advance!!! Login form: <div id="loginForm"><br /> <form action="index.php" method="POST" name="frmLogin"> <div style="float:left; "> E-mail: <input name="email" type="text" size="24"> Password: <input name="password" type="password" size="12" > <input name='submit' type=IMAGE id='Login' value='Login' align='right' src='images/login.gif' alt='Login' value='1' /> </div> <br /><br /><small><a href="forgot-password.html">Forgot password?</a></small> <input type="submit" style="display:none; "> </form></div> <div id="login" style="display:none; "> <div class="exit"><a href="#" onClick="Effect.SlideUp('login', {duration:0.2}); return false;">Exit</a></div> The php code: <?php if($_POST['submit']){ // Get user data $email = $_POST['email']; $password = $_POST['password']; // Strip slashes from data before submited $email = stripslashes($email); $password = stripslashes($password); // Strip tags from data before submited $email = strip_tags($email); $password = strip_tags($password); // error message default value $errormsg = ""; // error messages if(!$email) $errormsg = $errormsg. "<br /> <br /> EMail <br />"; if(!$password) $errormsg = $errormsg. " Password <br />"; $sql = "SELECT * FROM user WHERE email = '" . $_POST['email'] . "' AND password = '" . $_POST['password'] . "'"; $result = mysql_query($sql); $numrows = mysql_num_rows($result); if($numrows == 1) { $row = mysql_fetch_assoc($result); session_register("USERNAME"); session_register("USERID"); session_register("EMAIL"); session_register("id"); session_register("PASSWORD"); // Set Session variables $_SESSION['USERNAME'] = $row['Fname']; $_SESSION['USERID'] = $row['idUser']; $_SESSION['id'] = $row['idUser']; $_SESSION['EMAIL'] = $row['email']; $_SESSION['idUserType'] = $row['idUserType']; if($_POST['stay']==1) { // Set Cookie variables setcookie("cookemail", $_SESSION['USERID'], time()+60*60*24*100, "/"); setcookie("cookpass", $_SESSION['PASSWORD'], time()+60*60*24*100, "/"); } header( 'Location: index.php' ) ; } } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.