PDA

View Full Version : [Php] Creating a News System



Zaxza
March 19th, 2006, 06:39 AM
http://codewalkers.com/tutorials.php?show=5

I've just finished this tutorial. And have realised that the'<img src=' tag and '<a href=' tag don't work properly. In the html a '\' symbol incerts itself before a ' " ' symbol.

e.g. <img src=\"images/logo.gif\">

and before a link this happens...

Type this in the field <a href="http://www.yoursite.com">

Outcome = http://www.mysite.com/\"http://www.yoursite.com\"

Is there a simple way to stop this, or should i try to make a BB Code for it?

mlk
March 19th, 2006, 07:49 AM
have you tried outputing '&quot;' instead of the 'quotes' character ? ( " )

Sliker_Hawk
March 19th, 2006, 08:35 AM
For the purposes of this thing, I'll call the input field $input.
Type in input field: <a href="http://www.yoursite.com">

In PHP, type this after receiving the field (in post or whatever) and before echoing it:
$input = stripslashes($input);

Outcome should be <a href="http://www.yoursite.com">

... If I understand you.

Zaxza
March 19th, 2006, 09:48 AM
For the purposes of this thing, I'll call the input field $input.
Type in input field: <a href="http://www.yoursite.com">

In PHP, type this after receiving the field (in post or whatever) and before echoing it:
$input = stripslashes($input);

Outcome should be <a href="http://www.yoursite.com">

... If I understand you.

Thanks for your help...
I tried this and managed to get rid of the red bit below... http://www.mysite.com/\"http://www.yoursite.com\"

But the rest still appears...