Jump to content

Kieran_Smith

New Members
  • Posts

    3
  • Joined

  • Last visited

Kieran_Smith's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Im having issues with logging out of a my website. I have successfully managed to log in. I am using sessions to do it and have been using session_unregister, which I believe is not depreciated. I have tried using unset but I am now getting the error Parse error: syntax error, unexpected '"authenticatedUser"' (T_CONSTANT_ENCAPSED_STRING) in C:\wamp\www\ShreddedNutrition\HTML\Logout.php on line 8 this is my log out code <?php session_start(); $appUsername = $_SESSION["authenticatedUser"]; $_SESSION["message"] = "You Have Logged out"; unset("authenticatedUser"); // Relocate back to the login page header("Location: Login.php"); //session_destroy(); ?> and this is to log in <?php include 'db.inc'; session_start(); $UserEmail =$_POST["EmailAddress"]; $UserPassword =$_POST["Password"]; $query = "SELECT * FROM members WHERE EmailAddress = '$UserEmail' AND password = '$UserPassword' "; $connection = mysql_connect($hostname, $username, $password) or die ("Unable to connect!"); mysql_select_db($databaseName) or die ("Unable to select database!"); $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); // see if any rows were returned if (mysql_num_rows($result) > 0) { $_SESSION["authenticatedUser"] = $UserEmail; // Relocate to the logged-in page header("Location: Index.php"); } else { $_SESSION["message"] = "Could not connect log in as $UserEmail " ; header("Location: Login.php"); } mysql_free_result($result); mysql_close($connection); ?>
  2. This is great buddy thank you very much ill give it a shot. May have a few questions for you soon tho lol
  3. Hi I followed a tutorial on YouTube and created a php contact form. With the form fully filled in it will redirect to a thank you message but i don't receive the email and i get this message "Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\TokyoCorner\HTML\Contact_Us.php on line 51" A solution or any ideas would be most helpful Thank you
×
×
  • 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.