- This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- The forum ‘Back End’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
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
You’ll want to put something like this in:
if(mail($to, $subject, $message, $headers))
{
header(“Location: ” . $result);
}
else
{
header(“Location: ” . $error);
}
}
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:
Where #myform is the id of your form and #mydiv is the id of the div you want to contain the message.
very useful! thanks guys