Forum Statistics

  • Forum Members: 4,502
  • Total Threads: 3,657
  • Total Posts: 2
There are 1 users currently browsing forums.

Partner Sites

Reply
Old 07-14-2009, 05:07 AM   #1 (permalink)
 
Status: Newbie
Join Date: Jul 2009
Posts: 2

Rep Power: 12 shifanyroma is on a distinguished road



Default Adding html tags to form input and save in database

I use this to get info from post values and save it to database. The problem is that it doesnot add html tags like <br /> or <strong> to database. What am I doing wrong?

Thanks

PHP Code:
<?php //Connect to database, all incoming posts from sql injection

$cat= new mysql($db_host, $db_user, $db_password, $db);

$cat->connect(); $cat->select();
foreach($_POST as $key=>$value)
{
if (PHP_VERSION < 6 && get_magic_quotes_gpc())
{
$_POST[$key]=stripslashes($value);
}
$_POST[$key] =mysql_real_escape_string($_POST[$key]);
}
echo $query = "INSERT INTO table (id, name)
VALUES ('".$_POST['id']."', '".$_POST['name']."')"; ?>
__________________
Ceiling fan I Kentucky real estate
shifanyroma is offline Add Infraction for shifanyroma   Reply With Quote
Old 12-28-2009, 01:12 AM   #2 (permalink)
 
Status: Newbie
Join Date: Dec 2009
Posts: 3

Rep Power: 10 jerysbond is on a distinguished road



Default

Thanks for such a nice work for HTML problem solving issue. As per me i am developer and i want any query so i am using the internet and i just got here such a good information on that.
__________________
r4i software
jerysbond is offline Add Infraction for jerysbond   Reply With Quote


Reply

Bookmarks

Tags
None


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may post new threads
You may post replies
You may post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.5.0 RC2