can someone please show me what im doing wrong. i have a form and im inserting the data into mysql as text but when u type apostrophes or something like that it puts a \ in.
can someone recomend how to get my mysql to allow special characters?
here's my html form:
<form action="includes/changebio.php" method="post" id="form1">         
 <textarea id="bio" textarea name="bio" data-id="bio" maxlength="710"><?php echo htmlspecialchars($profile['bio']); ?></textarea>
<input type="image" src="assets/img/icons/save-edit.png"class="bio-submit" name="submit" value="submit" id="submit"/>
</form>
my mysql statement:
<?php
require('_config/connection.php');
?>
<?php 
session_start();
include '_config/connection.php'; 
$bio = $_POST['bio'];
$result = mysql_query("SELECT bio FROM ptb_profiles WHERE id=".$_SESSION['user_id']."");
if(!$result) 
{ 
echo "The username you entered does not exist"; 
} 
else 
if($bio!= mysql_result($result, 0)) 
{ 
echo ""; 
    $sql=mysql_query("UPDATE ptb_profiles SET bio ='".addslashes($bio)."' WHERE id=".$_SESSION['user_id'].""); 
}
    if($sql) 
    { 
header("Location: {$_SERVER['HTTP_REFERER']}");
}
?>
 
     
     
     
    