html LINK tag <a href> </a> do not work fine
Moderator: General Moderators
html LINK tag <a href> </a> do not work fine
hy ppl
i have a litle form to post some news into a website... but when i try to sert a link to a web page with html tags... like this :
<a href="url?sapo.pt" > here </a>
the link not apear in the post...
i use just nl2br in the variable... nothing more...
why this happen ?
i have a litle form to post some news into a website... but when i try to sert a link to a web page with html tags... like this :
<a href="url?sapo.pt" > here </a>
the link not apear in the post...
i use just nl2br in the variable... nothing more...
why this happen ?
Weird, i can't see why pulling some text from a db then passing it via a nl2br() would remove an entire <a href="...">here</a> string unless there's some strip_tags() or quote escaping going on, even then it would leave you something and not remove the enitre string.
Maybe post the code you are using to pull/display the info from the database?
Maybe post the code you are using to pull/display the info from the database?
Show us ALL your code and read this viewtopic.php?t=21171
its very simple
now lets see the $post...
Code: Select all
<?php
$post = $_POST["news"];
//$post have for example
//hy ppl see this
//<b><a href="url>here</a><b>?sapo.pt"
$insert = "insert into news (post) values ('$post')";
$exec = mysql_db_query("sb", $insert);
//ok at here, you have put the variable $post into the database
?>now lets see the $post...
Code: Select all
<?php
//inside db we have
//hy ppl see this<br />
//<br />
//<b><a href="url>here</a><b><br?sapo.pt" />
//<br />
$cmd = "select post from news";
$exec = mysql_db_query("db", $cmd);
$get = mysql_fetch_row($exec);
$post_news = $get[0];
$post_news = nl2br("$post_news");
echo "
<b>$post_news</b>
";
// the text "here" will not apear in the html
?>Code: Select all
<b><a href="url>here</a><b><br?sapo.pt" />use this...
Code: Select all
<b><a href="URL HERE">display text</a></b>