Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7596471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:55:29+00:00 2026-05-30T21:55:29+00:00

I have an HTML5 form set up like so: <form id=contact-form action=php/email.php> <fieldset> <ul

  • 0

I have an HTML5 form set up like so:

<form id="contact-form" action="php/email.php">
            <fieldset>
                <ul id="form">
                    <li>
                        <label for="name">Name:</label>
                        <input id="name" name="name" type="text" placeholder="First and Last Name" required />
                    </li>
                    <li>
                        <label for="email">Email:</label>
                        <input id="email" name="email" type="email" placeholder="Enter email address" />
                    </li>
                    <li>
                        <label for="message">Message:</label>
                        <textarea id="message" name="message" placeholder="Leave comments here..." required></textarea>
                    </li>
                </ul>

                <a id="back" href="index.html"><-- Home</a>
                <input type="submit" id="submit" value="Submit Form" class="button"/>
            </fieldset>
        </form>

and a small PHP script that sends me an email. I am wondering how to redirect the user to a Thank You page. Any suggestions?

Sorry, here is the PHP script:

<?php

$name = $_GET['name'];
$visitorEmail = $_GET['email'];
$message = $_GET['message'];
$email_from = "lesniakbj@jay.washjeff.edu";
$email_subject = "New Form Submission! - From: " + $visitorEmail;
$email_body = "Here is the message from $name: \n $message";    
$to = "lesniakbj@jay.washjeff.edu";
$headers = "From: $email_from \r \n";
$headers .= "Reply-To: $visitorEmail \r \n";    

mail($to, $email_subject, $email_body, $headers);

echo "Success! You've sent mail!";

?>

EDIT:

Ok, the problem that I have with this:

~/MyMobileApp/php/email.php

and all of my content:

~/MyMobileApp/

I want to redirect back to a local page, my index page that is located one folder above my php script. The problem with the header is that it can’t go above the directory that it is currently in; maybe I should add a thank you html page in that folder and redirect? Or is there a better way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T21:55:31+00:00Added an answer on May 30, 2026 at 9:55 pm

    After your php sends the email, add this php snippet:

    header("HTTP/1.1 303 See Other");
    header("Location: /thank-you.php");
    exit();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form set up like this in HTML: <input type=text name=data[type1][0] value=
I have a HTML form containing checkboxes in the form of .. <input type=checkbox
Hello I have a jsp with an html form. I set the content type
I've got this HTML form where I have multiple input elements: text, radio, and
I have a php script that handles a form input. For design reasons both
I have an HTML form - with PHP, I am sending the data of
I have a HTML form, and I have a Controller Action that accepts the
I have an HTML form generated by JSF which maps an input element to
I have an HTML form where the user can type in any number:5, 8,
I have an HTML form with sections laid out like this: I do want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.