Jump to content

tifoso

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Everything posted by tifoso

  1. Each of my web pages has the following: <?php require_once('auth.php'); ?> The auth.php looks like: <?php //Start session session_start(); //Check whether the session variable SESS_MEMBER_ID is present or not if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID']) == '')) { header("location: access-denied.php"); exit(); } ?> It does work as it should - access-denied message appears when the session expired after some longer time or when someone tries to access a password protected webpages without logging in. HOWEVER, I have added an .xml file to the server which now includes all the menu buttons like 'home', 'contact us' etc. After doing this, I've noticed that every time I open a web browser, especially IE and click one of the menu buttons after logging in, I get an instant message saying your session has expired etc. When I login again, it works fine until… until I close the web browser. After re-opening the web browser, logging in again and clicking on the menu buttons, the problem re-occurs. Does anyone have an idea how this can be fixed? Thank you!
  2. I'll have a go with saving a message in a variable later on today. I do understand that header() should be before everything that is sent to the client, but when I do so, then the confirmation.php is displayed automatically when I go to email-form.php :/
  3. If I move it higher than the confirmation.php is displayed automatically when I go to email-form.php so I don't even have a chance to fill in the email form as it takes me staright to confirmation.php which should be displayed when I press "Submit" button on the email form.
  4. So I moved the header() above the content that is displated in the web browser but it did not help :/ <?php error_reporting(6143); require_once('recaptchalib.php'); $publickey = "6Ldmbr8SAAAAAGT17oCjkB8Y60kSqvq_0w7APAJp"; $privatekey = "6Ldmbr8SAAAAAMY5lEl-7LnkWCovoFa9G7Vl3_kA"; isset($_POST['Email']) ? $Email = $_POST['Email'] : $Email = ""; isset($_POST['name']) ? $name = $_POST['name'] : $name = ""; isset($_POST['surname']) ? $surname = $_POST['surname'] : $surname = ""; ?> <meta http-equiv="content-type" content="text/html; charset=iso-8859-2"> <body bgcolor="#000000"></body> <link href="loginmodule.css" rel="stylesheet" type="text/css" /> <?php if (isset($_POST['Submit'])) { //Validate form $errormessage = ""; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if ($name == '') { $errormessage .= "<li>Please provide your name.</li> ";} if ($surname == '') { $errormessage .= "<li>Please provide your surname.</li>";} if ($Email == '') { $errormessage .= "<li>What is your e-mail address?</li>";} if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $Email)){ $errormessage = $errormessage . "<li>This is not a valid email address! </li>";} if (!$resp->is_valid) { // What happens when the CAPTCHA was entered incorrectly $errormessage .= "<li>Please rewrite captcha characters</li>"; } echo "</ul></p>"; //If errors, return error message(s) and form if ($errormessage != "") { ?> <?php header ("Location: http://www.google.co.uk"); exit; ?> <span class="link1"><a href="index.php">back to home page/a></span> <img src="images/clack.JPG"> <table align="center"> <p align="center" class="err_bold">correct the following errors:</p> <span class="text_err"><ul><?=$errormessage?></span> </table> <?php include("email-form.php"); } else { //If good, mail to DL $email_subject = "Hello, you have a new message"; $email_headers = "From: $name [$Email] \r\n"; $to = "blablabla@hotmail.com"; $message_content = "----------------------------------------------------------------------------------\n". " Hello\n". "name: $name\n". "surname: $surname\n". "E-mail: $Email\n". "-----------------------------------------------------------------------------------\n\n"; //Email message to Requestor if (mail($to, $email_subject, $message_content, $email_headers)) { //Display Sent Confirmation (Successful or NOT!) ?> <?php } } } else { ?> <span class="link1"><a href="index.php">back to home page</a></span> <img src="images/clack.JPG"><br> <p class="err" align="center">Please fill the form below<br/></p> <?php include("email-form.php");?> <?php };
  5. Here is the webpage.php which executes data entered in the email form. I want to display a webpage which would confirm that the email has been sent but the header redirect does not work. An email gets sent but a blank page is displayed instead of confirmation. Can anyone help? this is urgent <?php error_reporting(6143); require_once('recaptchalib.php'); $publickey = "6Ldmbr8SAAAAAGT17oCjkB8Y60kSqvq_0w7APAJp"; $privatekey = "6Ldmbr8SAAAAAMY5lEl-7LnkWCovoFa9G7Vl3_kA"; isset($_POST['Email']) ? $Email = $_POST['Email'] : $Email = ""; isset($_POST['name']) ? $name = $_POST['name'] : $name = ""; isset($_POST['surname']) ? $surname = $_POST['surname'] : $surname = ""; ?> <meta http-equiv="content-type" content="text/html; charset=iso-8859-2"> <body bgcolor="#000000"></body> <link href="loginmodule.css" rel="stylesheet" type="text/css" /> <?php if (isset($_POST['Submit'])) { //Validate form $errormessage = ""; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if ($name == '') { $errormessage .= "<li>Please provide your name.</li> ";} if ($surname == '') { $errormessage .= "<li>Please provide your surname.</li>";} if ($Email == '') { $errormessage .= "<li>What is your e-mail address?</li>";} if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $Email)){ $errormessage = $errormessage . "<li>This is not a valid email address! </li>";} if (!$resp->is_valid) { // What happens when the CAPTCHA was entered incorrectly $errormessage .= "<li>Please rewrite captcha characters</li>"; } echo "</ul></p>"; //If errors, return error message(s) and form if ($errormessage != "") { ?> <span class="link1"><a href="index.php">back to home page/a></span> <img src="images/clack.JPG"> <table align="center"> <p align="center" class="err_bold">correct the following errors:</p> <span class="text_err"><ul><?=$errormessage?></span> </table> <?php include("email-form.php"); } else { //If good, mail to DL $email_subject = "Hello, you have a new message"; $email_headers = "From: $name [$Email] \r\n"; $to = "blablabla@hotmail.com"; $message_content = "----------------------------------------------------------------------------------\n". " Hello\n". "name: $name\n". "surname: $surname\n". "E-mail: $Email\n". "-----------------------------------------------------------------------------------\n\n"; //Email message to Requestor if (mail($to, $email_subject, $message_content, $email_headers)) { //Display Sent Confirmation (Successful or NOT!) ?> <?php header ("Location: http://www.google.co.uk"); exit; ?> <?php } } } else { ?> <span class="link1"><a href="index.php">back to home page</a></span> <img src="images/clack.JPG"><br> <p class="err" align="center">Please fill the form below<br/></p> <?php include("email-form.php");?> <?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.