Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: stripslashes

  1. #1
    New Coder
    Join Date
    Jul 2003
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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?

  • #2
    Regular Coder
    Join Date
    May 2003
    Location
    34 54' N 82 13' W
    Posts
    996
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You haven't declared or set $text to anything! Essentialy, $text is nowhere to be found!
    Last edited by SDP2006; 11-07-2003 at 01:18 AM.
    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!

  • #3
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    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';
    }
    ?>

  • #4
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #5
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok, sorry, i dont know how i missed nightfires response.

  • #6
    New Coder
    Join Date
    Jul 2003
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts
    lotsa thanx!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •