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 protected]";

    $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
https://forums.phpfreaks.com/topic/60135-redirect-page/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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