Jump to content


Photo

Writing image tags via PHP.


  • Please log in to reply
1 reply to this topic

#1 stephenodotcom

stephenodotcom
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 20 August 2006 - 08:08 PM

I am trying to write image tags that are stored in text that is being written to by a php script. The problem I have is when it writes to the file it includes a / between all the " or ' in the tag.

For instance:

<img src=\'images.jpg\' alt=\'Image\'  />

How can I solve this? I have done quite a lengthly search and have yet to find any resonable solution. For all those interested here is the code I have used to write to the TXT file. Extreamly simple and straightforward:


if (is_writable($file1))
{

/* OPEN THE FILE */
$handle1 = fopen($file1, "w");

/* WRITE TO THE FILE */
fwrite($handle1, $updatetext1);

/* CLOSE THE FILE */
fclose($handle1);

// MARK THE FILE AS WRITABLE
$writable = 1;

}

I thank all those who try and help. It is greatly appreciated.

#2 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 20 August 2006 - 08:13 PM

Use stripslashes (http://www.php.net/stripslashes)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users