Jump to content


Photo

Unwanted slash with textbox


  • Please log in to reply
1 reply to this topic

#1 costello

costello
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 19 October 2006 - 12:08 AM

Hello,

Fairly new to php (3 days now!). I'm trying to write a little script that'll write to a file from a textbox. Links will be necessary in the textbox but when the file is made the output becomes this:

<a href=\"lalala.txt>lalala</a>

I need to get rid of that backslash but slipslashes() doesn't seem to work. Here's the code I have to write a new file:

<?php
chdir("info"); //change dir to info
$ourFileName = "$filename"; //get text input
$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");  //make file
fclose($ourFileHandle);


$fh = fopen($ourFileName, 'w') or die("can't open file");
$stringData = $sup; //get textbox input
fwrite($fh, $stringData); //write to file
fclose($fh);
?>

Any help would be great :D

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 19 October 2006 - 12:21 AM

stripslashes ok.

<?php
$str = "Is your name O\'reilly?";

// Outputs: Is your name O'reilly?
echo stripslashes($str);
?>  


Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users