How to dynamically create a PHP class name on the fly?

What is the code of the contact.php for code below?

  • <form id="contact-form" class="col-sm-7 scrollimation fade-left" action="contact.php" method="post" novalidate> <div class="form-group">   <label class="control-label" for="contact-name">Name</label>   <div class="controls"> <i class="icon-user"></i> <input id="contact-name" name="contactName" placeholder="My name is..." class="form-control input-lg requiredField" type="text" data-error-empty="Please enter your name">   </div> </div><!-- End name input --> <div class="form-group">   <label class="control-label" for="contact-mail">Email</label>   <div class=" controls"> <i class="icon-envelope"></i> <input id="contact-mail" name="email" placeholder="Please respond at..." class="form-control input-lg requiredField" type="email" data-error-empty="Please enter your email" data-error-invalid="Invalid email address">   </div> </div><!-- End email input --> <div class="form-group">   <label class="control-label" for="contact-message">Message</label> <div class="controls"> <i class="icon-comment"></i> <textarea id="contact-message" name="comments"  placeholder="I wanna talk about..." class="form-control input-lg requiredField" rows="5" data-error-empty="Please enter your message"></textarea> </div> </div><!-- End textarea --> <p><button name="submit" type="submit" class="btn btn-theme btn-lg" data-error-message="Error!" data-sending-message="Sending..." data-ok-message="Message Sent"><i class="icon-location-arrow"></i>Send Message</button></p> <input type="hidden" name="submitted" id="submitted" value="true" /> </form><!-- End contact-form -->

  • Answer:

    PHP code resides on the server and can't be inspected from your browser.

Peter de Vroede at Quora Visit the source

Was this solution helpful to you?

Other answers

The code will be very simple. There are two stages. first validation (over simplified) if ($_POST['email']!=[A VALID EMAIL ADDRESS])  {  $err['email']=1;  } else  {  #check for insertions, throw into database or mail to admin  } If there is an error, go back to the form, populate the fields with the data thrown in, and alert the user to the error. There are plenty of prebuilt scripts that can help you with this sort of thing, but form handling is a great project for learning the code. As Peter observed, however, it is not possible to see the code doingg this (unless you have ftp access to the server)

John Smart

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.