Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Contact Form Submit

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #25188
    infocentre
    Member

    Hello! i am a complete novice with PHP.. a lot of cut and pasting goes down!

    I can sort out a contact form, but they all refresh the entire screen when the ‘contact.php’ file is run on the submit button.

    What i want is just the form area to refresh as ‘message sent’. is this possible?

    The reason i ask is because i am putting together a band site, on which there will be a ‘subscribe to newsletter’ section which simply collects their email address and then forwards to my email address to be storred.. this is the simplest way i could think of, but if you have other ideas, please throw them out there!

    Thanks chaps
    Alex

    #59284
    TheDoc
    Member

    You’ll want to put something like this in:

    Code:
    $result = “../contact-success.php”;
    $error = “../contact-error.php”;

    if(mail($to, $subject, $message, $headers))
    {
    header(“Location: ” . $result);
    }
    else
    {
    header(“Location: ” . $error);
    }
    }

    #59289

    You want to use the jQuery Form plugin http://malsup.com/jquery/form/#getting-started

    Basically you add a script to your page as follows:

    Code:

    Where #myform is the id of your form and #mydiv is the id of the div you want to contain the message.

    #59188
    infocentre
    Member

    very useful! thanks guys

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Back End’ is closed to new topics and replies.