开发者

PHP post is appending extra " \" " Why is it so?

I am using

  <textarea id="content" name="content" style="开发者_JS百科width:0; height:0;">  
<?php  $content = file_get_contents($url);    ?> 
</textarea>

and i am posting this text area to a php file

$file = $_POST["content"];
echo $file;

The output that i am getting displayed Everything with an extra \"

All the images , all the references... Any solution for this ?


For a start, the code in the textarea won't actually output anything, since all it's doing is assigning the contents of $url to the $content variable. Try using echo to output it:

<?php echo file_get_contents($url) ?>

As for the slashes, it sounds like a magic quotes problem. You can easily check this in the course of a script by calling get_magic_quotes_gpc, which will return true if the feature is enabled. The PHP website has some useful information on how to disable it.


Check if you have magic quotes activated.

You can check this, either in your configuration-files, or by viewing the output of php_info(). Here are instructions on how to disable this "feature".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜