php - Why does "<image_link>" show up in my database table field without being inserted? -
I have just uploaded the images using my API and I am trying to save the image path that I I want to get back from the images.
$ mgr-> Setup URL ('http://www.imageshack.us/index.php'); $ FileImagePath = $ row ['cr_path']; Repeat $ fileImagePath '& Lt; Br> & Lt; Br> & # 39; & # 39; $ Res = $ mgr- & gt; Upload ($ line ['cr_path'], 'image / jpeg', 'avaojo'); $ NewImagePath = Explosion ('', $ res); $ ShackPath = trim ($ new image path [6]); Echo '& gt; & Gt; & Gt; ' $ Shackpath '& Lt; & Lt; & Lt; '; // Output & gt; & Gt; & Gt; Http: //img194.imageshack.us/img194/5038/9444679.jpg< & Lt; & Lt; $ Sql = "Update Avatar SET image_path = '$ shackpath' Where avatar_id =". $ Line ['cr_id'];
However, when I view my MySQL database, it will be & lt; Image_link & gt; & Lt; / Image_link & gt;
The URL with the tag wraps around the string?
What's going on? I looked everywhere and nothing in my script resets $ shackPath variable In fact, there are only 3 lines of insertion and trim to $ $ new image path and there is nothing between them!
Thanks all
That's because $ shackPath has & lt ; Image_link & gt;
Tags are also the only reason that when you resonate it, you are not seeing it, because your browser thinks this is an invalid HTML tag, so it only ignores it if you use the source If you see, you & lt; Image_link & gt;
should see the tag there.
To fix this, do this:
$ shackPath = strip_tags (trim ($ newImagePath [6]));
Comments
Post a Comment