Jump to content

Problems with submitting


WAMFT1
Go to solution Solved by WAMFT1,

Recommended Posts

Hi,

 

I have been trying to get this piece of coding to submit my form after checking but it keeps going to a 500Error. I have spent so long trying to work it out that now I am confused on what works and what doesn't. Can someone please help with where I am going wrong.

<?php
if(isset($_POST['Submit'])){
			$DateUploaded = protect($_POST['DateUploaded']);
			$AdviserCode = protect($_POST['AdviserCode']);
			$DocName = protect($_POST['DocName']);
			$URL = protect($_POST['URL']);	
			$ImageType = protect($_POST['ImageType']);
			$Current = protect($_POST['Current']);			
			$css_class = protect($_POST['css_class']);
			
		if(!$ImageType || !$DocName){
				echo "<center>You need to fill in all of the required filds!</center>";
			}else{
				
 $res = mysql_query ("INSERT INTO `adocs_cpd` (`DateUploaded`, `AdviserCode`, `DocName`, `URL`, `ImageType`, `Current`, `css_class`) VALUES ('".$DateUploaded."','".$AdviserCode."','".$DocName."','".$URL."','".$ImageType."','".$Current."','".$css_class."')");
	echo "Saved!";
}
}
?>
Link to comment
Share on other sites

a http 500 respons for a php script usually means a fatal parse or a fatal runtime error, but php's error_reporting/display_errors are not set to show all errors.

 

when developing and debugging php code, you must have php's error_reporting set to E_ALL and display_errors set to ON, in your php.ini, so that php will help you.

Link to comment
Share on other sites

also, your thread has absolutely nothing to do with the Regex forum section that you posted it in. moving thread to the php help section...

 

edit: i also notice you previously posted a thread in the Regex forum that had to be moved. are you a bot script or a real person?

Edited by mac_gyver
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.