Hi .
This is kishore
i want to know how to create Alpha numeric Verification code in php..in same page...
plz help me asap..


Thanks
Kishore

Hi,

Can you please detail your requirement.

Thank You vicky_rawat ...
i have code, but when i entered the submit button the result is showing in the next page..but i want to get result on same page...

please check the below Main.php,submitrequest.php files(just security image problem(bold))..

main.php:

<?php
session_start();
?>
<HTML>
<HEAD>
<title></title>

<meta name="keywords" content="">

<meta name="description" content="web developers usa, web developers India, web developers hyderabad, web developers UK, website developers usa, website 
developers india,website developers hyderabad,website developers UK, india payment gateway, payment gateway solutions from hyderabad, 
payment gateway India, flash presentations, webdesigners address hyderabad, webdesigners address india ,webdesigners address USA, webdesigners address UK, professional freelance web designers hyderabad, professional freelance web designers india, 
professional freelance web, designers USA, professional freelance web designers UK,professional freelance web design india, professional freelance web design USA, professional freelance web design USA, professional freelance web design UK,indian web 
developers, USA web developers, Hyderabad web developers, UK web developers,website designers india, website designers Hyderabad, website designers USA, website designers UK,/">

<META content="bitranet.com" name="BItraNet">
<meta name="www.bitranet.com" CONTENT="http://www.bitranet.com">
<meta name="rating" CONTENT="General">
<meta name="ROBOTS" CONTENT="ALL,INDEX,FOLLOW">
<meta name="revisit-after" CONTENT="6 days">
<META content="English" name="language">
<META content="index,follow" name="robots">

<script language="JavaScript" type="text/JavaScript" src="website_design_javascript.js"></script>
<link href="website_development_stylesheet.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.noborder{font-size:18px;font-family:Verdana, Arial, Helvetica, sans-serif;border-bottom: #ffffff 0px solid;border-top: #ffffff 1px solid;border-left: #ffffff 1px solid;border-right: #ffffff 0px solid;COLOR: #000000}
.style21 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style25 {font-size: 12px}
.style27 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; }
.style28 {color: #000000}
.style29 {font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000;}
.style30 {color: #FF0000}
-->
</style>
</HEAD>
<BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 onLoad="MM_preloadImages('../images/mid-links-over_02.gif','../images/mid-links-over_03.gif','../images/mid-links-over_04.gif','../images/mid-links-over_05.gif')">
<TABLE WIDTH=775 BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0>
  <TR>
   
    <TD width="760" align="left" valign="top" bgcolor="#FFFFFF"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
        
        <tr>
          <td align="left" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
            <tr>
             
              <td width="577" align="left" valign="top">                <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                    
                    <tr>
                      
                    <tr>
                            <td align="left" valign="top">
<SCRIPT>//global variable for error flag
var errfound = false;
//function to validate by length
function ValidLength(item, len) {
   return (item.length >= len);
}
//function to validate an email address
function ValidEmail(item) {
   if (!ValidLength(item, 5)) return false;
   if (item.indexOf ('@', 0) == -1) return false;
   
   return true;
}
// display an error alert
function error(elem, text) {
// abort if we already found an error
   if (errfound) return;
   window.alert(text);
   elem.select();
   elem.focus();
   errfound = true;
}
// main validation function
function Validate() {
   errfound = false;
   if (!ValidLength(document.form.company.value,1))
      error(document.form.company,"Enter Your Company Name");
	if (!ValidLength(document.form.city.value,1))
      error(document.form.city,"Enter Your City Name");
	  if (!ValidLength(document.form.state.value,1))
      error(document.form.state, "Enter Your State Name");
	  if (!ValidLength(document.form.country.value,1))
      error(document.form.country, "Enter Your Country Name");
	  if (!ValidLength(document.form.name.value,1))
      error(document.form.name, "Enter Your Name");
	  
	   if (!ValidEmail(document.form.email.value,1))
      error(document.form.email,"Enter Your Email Id");
      if (!ValidLength(document.form.phone.value,1))
      error(document.form.phone,"Enter Your Phone Number");
	 
	   if (!ValidLength(document.form.search1.value,1))
      error(document.form.search1,"Enter Search engine Name");
	   if (!ValidLength(document.form.security_code.value,5))
      error(document.form.security_code,"Please Enter Correct  Security Code");
	  
	  
	  
      
	  
	  
	  return !errfound; /* true if there are no errors */
}</SCRIPT> <SCRIPT language="javascript">
function Only_Num(id) {
	if(isNaN(document.getElementById(id).value)) {
		alert("Please Enter Numbers Only (0-9)..");
		document.getElementById(id).select();
		document.getElementById(id).value=""
		document.getElementById(id).focus();
	}
	return;
}
</SCRIPT>                           <form name="form" action="requsetsubmit.php" method="post">
                                <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
                                  <tr>
                                    <td><table width="100%" border="0" cellspacing="0" cellpadding="5">
                                        <tr>
                                          <td width="33%" class="style10 style21 style25">Company Name <font color="#FF0000">*</font></td>
                                          <td width="3%" class="style10 style21 style25">:</td>
                                          <td width="64%"><input name="company" type="text" class="style29" id="company" size="25" maxlength="75"></td>
                                        </tr>
                                        <tr>
                                          <td class="style10 style21 style25">City<font color="#FF0000">*</font></td>
                                          <td class="style10 style21 style25">:</td>
                                          <td><input name="city" type="text" id="city" size="20" maxlength="50"></td>
                                        </tr>
                                        <tr>
                                          <td class="style10 style21 style25">State / Province<font color="#FF0000">*</font> </td>
                                          <td class="style10 style21 style25">:</td>
                                          <td><input name="state" type="text" id="state" size="20" maxlength="50"></td>
                                        </tr>
                                        <tr>
                                          <td class="style10 style21 style25">Country <font color="#FF0000">*</font></td>
                                          <td class="style10 style21 style25">:</td>
                                          <td><input name="country" type="text" id="country" size="15" maxlength="50"></td>
                                        </tr>
                                        <tr>
                                          <td class="style10 style21 style25">Your Name <font color="#FF0000">*</font></td>
                                          <td class="style10 style21 style25">:</td>
                                          <td><input name="name" type="text" id="name" size="25" maxlength="75"></td>
                                        </tr>
                                        <tr>
                                          <td class="style10 style21 style25">E-Mail <font color="#FF0000">*</font></td>
                                          <td class="style10 style21 style25">:</td>
                                          <td><input name="email" type="text" id="email" size="30" maxlength="75"></td>
                                        </tr>
                                        <tr>
                                          <td class="style10 style21 style25">Phone<font color="#FF0000">*</font></td>
                                          <td class="style10 style21 style25">:</td>
                                          <td><input name="phone" type="text" id="phone" size="15" maxlength="50"onChange="Javascript:LA()"  onKeyUp="Only_Num(this.id)"></td>
                                        </tr>
                                        <tr>
                                          <td class="style10 style21 style25">Domain Name Required ...?</td>
                                          <td class="style10 style21 style25">:</td>
                                          <td><span class="style27">
                                            <input name="radiobutton" type="radio" class="style7" value="Yes" checked>
                                            <span class="style28">Yes</span></span>
                                            <span class="style27">
                                            <input name="radiobutton" type="radio" class="style7" value="No">
                                            <span class="style28">No</span></span></td>
                                        </tr>
                                        <tr>
                                          <td class="style10 style21 style25">if Yes provide Domain Name</td>
                                          <td class="style10 style21 style25">:</td>
                                          <td><input name="domain" type="text" id="domain" size="30" maxlength="100"></td>
                                        </tr>
                                        <tr>
                                          <td class="style10 style21 style25">If No Give us Existing Web Site Name </td>
                                          <td class="style10 style21 style25">:</td>
                                          <td><input name="existing" type="text" id="existing" size="30" maxlength="100"></td>
                                        </tr>
                                        <tr>
                                          <td class="style10 style21 style25">Looking for the following Services</td>
                                          <td class="style10 style21 style25">:</td>
                                          <td><span class="style27">
                                            <input name="checkbox" type="checkbox" class="style7" value="Design New Site">
                                            Design New Site<br>
                                            <input name="checkbox" type="checkbox" class="style7" value="Re-Design Existing Site">
                                            Re-Design Existing Site<br>
                                            <input name="checkbox" type="checkbox" class="style7" value="Search Engine Registration">
                                            Search Engine Registration<br>
                                            <input name="checkbox" type="checkbox" class="style7" value="Payment Gateway Solutions">
                                            Payment Gateway Solutions</span></td>
                                        </tr>
                                        <tr>
                                          <td class="style10 style21 style25">Are you Looking for Hosting Space</td>
                                          <td class="style10 style21 style25">:</td>
                                          <td><span class="style27">
                                            <input name="radiobutton1" type="radio" class="style7" value="Yes" checked>
                                            Yes</span>
                                            <span class="style27">
                                            <input name="radiobutton1" type="radio" class="style7" value="No">
                                            No</span></td>
                                        </tr>
                                        <tr>
                                          <td class="style10 style21 style25">Other Requirements</td>
                                          <td class="style10 style21 style25">:</td>
                                          <td><textarea name="others" cols="30" rows="4" wrap="VIRTUAL" class="style7 style21 style25" id="others"></textarea></td>
                                        </tr>
                                        <tr>
                                          <td class="style10 style21 style25">In which Search Engine you found us..? <font color="#FF0000">*</font></td>
                                          <td class="style10 style21 style25">:</td>
                                          <td><span class="style27">
                                            <input name="search1" type="text" class="style7" id="search" size="20" maxlength="100">
                                            (Ex:Google,Yahoo..etc)</span></td>
                                        </tr>
                                        <tr>
                                          <td class="style10 style21 style25">Which keyword you searched for..?</td>
                                          <td class="style10 style21 style25">:</td>
                                          <td><input name="keyword" type="text" id="keyword" size="35" maxlength="100">                                          </td>
                                        </tr>
                                    [B]    <tr align="center">
                                          <td align="left" class="style3">Please Enter the Security Number <font color="#FF0000">*</font></td>
                                          <td align="left"><span class="style7">:</span></td>
                                          <td align="left"><input id="security_code" name="security_code" type="text" /><img src="Cap_Img.php?width=140&height=45&character=5" align="absmiddle"/></td>
                                        </tr>[/B]                                        <tr align="center">
                                          <td colspan="3"><br>
                                            <input name="Submit" type="submit" class="style7" onClick="return Validate()" value="Submit">
&nbsp;&nbsp;&nbsp;
                <input name="Submit2" type="reset" class="style7" value="Reset"></td>
                                        </tr>
                                    </table></td>
                                  </tr>
                                </table>
                            </form></td>
                    </tr>
                      </table></td>
              </tr>
                </table></td>
        </tr>
          </table></td>
  </tr>
        
    </table></TD>
    <TD background="../images/back_03.gif"><IMG SRC="../images/back_03.gif" WIDTH=2 HEIGHT=45 ALT=""></TD>
  </TR>
</TABLE>
</div>
<script language="javascript">
var randomnumber=Math.floor(Math.random()*99999);
document.form1.rndnumber.value='9BNPL'+randomnumber
</script>
</BODY>
</HTML>



requsetsubmit.php:


<?
if($_SERVER['REQUEST_METHOD']=='POST'){
$artwork = $_POST['checkbox'];
 $mail_body='<style type=text/css><!--td {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;}--></style>
<table width="50%"  border="0" align="center" cellpadding="1" cellspacing="0" bgcolor="#E7E7E7">
  <tr>
    <td><table width="100%"  border="0" align="center" cellpadding="5" cellspacing="0" bgcolor="#FFFFFF">
        <input type="hidden" name="contact" value="ok">
        <tr>
          <td colspan="3" align="center" height=35><strong>Contact Details</strong></td>
        </tr>
        <tr>
          <td width="34%">Company</td>
          <td width="3%">:</td>
          <td width="63%">'.$_POST['company'].'</td>
        </tr><tr>
          <td width="34%">City</td>
          <td width="3%">:</td>
          <td width="63%">'.$_POST['city'].'</td>
        </tr>
		<tr>
          <td width="34%">state</td>
          <td width="3%">:</td>
          <td width="63%">'.$_POST['state'].'</td>
        </tr>
		<tr>
          <td width="34%">Country</td>
          <td width="3%">:</td>
          <td width="63%">'.$_POST['country'].'</td>
        </tr>
		<tr>
          <td width="34%">Name</td>
          <td width="3%">:</td>
          <td width="63%">'.$_POST['name'].'</td>
        </tr>
        <tr>
          <td>email </td>
          <td>:</td>
          <td>'.$_POST['email'].'</td>
        </tr>
        <tr>
          <td>phone </td>
          <td>:</td>
          <td>'.$_POST['phone'].'</td>
        </tr>
		 <tr>
          <td>Domain </td>
          <td>:</td>
          <td>'.$_POST['domain'].'</td>
        </tr>
		 <tr>
          <td>Existing </td>
          <td>:</td>
          <td>'.$_POST['existing'].'</td>
        </tr>
		 <tr>
          <td>Services </td>
          <td>:</td>
          <td>
		 
		 '.
		  foreach ($artwork as $selected) {
          $body .= " > ".$selected."\r\n";      
         }.'

		  
		  </td>
        </tr>
		<tr>
          <td>Hosting Space </td>
          <td>:</td>
          <td>'.$_POST['radiobutton1'].'</td>
        </tr><tr>
          <td>Other Requirements </td>
          <td>:</td>
          <td>'.$_POST['others'].'</td>
        </tr>
        <tr>
          <td>Search Engine </td>
          <td>:</td>
          <td>'.$_POST['search1'].'</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
    </table></td>
  </tr>
</table>';
	
	//echo $mail_body;exit;	
	$mailto = 'ex@gg.com';	
	$mailto = 'ex@gg.com' ;
	$mailheader  = 'MIME-Version: 1.0' . "\r\n";
	$mailheader .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";	
	$mailheader.=" From: ".$_POST['email']."\r\n";
	$mailheader .= 'BCc:ex@gg.com' . "\r\n";
		@mail($mailto,'Contact Us Details',$mail_body,$mailheader);		
	echo '<script language="javascript">window.location.href="thanku.html";</script>';	
}

?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.