romalong
11-06-2003, 08:46 PM
just made a simple script that takes variable from form and supposed to mail some text, but it doesn't.
here it is:
<?
if (isset($text)){
mail("xxx@xxx.com", "mymail", "oh, greate! it works! $text");
echo "$text mailed";
}else{
print '**** happens';
}
?>
help me please to sort it out!
Nightfire
11-06-2003, 10:34 PM
<?
$text = $_POST['text'];
if (isset($text)){
mail("xxx@xxx.com", "mymail", "oh, greate! it works! $text");
echo "$text mailed";
}else{
print '**** happens';
}
?>
Try this, assuminmg you're getting the $text from a form submitted by POST
romalong
11-07-2003, 12:09 AM
thanx nightfire!
the problem wasn't with ascrip - my mail server was overloaded.
thank you!
missing-score
11-07-2003, 07:37 AM
bear in mind however, that it is much better to use $_POST['text'] rather than $text
romalong
11-07-2003, 05:52 PM
Originally posted by missing-score
bear in mind however, that it is much better to use $_POST['text'] rather than $text
could u make it clear 4 me?
missing-score
11-07-2003, 09:30 PM
ahh yes, sorry...
what i mean is, in nightfire's example:
<?
$text = $_POST['text'];
if (isset($text)){
mail("xxx@xxx.com", "mymail", "oh, greate! it works! $text");
echo "$text mailed";
}else{
print '**** happens';
}
?>
he uses $_POST['text']. As you said it was a server problem, i wanted to make it clear than when working with forms, nightfires example is the best way.
romalong
11-08-2003, 09:06 AM
$thanx! | $cheers, missing score!