Jump to content

redirect page


khujo56

Recommended Posts

Hi Guys

 

Need help trying to figure out why it will not redirect to the assigned page.

it says that info has been sent to assigned e-mail after the submit button has been pressed, but does not redirect to the page. below is the code.

 

<?php

if(isset($_POST['name']) && empty($_POST['name']))

{

    $error[] = "Post your name";

}

if(isset($_POST['email']) && empty($_POST['email']))

{

    $error[] = "Post your name";

}

if(isset($_POST['message']) && empty($_POST['message']))

{

    $error[] = "Post your name";

}

if(is_array($error))

{

    echo("errors:<br>");

    foreach($error as $x => $i)

    {

        echo("- ".$i."<br>");

    }

}

else

{

    $to = "email@here.com";

    $subject = "subject";

    $message = $_POST['message'];

    $name = $_POST['name'];

    $from = $_POST['email'];

    mail($to, $subject, $message, "From: $name<$from>");

   

    echo("<script>alert(\"Thanks!\nE-mail has been sent!\");</script>");

   

    $url = "www.iheartvacation.com.";

    header("Location: $url");

}

?>

Link to comment
Share on other sites

i fixed there error but now i get this error when i click submit

 

Warning: Cannot modify header information - headers already sent by (output started at /home/content/j/n/r/jnr1975/html/mailer.php:31) in /home/content/j/n/r/jnr1975/html/mailer.php on line 34

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.