Programming
Web form not working

Question Description

I’m trying to study for my Programming course and I need some help to understand this question.

I would like my signup form to require my users to complete all the fields and even though I have inputted that feature it is not working and I would love to know why. here is the current code:

PHP Code:

<form action="register.php" method="post">
 <div class="row">
 <label>Username:</label>
 <div class="right"><input type="text" value="" name="username" class="{validate:{required:true, messages:{required:'Please enter your username'}}}" /></div>
 </div>
 <div class="row">
 <label>Account Email:</label>
 <div class="right"><input type="text" value="" name="email" class="{validate:{required:true, email:true, messages:{required:'Please enter your email address'}}}" /></div>
 </div>
 <div class="row">
 <label>Account Password:</label>
 <div class="right"><input type="password" value="" name="password" class="{validate:{required:true, messages:{required:'Please enter your password'}}}" /></div>
 </div>
<br />
<div class="title">Contact Details:</div>
 <div class="row">
 <div class="right">
 <?php echo $users->getCountrySelectBox($row['country_iso']);?>  </div></div>
 <div class="row">
 <label>Your Name:</label>
 <div class="right"><input type="text" value="" name="name" class="{validate:{required:true, messages:{required:'Please enter your real name'}}}" /></div>
 </div>
 <div class="row">
 <label>Street Address:</label>
 <div class="right"><input type="text" value="" name="address" class="{validate:{required:true, messages:{required:'Please enter your address'}}}" /></div>
 </div>
 <div class="row">
 <label>City/Town:</label>
 <div class="right"><input type="text" value="" name="city" class="{validate:{required:true, messages:{required:'Please enter your city'}}}" /></div>
 </div>
 <div class="row">
 <label>Zip/Postal Code:</label>
 <div class="right"><input type="text" value="" name="zip" class="{validate:{required:true, messages:{required:'Please enter your zip code'}}}" /></div>
 </div>
 <br />
 <div class="title">Content & Promotional Methods:</div>
<div class="row">
text...text
 </div><div class="row">
 <center><h6>Minimum 40 characters required.</h6><textarea value="" name="methods" class="{validate:{required:true, messages:{required:'Please enter your Content Type and your Promotional Methods'}}} " style="height : 100px; width : 600px;" > </textarea> </div></center>
 <?php if(isset($_GET['ref'])){?>  <div class="row">
<label>Referral</label>
 <div class="ref">
 <div class="right"><input type="text" value="<?php echo $_GET['ref']; ?>" name="referral" disabled="" /></div>
 </div>
 </div>
 <?php } ?>  <div class="row">
 <label>Agreement:</label>
 <div class="right">
 <input type="checkbox" name="agreement" id="agreement"/>
 <label for="agreement">I have read and accept the hidden <a href="tos.php" target="_blank" >Terms of Service</a></label>
 </div>
 </div>
 <div class="row">
 <div class="right">
 <button name="submit" id="submit" type="submit" class="green"><span>Submit</span></button>
 </div>
 </div>
 </form>
 </div>

It is currently just letting users to signup without completing all the fields. If anyone could help me with this, that would be wonderful.

Thank you

Student has agreed that all tutoring, explanations, and answers provided by the tutor will be used to help in the learning process and in accordance with Studypool's honor code & terms of service.

Final Answer

<br />
<b>Parse error</b>: syntax error, unexpected '&lt;' in <b>[...][...]</b> on line <b>1</b><br />

Farrukh (866)
Boston College

Anonymous
Top quality work from this tutor! I’ll be back!

Anonymous
Heard about Studypool for a while and finally tried it. Glad I did caus this was really helpful.

Anonymous
Thank you! Reasonably priced given the quality

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4
Similar Questions
Related Tags