Forum Moderators: coopster
I used tinyMCE as my rich text editor... and in my paragraph, it contain like this...
[html code snipset]
<a href="../%22../%22http://www.example.com/x.pdf/%22/%22" target="/"_blank/"">
[/html code snipset]
now when it will be inserted in the database, i used this....
[php code snipset]
$article = $_POST["article"];
$sql = "insert into news (article) values ('%s')";
$result = mysql_query(sprintf($sql,mysql_real_escape_string($article)));
if ($result)
{
return 'ok';
}
else
{
return 'err';
}
[/php code snipset]
now, when i retrieve the data from the mysql, i gives me like this... shown below...
[html code snipset]
<a href="../%22../%22http://www.example.com/x.pdf/%22/%22" target="/"_blank/"">
[/html code snipset]
is there something wrong in my php code? coz in my computer, running windows, php 4.3.11 and mysql 5.0.1-alpha, it works fine. but in my server, running CPanel, that's the output.. please help...
[edited by: eelixduppy at 6:23 am (utc) on June 9, 2007]
[edit reason] example.com [/edit]
I used tinyMCE as my rich text editor... and in my paragraph, it contain like this...
[html code snipset]
<a href="../%22../%22http://www.example.com/x.pdf/%22/%22" target="/"_blank/"">
[/html code snipset]
now when it will be inserted in the database, i used this....
[php code snipset]
$article = $_POST["article"];
$sql = "insert into news (article) values ('%s')";
$result = mysql_query(sprintf($sql,mysql_real_escape_string($article)));
if ($result)
{
return 'ok';
}
else
{
return 'err';
}
[/php code snipset]
now, when i retrieve the data from the mysql, i gives me like this... shown below...
[html code snipset]
<a href="://www.example.com/x.pdf" target="_blank">
[/html code snipset]
is there something wrong in my php code? coz in my computer, running windows, php 4.3.11 and mysql 5.0.1-alpha, it works fine. but in my server, running CPanel, that's the output.. please help...
[edited by: eelixduppy at 6:23 am (utc) on June 9, 2007]
[edit reason] example.com [/edit]
i having trouble with this...
I used tinyMCE as my rich text editor... and in my paragraph, it contain like this...
[html code snipset]
<a href="http://www.example.com/x.pdf" target="_blank">
[/html code snipset]
now when it will be inserted in the database, i used this....
[php code snipset]
$article = $_POST["article"];
$sql = "insert into news (article) values ('%s')";
$result = mysql_query(sprintf($sql,mysql_real_escape_string($article)));
if ($result)
{
return 'ok';
}
else
{
return 'err';
}
[/php code snipset]
now, when i retrieve the data from the mysql, i gives me like this... shown below...
[html code snipset]
<a href="../%22../%22http://www.example.com/x.pdf/%22/%22" target="/"_blank/"">
[/html code snipset]
is there something wrong in my php code? coz in my computer, running windows, php 4.3.11 and mysql 5.0.1-alpha, it works fine. but in my server, running CPanel, that's the output.. please help...
[edited by: eelixduppy at 6:24 am (utc) on June 9, 2007]
[edit reason] example.com [/edit]
Can you view the values in the database table directly without running them through a script? If so, is the data going into the database table as you desire? If not, then I would dump the variable to the screen right after the POST but before the INSERT to see what the variable contains and then work my way back from there.