HEX
Server: Apache
System: Linux sg2plmcpnl492417.prod.sin2.secureserver.net 4.18.0-553.58.1.lve.el8.x86_64 #1 SMP Fri Jul 4 12:07:06 UTC 2025 x86_64
User: nyiet8349bzl (9207396)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/nyiet8349bzl/Backup/sbc_back/homedir/public_html/national-conference-registration-old.php
<?php include 'inc/header.php';?>
<?php include 'inc/slider.php';?>

<div class="container">
  <div class="row " >
    <div class="col-lg-12 ">
      <div class="sub_heading"> NATIONAL CONFERENCE ON MAKING CITIES RESILIENT: POST HABITAT III  <a  class="btn btn-danger pull-right"href="pdf/Registration-Form2.pdf" target="_blank">Download PDF </a> </div>
      <br>
      
    
      <form name="contactform" method="post" action="">
        <table width="600px" cellpadding="5" cellspacing="5">
          <tr>
            <td valign="top"><label for="name">Name </label>
            </td>
            <td valign="top"><input  type="text" name="name" maxlength="50" size="30" required>
            </td>
          </tr>
          <tr>
            <td valign="top"><label for="Affiliation"> Affiliation </label>
            </td>
            <td valign="top"><input  type="text" name="Affiliation" maxlength="30" size="30" required>
            </td>
          </tr>
          <tr>
            <td valign="top"><label for="Designation">Designation </label>
            </td>
            <td valign="top"><input  type="text" name="Designation" maxlength="30" size="30" required>
            </td>
          </tr>
          <tr>
            <td valign="top"><label for="address" > Correspondence Address</label>
            </td>
            <td valign="top"><textarea  type="text" name="address" maxlength="50" size="30" required>
  </textarea>
            </td>
          </tr>
          <tr>
          <tr>
            <td valign="top"><label for="telephone">Telephone/ Mobile</label>
            </td>
            <td valign="top"><input  type="text" name="telephone" maxlength="10" size="30" required>
            </td>
          </tr>
          <tr>
          <tr>
            <td valign="top"><label for="email">Email ID </label>
            </td>
            <td valign="top"><input  type="text" name="email" maxlength="80" size="30" required>
            </td>
          </tr>
          <tr>
            <td><strong>Registration Type</strong>
            <td><select name="Regtype">
                <option value="Indian Participants">Indian Participants</option>
                <option value="Institutional/Corporate Delegates">Institutional/Corporate Delegates </option>
                <option value="Research Scholars and Participants from DU">Research Scholars and Participants from DU</option>
                <option value="Foreign Delegates">Foreign Delegates</option>
              </select>
            </td>
          </tr>
          <tr>
            <td><strong>Presenting Paper</strong></td>
            <td><input type="radio" name="paper" value="Yes">
              Yes
              </input>
              <input type="radio" name="paper" value="No">
              No
              </input></td>
          </tr>
          </tr>
          
          <tr>
            <td colspan="2" style="text-align:center"><input type="submit" value="Submit" name="cc">
            </td>
          </tr>
        </table>
      </form>
      <?php


if(isset($_POST['email'])) 
{
    // EDIT THE 2 LINES BELOW AS REQUIRED
 
    $email_to = "makingcitiesresilient@gmail.com";
 
    $email_subject = "NATIONAL CONFERENCE REGISTRATION ";

    function died($error) {
 
        // your error code can go here
 
        echo "We are very sorry, but there were error(s) found with the form you submitted. ";
 
        //echo "These errors appear below.<br /><br />";
 
        echo $error."<br /><br />";
 
        //echo "Please go back and fix these errors.<br /><br />";
 
        die();
 
    }
 
    // validation expected data exists
 
    if(!isset($_POST['name']) ||
 
        !isset($_POST['address']) ||

        !isset($_POST['Designation']) ||
    
        !isset($_POST['Affiliation']) ||
 
        !isset($_POST['email']) ||
 
        !isset($_POST['telephone'])||
    
        !isset($_POST['Regtype'])) 
     {
      died('\nWe are sorry, but there appears to be a problem with the form you submitted.');       
 
    }
 
    $first_name = isset($_POST['name']); // required 
    $Affiliation = isset($_POST['Affiliation']); //  required
    $Designation = isset($_POST['Designation']); // required
    $address = isset($_POST['address']); // required
    $email_from = isset($_POST['email']); // required 
    $telephone = isset($_POST['telephone']); // not required
    $Regtype = isset($_POST['Regtype']); // required
    $ppa = isset($_POST['paper']); // required
 
   /* $error_message = "";
 
    $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
 
  if(!preg_match($email_exp,$email_from)) {
 
    $error_message .= 'The Email Address you entered does not appear to be valid.<br />';
 
  }
 
    $string_exp = "/^[A-Za-z .'-]+$/";
 
  if(!preg_match($string_exp,$first_name)) {
 
    $error_message .= 'The Name you entered does not appear to be valid.<br />';
 
  }
 
  if(!preg_match($string_exp,$address)) {
 
    $error_message .= 'The Address you entered does not appear to be valid.<br />';
 
  }
 
  if($Regtype == '') {
 
    $error_message .= 'You did not Select Your Registration Type:.<br />';
 
  }
 
  if(strlen($error_message) > 0) {
 
    died($error_message);
 
  }*/

    $email_message = "Form details below.\n\n";
 
    function clean_string($string) {
 
      $bad = array("content-type","bcc:","to:","cc:","href");
 
      return str_replace($bad,"",$string);
 
    } 
    $email_message .= "Name : ".clean_string($_POST['name'])."\n";
    $email_message .= "Address : ".clean_string($_POST['address'])."\n";
    $email_message .= "Affiliation   : ".clean_string($_POST['Affiliation'])."\n";
    $email_message .= "Designation   : ".clean_string($_POST['Designation'])."\n";
    $email_message .= "Mobile  : ".clean_string($_POST['telephone'])."\n";
    $email_message .= "Email   : ".clean_string($_POST['email'])."\n";
    $email_message .= "Registration Type: ".clean_string($_POST['Regtype'])."\n";
    $email_message .= "Presenting Paper: ".clean_string($_POST['paper'])."\n";

    if($_SERVER['REQUEST_METHOD'] == 'POST'){ 
 $con = mysql_connect("localhost","sbsc_register","sbsc@123");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
mysql_select_db("sbsc_register", $con);
$sql = "INSERT INTO `college`(`name`, `address`, `affiliation`, `Designation`, `Mobile`, `email`, `Registype`, `prespapr`) VALUES 
('$_POST[name]','$_POST[address]','$_POST[Affiliation]','$_POST[Designation]','$_POST[telephone]','$_POST[email]','$_POST[Regtype]','$_POST[paper]')";
if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "Your Information Was Successfully Posted";
mysql_close($con);
     }
 
// create email headers
 
$headers = 'From: '.$_POST['email']."\r\n".
 
'Reply-To: '.$_POST['email']."\r\n" .
 
'X-Mailer: PHP/' . phpversion();
 
@mail($email_to, $email_subject, $email_message, $headers);  
 

?>
      <!-- include your own success html here -->
      Thank you for contacting us. We will be in touch with you very soon.
      <?php
 
}

?>
    </div>
    <div class="clearfix"></div>
  </div>
</div>
</div>
<div class="clr"></div>
<?php include 'inc/footer.php';?>