Hello there,

I am wanting to get a script I found on the net to redirect after the user has submitted it to x page. At the moment it will submit and give a data sent message but I really dont want that and would prefer automatic redirection.

Here is the code from the mailer:

<?php
if(isset($_POST['submit'])) {

$to = "admin@oursite.com";
$subject = "Application for Moderator";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$message = $_POST['message'];

$body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message";

echo "Data has been submitted to $to!";
mail($to, $subject, $body);

} else {

echo "blarg!";

}
?>

Thank you for all help given 🙂

    Change this line:

    echo "Data has been submitted to $to!"; 
    

    into:

    header("Location: another_file.html");
    

      Thanks very much. I had been told to use that line just couldnt figure out where it was meant to be with people saying place it at the beginning after <?php

      They were also saying make sure it is before any echos.

      Thanks

        Write a Reply...