note 59146 added to function.str-replace
| From: | mainma at club-internet dot fr | Date: | Sun, 27 Nov 2005 14:50:21 +0000 |
| Subject: | note 59146 added to function.str-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-99189@lists.php.net to get a copy of this message | ||
In mdn_abn's code, there is another thing that can fail in some situations.
If the text with the links is submited then to MySQL database like this:
$results = mysql_query("INSERT INTO ... (..., ..., ...)
VALUES ('...', '...',
'$modified_text')");
it will fail. In fact, each image remplaced by replaceImg() appears like this:
<img src=image.jpg border='0'>
So that " ' " symbol closes the value of $modified_text for MySQL.
Instead, write just
$htmlImg = "<img src=$link border=0>";
I am not sure about the old browsers, but it works fine with IE6 and Netscape 8.
----
Manual Page -- http://www.php.net/manual/en/function.str-replace.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+59146
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+59146&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+59146&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+59146&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+59146&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+59146&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+59146&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+59146&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+59146&report=yes
Search -- http://master.php.net/manage/user-notes.php