Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-07-2003, 12:15 AM   PM User | #1
romalong
New Coder

 
Join Date: Jul 2003
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
romalong is an unknown quantity at this point
stripslashes

i got parse error when i try to use stripslashes:

PHP Code:
<?
if (isset (stripslashes($text))){
     
mail("x@x.net"""

"$text");
      echo 
$text.'<br/> been mailed!';
}else{
print 
'xxxx happens';
}
?>
how should i implement this function?
romalong is offline   Reply With Quote
Old 11-07-2003, 01:15 AM   PM User | #2
SDP2006
Regular Coder

 
Join Date: May 2003
Location: 34° 54' N 82° 13' W
Posts: 996
Thanks: 0
Thanked 0 Times in 0 Posts
SDP2006 is an unknown quantity at this point
You haven't declared or set $text to anything! Essentialy, $text is nowhere to be found!
__________________
Stevie Peele
Neverside IRC Network - irc.veonex.net | tc.tutorialnetwork.org
#dev - any programming,etc. question
#design - design discussion and critque
#central - general chat
Come join us!

Last edited by SDP2006; 11-07-2003 at 01:18 AM..
SDP2006 is offline   Reply With Quote
Old 11-07-2003, 01:36 AM   PM User | #3
Nightfire
Senior Coder

 
Nightfire's Avatar
 
Join Date: Jun 2002
Posts: 4,266
Thanks: 6
Thanked 48 Times in 48 Posts
Nightfire is on a distinguished road
Just try

PHP Code:
<?php
$text 
stripslashes($_POST['text']);
if (isset (
$text)){
     
mail("x@x.net""""$text");
     echo 
$text.'<br/> been mailed!';
}else{
     print 
'xxxx happens';
}
?>
__________________
Blue Panda
Website Design | 1 Pound Ads | 'ow much? | Coding Geeks
Nightfire is offline   Reply With Quote
Old 11-07-2003, 07:15 AM   PM User | #4
missing-score
Senior Coder


 
missing-score's Avatar
 
Join Date: Jan 2003
Location: UK
Posts: 2,194
Thanks: 0
Thanked 0 Times in 0 Posts
missing-score is on a distinguished road
Quote:
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)

PHP Code:

$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 is offline   Reply With Quote
Old 11-07-2003, 07:15 AM   PM User | #5
missing-score
Senior Coder


 
missing-score's Avatar
 
Join Date: Jan 2003
Location: UK
Posts: 2,194
Thanks: 0
Thanked 0 Times in 0 Posts
missing-score is on a distinguished road
ok, sorry, i dont know how i missed nightfires response.
missing-score is offline   Reply With Quote
Old 11-07-2003, 08:43 AM   PM User | #6
romalong
New Coder

 
Join Date: Jul 2003
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
romalong is an unknown quantity at this point
lotsa thanx!
romalong is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:02 AM.


Advertisement
Log in to turn off these ads.