Create Group, PHP Code [Not Working]

[php]include ‘header.php’;

$gname = mysql_real_escape_string($_POST[‘gname’]);
$gdesc = mysql_real_escape_string($_POST[‘gdesc’]);
$glogo = mysql_real_escape_string($_POST[‘glogo’]);

$submit = $_POST[‘submit’];
$creator = $myU->Username;
if($User){
if(!isset($submit)) {
if(!$gname) {
echo “Your group needs a name!”;
}
if (!$gdesc) {
echo “Please give a brief description of your group!”;
}
if (!$glogo) {

		echo "Please give your group a logo!";
	
	} 
	else {

			mysql_query("INSERT INTO Groups (Name, Description, Logo, Creator)
			VALUES('$gname', '$gdesc', '$glogo', '$creator')");
			
			header("Location: Profile.php?ID=$myU->ID");

[/php]

;D ;D ;D Fixed it myself

That’s good, because no-one else would have been able to help you, considering that:

  • You didn’t bother saying what you expected your code to do
  • That SQL call is not backed up by table structure
  • You didn’t even bother specifying what the error/unwanted phenomenon on your code is.
Sponsor our Newsletter | Privacy Policy | Terms of Service