romalong
11-07-2003, 12:15 AM
i got parse error when i try to use stripslashes:
<?
if (isset (stripslashes($text))){
mail("x@x.net", "",
"$text");
echo $text.'<br/> been mailed!';
}else{
print 'xxxx happens';
}
?>
how should i implement this function?
SDP2006
11-07-2003, 01:15 AM
You haven't declared or set $text to anything! Essentialy, $text is nowhere to be found!
Nightfire
11-07-2003, 01:36 AM
Just try
<?php
$text = stripslashes($_POST['text']);
if (isset ($text)){
mail("x@x.net", "", "$text");
echo $text.'<br/> been mailed!';
}else{
print 'xxxx happens';
}
?>
missing-score
11-07-2003, 07:15 AM
Originally posted by SDP2006
You haven't declared or set $text to anything! Essentialy, $text is nowhere to be found!
you can assume that $text is set somewhere else.
what you cant do however, is test for if stripslashes($text) is set, because even if $text isnt set, stripslashes($text) will still return an empty string (a set value)
$text = stripslashes($text);
if (isset ($text)){
mail("x@x.net", "", "$text");
echo $text.'<br/> been mailed!';
}else{
print 'xxxx happens';
}
hope this helps you out
missing-score
11-07-2003, 07:15 AM
ok, sorry, i dont know how i missed nightfires response. :o