I am looking to have a simple form to collect info from vistors and once they fill out the info and click the button, I want their info to go to my email or contact management software and also once the click the button I want them to be directed to an external page. You're help would be much appreciated. Thanks in advance.
You can add the php script separately in an external php file, ex. "script.php, then, at the action attribute of the form put action="script.php".
On click on the submit button will send data to, and open that file
I'm sorry, I'm totally clueless about this stuff. Here is the code that has my form complete. Please add the php stuff so I can understand please. Thanks.
Could you at least show me how it might look? Then I will try it. Because I don't know the slightest thing about the php code. And the external page I want to send them to is http://derek.talkfusionservice.com. I saw you know how to put this in as a php so maybe if you could just show me how it might look, I will mess around with it and try it.
If the external page isn't on your server, and you don't have access to the code of that page, is more complicated. Something with cURL , but i don't know how.
I think I almost have it. I have the php script for the mail function done but how do I make it go to the external webpage. I have an action prompt inside my normal html coding that does it. Am I able to have 2 action prompts inside html?
Here is what I have so far for my HTML, and then lower I will include the PHP:
although the php script the nobody@example should be my email address. And what should the headers be if it would be sent from whoever is filling out the form.
Hi I don't really get what you mean, but if you want your viewer to redirect to whatever external page, you can use the PHP HEADER function to redirect you to external page after the mail has been successful sent.. something like this
<FORM ACTION="http://derek.talkfusionservice.com"
METHOD="POST"><center>Your Name</center><span></span><center><INPUT NAME="FName" /></center><center>Email Address</center><span></span><center><input type="text" /></center><center><input type=Submit value="GO" /></center></form>
<?php
$to = 'nobody@example.com';
$subject = 'Talk Fusion Info';
$message = 'I would like information on the products';
$headers = 'From: derek.dimmick@gmail.com' . "\r\n" .
'Reply-To: derek.dimmick@gmail.com' . "\r\n" .
if(mail($to, $subject, $message, $headers)) // this means that you successfully send the email
{
header('Location: http://www.myExternalPage_blah_blah_blah_what_ever');
}else{
// THER IS AN ERROR IN SENDING YOUR EMAIL
}
hope it will help you, but if you still encountering an error try to use free php mail library I suggest to use PHPMailer here's the site http://phpmailer.worxware.com/
Bookmarks