I know that you should use addslashes($string) to avoid errors with ' and ", but for some reason, slashes are always put before them even if I dont use addslashes. Some of my code is :
<?php
if($HTTP_POST_VARS['Game_Name'] != ""){
$gname = $HTTP_POST_VARS['Game_Name'];
$gtype = $HTTP_POST_VARS['Game_Type'];
$gdate = $HTTP_POST_VARS['Date_Added'];
$gplayers = $HTTP_POST_VARS['Players'];
$gdesc = $HTTP_POST_VARS['Game_Object'];
$gcat = $HTTP_POST_VARS['Category'];
$gurl = $HTTP_POST_VARS['Game_URL'];
?>
Name: <?=$gname?><br>
Type <?=$gtype?><br>
Date: <?=$gdate?><br>
Players: <?=$gplayers?><br>
Object: <?=$gdesc?><br>
Category: <?=$gcat?><br>
URL: <?=$gurl?><br>
<?
}
?>
When I view the text, there is already a slash infront of the ' and ". If I use addslashes($string), I would see something like this: don///'t, and when I use stripslashes, I can still see one of the slashes. Any idea why?