/    Sign up×
Community /Pin to ProfileBookmark

Form help again :p

Is it possible to submit the same form to [B]more[/B] than one location?

Thanks

to post a comment
HTML

9 Comments(s)

Copy linkTweet thisAlerts:
@PeOfEoSep 13.2003 — 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.
Copy linkTweet thisAlerts:
@PeOfEoSep 13.2003 — 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 ?
Copy linkTweet thisAlerts:
@mg8authorSep 13.2003 — pyro-

<?php;

$to="[email protected]";

$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 [I]and[/I]

Thanks
Copy linkTweet thisAlerts:
@pyroSep 14.2003 — 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:

[code=php]<?php
$to="[email protected]";
$varA= $_POST['varA'];
$varB=$_POST['varB'];
$subject="$varA and $varB";
mail($to, $subject);
?>[/code]
Copy linkTweet thisAlerts:
@mg8authorSep 14.2003 — Still doesn't work:

This is what I now have:

<?php;

$headers = "MIME-Version: 1.0rn";

$headers .= "Content-type: text/html; charset=iso-8859-1rn";

$to="[email protected]";

$user= $_GET['user'];

$name= $_
GET['name'];

$subject="$user";

$message = "name = $name";

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

?>
Copy linkTweet thisAlerts:
@pyroSep 14.2003 — You still have the semi-colon after the opening <?PHP...

Try this:

[code=php]<?php
$headers = "MIME-Version: 1.0rn";
$headers .= "Content-type: text/html; charset=iso-8859-1rn";
$to="[email protected]";
$user= $_GET['user'];
$name= $_GET['name'];
$subject="$user";
$message = "name = $name";
mail($to, $subject, $message, $headers);
?>[/code]
Copy linkTweet thisAlerts:
@mg8authorSep 14.2003 — I took it out and it didn't help..
Copy linkTweet thisAlerts:
@pyroSep 14.2003 — The $_GET variables must not be set. This worked fine for me:

[code=php]<?php
$headers = "MIME-Version: 1.0rn";
$headers .= "Content-type: text/html; charset=iso-8859-1rn";
$to="[email protected]";
//$user= $_GET['user'];
//$name= $_GET['name'];
$user = "user";
$name = "name";
$subject="$user";
$message = "name = $name";
mail($to, $subject, $message, $headers);
?>[/code]
Copy linkTweet thisAlerts:
@mg8authorSep 14.2003 — Still didn't work.

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

Success!

Help @mg8 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...