Location: PHPKode > scripts > Create Your Own Directory > cms/functions/feedback.php
  <html>
  <?php
    $home="../";
    include "$home/header.php";
  ?>

  <SCRIPT LANGUAGE="JavaScript">
  function textCounter(add,lenf) {
    var cadd = add;
    var cle = cadd.value.length;
    var maxl = 125;
    if(cle > maxl){
	cadd.value = cadd.value.substring(0, maxl);
	lenf.value = 0;
    }else{
	var ll = maxl-cle;
	lenf.value= ll;
    }
  }
  </script>

  <?php
  $block="true";
  $ref=$_SERVER[HTTP_REFERER];
  //echo"$ref";
  $domain = strstr($ref,$userdomain);
  $cntid=$_GET['cntid'];
  $fmaile=$_POST['fmaile'];
  $usrname=$_POST['usrname'];
  $usrmail=$_POST['usrmail'];
  include "./class.phpmailer.php";
	$mail = new PHPMailer();
	$mail->From     = "$usrmail";
	$mail->FromName = "$usrname";
	$mail->IsMail();
  if($fmaile=="yes")
  {
     if($domain)
     {
	 
	  if($umail !="" && ($usrmail !=$fmail[$k]))
	 { 
         if($usrmail !="")
	  {
          $mail->Subject = "Issue regarding $arr[0]";
          $mail->Body    = $pmessage;
	    $mail->AddAddress("$umail", "");
	    if(!$mail->Send())
	    {
  	      echo "<div align=center style='color:red;'>There has been a mail error sending to " . $usrname . "</div>";
		// Clear all addresses for next loop
	      $mail->ClearAddresses();				
 	    }else{
		$block="false";
          }
	  }else
	  {
         echo"<div align=center style='color:red;'>Enter your Email Address</div>";
	  }		
      }
    }
  }			
  $query="select * from cnt where cntid=$cntid";
  $result=mysql_query($query);
  while($row=mysql_fetch_array($result,MYSQL_ASSOC))
  {
    $contents=$row['contents'];
$arr=split('####',$contents);

  }
  ?>
  <?php
  if($block=="true")
  {
    echo"<form method=post action=\"\">
    <div align=center><font style=\" font-size:18px;\">Report Issue to support desk regarding <font style=\"color:green; font-size:18px;\">$arr[0]</font> Resource</font></div>
    <br>
    <table align=center height=100% width=70%  cellpadding=0 cellspacing=0  style=\"border: 1px solid #186310;\">
      <tr><td align=center height=20 colspan=3></td></tr>
      <tr><td width=45%><div style=\"margin-left: 20px;\"><strong>Resource Title:</strong></div></td><td colspan=2><input type=text name=srcname  maxlength=50 value='$arr[0]' readonly></input></td></tr>
      
      <tr><td height=10></td></tr>
      <tr><td align=center><strong>Your name</strong></td><td align=center colspan=2><strong>Your Mailid</strong></input></td></tr>
      <tr><td align=center><input type=text name=usrname maxlength=50></input></td><td align=center colspan=2><input type=text name=usrmail maxlength=50></input></td></tr>
      <tr><td height=10></td></tr>
      <tr><td align=center colspan=3 class=heading>Enter your Message</td></tr>
      <tr><td colspan=3 align=center ><textarea rows=6 cols=40  name=pmessage onKeyUp=textCounter(this,this.form.remLen)></textarea>
      <input readonly type=text name=remLen size=3 maxlength=3 value=125></td></tr>
      <tr><td colspan=3 align=center><input type=hidden name=fmaile value=\"yes\">
      <input type=submit name=sub value=send></td></tr>
    </table>
    </form>";
  }else{
  echo" <div align=center>Your mail has been send to support desk regarding issue in $arr[0] resource <br>
  <a href=$home"."feedback.php?cntid=$cntid&sub=yes>BACK</a></div>";
  }
  ?>
  <?php
    include '../footer.php';
  ?>
Return current item: Create Your Own Directory