$pageTitle="Submit Conception"; include($_SERVER['DOCUMENT_ROOT'] . "/template/header.php"); //they have to be logged in to use this form if(user_logged_in() && !$doingLogout){ $username=$_COOKIE['sclcr']; } else{ //the user isn't logged in ?>
You must be logged in before you can create a conception.
Not a member? Become one now!
Completely free, no personal info, and takes just seconds.
RUNNING
"; if(mysql_num_rows($result)>0){ $ERROR['concept']="There are " . mysql_num_rows($result) . " conceptions in the database with a similar title. Please confirm you are not entering an exact duplicate before continuing."; $EXECUTE_DUPLICATE_CHECK=true; } } $result=database_query("SELECT id, concept FROM ConceptsBeta WHERE concept='$concept'"); if($result){ if(mysql_num_rows($result)>0){ $ERROR['concept']="There are " . mysql_num_rows($result) . " conceptions in the database with this exact same title. Please confirm you are not entering an exact duplicate before continuing."; $EXECUTE_DUPLICATE_CHECK=true; } } $result=database_query("SELECT id, concept FROM ConceptsBeta WHERE concept='$concept' AND author='$author'"); if($result){ if(mysql_num_rows($result)>0){ $ERROR['concept']="There are " . mysql_num_rows($result) . " conceptions in the database with this exact same title and author. Please confirm you are not entering an exact duplicate before continuing."; $EXECUTE_DUPLICATE_CHECK=true; } } } //validate the author(s) if( strlen($author)<=2 || strlen($author)>=256 || ctype_lower($author) || strpos($author, ",")!==false ){ //there is a problem with the $ERROR['author']="There is a problem with your author. Please remember the following:CONCEPT: $newConceptID
\n"; //make sure the newConceptID is legit if($newConceptID>0){ //the concept ID is valid so insert the author $result=database_query("INSERT INTO Authors (name, conceptID, created, updated) VALUES ('$author', $newConceptID, NOW(), NOW())"); if($result){ //the new author was added //we are all done inserting the new items ?>Your new conception has been created. You can now finish editing it and then submit.
include($_SERVER['DOCUMENT_ROOT'] . "/template/footer.php"); exit(); //echo "TEST RESULTS: The new concept and author were created correctly.
\n"; } else{ //there was a problem inserting the author echo "ERROR: There was a problem inserting the new author.
\n"; } } else{ //the concept ID wasn't valid so we have to skip adding the author echo "New Concept ID failed, returned: $newConceptID
\n"; } } else{ echo "COULD NOT GET THE ID NUMBER
\n"; } } else{ echo "COULD NOT INSERT NEW CONCEPT
\n"; } //the test is done running. echo "Your submission is considered valid. END TEST.
\n"; } } else{ //they didn't submit anything so do nothing but show a blank form } ?>Thanks for contributing to the Conception Database. The process is easy, we will walk you through it in a few simple steps.
include($_SERVER['DOCUMENT_ROOT'] . "/template/footer.php"); ?>