Click to See Complete Forum and Search --> : Form help again :p


mg8
09-13-2003, 01:54 PM
Is it possible to submit the same form to more than one location?

Thanks

PeOfEo
09-13-2003, 02:01 PM
I would use a server side language for this, though it is possible It would just be better to use server side languages for forms. Try though when you are putting your email address in the form to put a ; in there and another email address and see what it does. It might work it might now, we will have to see.

PeOfEo
09-13-2003, 02:26 PM
I was betting the ; in the action would not work but it was worth a try anyway. Ok pyro this is for you because mg8 tells me that he is using a php form handler and I dont know what this is going to look like in php. Obviosuly a ; wont work :D

mg8
09-13-2003, 03:51 PM
pyro-

<?php;
$to="blah@yahoo.com";
$varA= $_POST['varA];
$varB=$_POST['varB'];
$subject="$varA and $varB";
mail($to, $subject);
?>

I get the email, but I don't have the variables included.

The user inputs data into text fields, in a form, and I used the $_post function to get those values and I want them sent to my email. When I get an email, all I get is and

Thanks

pyro
09-13-2003, 10:34 PM
I'm assuming the form has fields named varA and varB? Also, you shouldn't put a semi-colon after the opening <?PHP, and you forgot a straight quote around your first $_POST... Try this:

<?php
$to="blah@yahoo.com";
$varA= $_POST['varA'];
$varB=$_POST['varB'];
$subject="$varA and $varB";
mail($to, $subject);
?>

mg8
09-14-2003, 08:00 AM
Still doesn't work:

This is what I now have:

<?php;
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$to="meemail@yahoo.com";
$user= $_GET['user'];
$name= $_GET['name'];
$subject="$user";
$message = "name = $name";
mail($to, $subject, $message, $headers);
?>

pyro
09-14-2003, 08:37 AM
You still have the semi-colon after the opening <?PHP...

Try this:

<?php
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$to="meemail@yahoo.com";
$user= $_GET['user'];
$name= $_GET['name'];
$subject="$user";
$message = "name = $name";
mail($to, $subject, $message, $headers);
?>

mg8
09-14-2003, 09:02 AM
I took it out and it didn't help..

pyro
09-14-2003, 09:14 AM
The $_GET variables must not be set. This worked fine for me:

<?php
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$to="me@my.com";
//$user= $_GET['user'];
//$name= $_GET['name'];
$user = "user";
$name = "name";
$subject="$user";
$message = "name = $name";
mail($to, $subject, $message, $headers);
?>

mg8
09-14-2003, 09:35 AM
Still didn't work.

It's ok. Just forget about it. I don't really need it.