PDA

View Full Version : Two Form Actions



adamFTW
02-12-2007, 10:29 PM
Is it possible to have two form actions?

I want the form action to be
"mailto:XX@XX?subject=XX", but I also want it to go to, ?action=submit

Is this possible?

Mentor
02-12-2007, 10:35 PM
Well with most modern browsers mailto wont do anything anyway, so eaiest solution would just be cut that bit out all together. If you want mail functiaonlty just add mailing functionalty in to the form handler thats picking it up in the action=submit page

adamFTW
02-12-2007, 10:40 PM
How can I make the form email everything to me?

Invent
02-12-2007, 10:44 PM
Send it to ?action=whatever and use the PHP function mail().

adamFTW
02-12-2007, 10:48 PM
Simon, would this work?


<?php

$to = "[email protected]";
$subject = "$name";

$message = "Name: $name<br>
Job: $job<br>
Why: $wwspy<br>
about: $aboutme<br>
Email: $email<br>
Age: $age<br>
IP: $ip";

$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";

mail($to,$subject,$message,$headers);
?>

adamFTW
02-12-2007, 10:57 PM
Nevermind, I got it.

Beau
03-12-2007, 05:18 AM
I wouldn't be using <br> for something a line break, people mightn't be using HTML capable email browsers. Just use \n.

rh4u
03-12-2007, 07:59 AM
Simon, would this work?


<?php
$message = $_POST['message'];
$wwspy = $_POST['wwspy'];
$job = $_POST['job'];
$aboutme = $_['aboutme'];
$email = $_['email'];
$age = $_POST['age'];
$ip = $_SERVER['REMOTE_ADDR'];
$to = "[email protected]";
$subject = "$name";
$message = "Name: $name<br>
Job: $job<br>
Why: $wwspy<br>
about: $aboutme<br>
Email: $email<br>
Age: $age<br>
IP: $ip";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";

mail($to,$subject,$message,$headers);
?>

try that :)

rh4u
04-12-2007, 09:21 PM
Edit: just noticed a code error ;)


<?php
$message = $_POST['message'];
$wwspy = $_POST['wwspy'];
$job = $_POST['job'];
$aboutme = $_POST['aboutme'];
$email = $_POST['email'];
$age = $_POST['age'];
$ip = $_SERVER['REMOTE_ADDR'];
$to = "[email protected]";
$subject = "$name";
$message = "Name: $name<br>
Job: $job<br>
Why: $wwspy<br>
about: $aboutme<br>
Email: $email<br>
Age: $age<br>
IP: $ip";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";

mail($to,$subject,$message,$headers);
?>

Want to hide these adverts? Register an account for free!