Register form won’t work

Please help folks. I’m at my wits end. I have taken on a site with very old php code. It is starting to fail but the main fault is the registration form. I am still fairly new to php but I have gone through the code line by line and I cannot find the fault.
It keeps saying not all fields completed but they are. I have checked the code and the form matches the php checks exactly but still the error. It then uses a JavaScript to send to Ajax file to process, and I think this may be the issue

We cannot possibly help you with what is wrong with your code unless you post all the code needed to reproduce the problem - form page and form processing.

Code that provides a good user interface would produce a unique and helpful error message for each problem with each field’s value, not a general catch all message.

I’m happy to post it if that’s ok? It does have the error messages set up but they are not displaying anything, just fields missing, not which ones

image

image

image

image

image

That’s the main form. Do I also post the Ajax form too ? I think they are the only pages affecting it

Pictures are for hanging on walls. If you want help with your code you will need to post the actual code.

Also you have to say what the exact error message is, and you have to search for it by yourself within the code and tell in which file on which line it was.

require_once("/home/webcadet/public_html/mywcc/Connections/recaptchalib.php");
$publickey = "6LfgeAcUAAAAAKEVaR5lg6AW2z5H98jE2HeLUSYv"; // you got this from the signup page
$privatekey = "6LfgeAcUAAAAAIwFHVsuxDTOetivOqq4Rn7wIhdd";

$GLOBALS['templateVersion'] = "5.0";

//Change The Page Title Here:
$GLOBALS['pageTitle'] = "WCC Application Form";

//Change the Last Updated By Here:
$GLOBALS['lastUpdatedBy'] = "J. Sylvester";

/*
The following lines of code are used to gather the names that appear
underneath the page title.
You can add as many as you wish. If you choose too have none, just comment out the line
by adding two backslashes (//) infront of the line
See Example below
Example:
$positions['A'] = getPosition("Position Name", "Department", "A");
where A is a integer value starting with 0
*/
//$GLOBALS['positions']['0'] = getPosition("Site Maintenance Officer", "Site Maintenance", "0");
//$GLOBALS['positions']['1'] = getPosition("Assistant Site Maintenance Officer", "Site Maintenance", "1");

display_header();
?>
<!-- DO NOT DELETE OR REMOVE ANY OF THE ABOVE CODE -->
<!-- ALTER ONLY WHERE TOLD TO -->
<!-- You may add all the html code you want except for the following tags -->
<!-- <html>, <body>, <meta tags>, and there respective closing tags -->
<!-- ALTER BELOW THIS COMMENT -->
<!-- The default alignment of the page is centered -->

<script src='https://www.google.com/recaptcha/api.js'></script>
<div id="joinform" style="display:block">
<center><strong>* = Required Fields</strong></center>
    <?php
	$myForm = new Form();
	?>
    <form method="post" enctype="multipart/form-data" name="form1" id="form1">
    <div name="form_join_new" id="form_join_new">
    <table width="90%"  border="1" align="center">
        <tr>
            <td width="10%" bgcolor="#800000">First Name * </td>
            <td width="40%" bgcolor="#000000">
            	<div align="left">
            	<input name="NameFirst" type="text" id="NameFirst" value="<?php echo $_POST['NameFirst']; ?>" />
            	</div>
            </td>
            <td width="10%" bgcolor="#800000">Last Name * </td>
            <td width="40%" bgcolor="#000000">
            	<div align="left">
            	<input name="NameLast" type="text" id="NameLast" value="<?php echo $_POST['NameLast']; ?>" />
            	</div>
            </td>
        </tr>
        <tr>
            <td width="10%" bgcolor="#800000">Main EMail * </td>
            <td width="40%" bgcolor="#000000">
            	<div align="left">
            	<input name="EMail" type="text" id="EMail" value="<?php echo $_POST['EMail']; ?>" />
            	</div>
            </td>
            <td width="10%" bgcolor="#800000">Alt EMail * </td>
            <td width="40%" bgcolor="#000000">
            	<div align="left">
            	<input name="EMail2" type="text" id="EMail2" value="<?php echo $_POST['EMail2']; ?>" />
            	</div>
            </td>
        </tr>
        <tr>
            <td width="10%" bgcolor="#800000">Date of Birth * </td>
            <td width="40%" bgcolor="#000000">
            	<div align="left">
            	<?php $myForm->dateField('DOB', false, $_POST['DOB']); ?>
            	</div>
            </td>
            <td width="10%" bgcolor="#800000">Gender</td>
            <td width="40%" bgcolor="#000000">
            	<div align="left">

It won’t let me post code, keeps saying too similar to last post. Also I don’t get an error, just says fields not filled out. Where will I find error logs ?

the string "fields not filled out" does not exists in the code you posted, find it within your files to check conditions.

Where you find error logs depends on your OS, where they were set up to write to, and if they even exist; but an empty form field shouldn’t generate an error log anyway.

I see nothing that is form processing code, nor any ajax code?

Where is ‘ajax_rtform_new.php’?

You do realize those statements don’t communicate any useful information? What fields are missing from where? In the email? In the database table? Where are these messages being displayed at? What is the actual message you are seeing?

Programming is an exact science. We are not sitting right next to you. You must accurately communicate what result you are getting that leads you to believe something isn’t working, where you are getting it at, and without paraphrasing it.

Sponsor our Newsletter | Privacy Policy | Terms of Service