Hello. I'm developing a news submittal system for my website (completely blind on php lol) and at the moment I'm creating a php script to submit news with information into a database until it is approved by mail. I wanted to test the script to see if it placed data into the database correctly before I continued. I have an error message with the if test. Anyone know what to do. also can anyone give me any advice to how I will accomplish the rest by directing me to useful resources or telling me what i'd need to do? Thanks.
$email = $_GET['email'];
$category = $_GET['category'];
$article = $_GET['article'];
$title = $_GET['title']
if (in_array("General", $category)) {
$General = 1;
}else{
$General = 0;
}
if (in_array("Funny", $category)) {
$Funny = 1;
}else{
$Funny = 0;
}
if (in_array("Help related", $category)) {
$Help = 1;
}else{
$Help = 0;
}
if (in_array("Quizzes", $category)) {
$Quiz = 1;
}else{
$Quiz = 0;
}
if (in_array("Chatbots", $category)) {
$Chat = 1;
}else{
$Chat = 0;
}
if (in_array("Video game related", $category)) {
$Game = 1;
}else{
$Game = 0;
}
mysql_connect(localhost,root,********);
@mysql_select_db(subbmission) or die( "There has been an error in your request. Please try again! Error: Unable to select dadabase.");
$query="INSERT INTO pending VALUES ('$title','2007','$article','$General','$Funny','$Help','$Quiz','$Chat','$Game')";
mysql_query($query);
mysql_close();
$subject = "New article submission" . $title;
$body = $article . $General . $Funny . $Help . $Quiz . $Chat . $Game;
mail('godofgod@godofgod.co.uk',$subject,$body,"From: $email\n");
if(mail('godofgod@godofgod.co.uk',$subject,$body,"From: $email\n")){
echo "<font face=\"arial\">Your submission has been entered successfully and is pending approval</font>";
}else{
echo "<font face=\"arial\">There has been an error in your request. Please try again! Error: Unable to mail.</font>";
}