Undefined Variable
I think I must be blind ;)
$Title = $_POST['title'];
$Category = $_POST['category'];
$Content = $_POST['article'];
$Tags = $_POST['tags'];
$Description = $_POST['description'];
//error below...
$Title = addslashes($Title);
//error above...
$Category = addslashes($Category);
$Content = addslashes($Content);
$Tags = addslashes($Tags);
$Description = addslashes($Description);
I declared title the first time... $Title = $_POST['title']; ... no problems. Then I declare it again and I get the Undefined variable error. All of the other variables work just fine. What's the problem?
Joe34
Junior Poster in Training
92 posts since Nov 2010
Reputation Points: 10
Solved Threads: 0
Yes, vibhadevit is right. addslashes only accepts string as an argument, so to make it safe, have a condition to check where the string you supplied to addslashes funtion is not null or something that is not a string.
reyborn
Junior Poster in Training
58 posts since Jan 2006
Reputation Points: 11
Solved Threads: 9