Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

capta code is not working

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

capta code is not working

Postby nehakarnatak » Wed Oct 10, 2012 11:13 pm

<?php



session_start();




<----captcha start---->


if( isset($_POST['submit'])) {



if( $_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'] ) )

// if ( $a=1)

{



// Insert you code for processing the form here, e.g emailing the submission, entering it into a database.



echo 'Thank you. Your message said "'.$_POST['message'].'"';



unset($_SESSION['security_code']);



} else {



// Insert your code for showing an error message here



echo 'Sorry, you have provided an invalid security code';



}







} else {



?>







<html>







<head>







<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">







<title>WEC Sampark Portal-New Registration</title>







<script type="text/javascript">



function stopRKey(evt) {



var evt = (evt) ? evt : ((event) ? event : null);



var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);



if ((evt.keyCode == 13) && (node.type=="text")) {return false;}



}







document.onkeypress = stopRKey;



</script>



<!-- dsable right click -->



<SCRIPT TYPE="text/javascript">



<!--



//Disable right click script



//This disables people from right clicking



var message="Sorry, right-click has been disabled";



///////////////////////////////////



function clickIE() {if (document.all) {(message);return false;}}



function clickNS(e) {if



(document.layers||(document.getElementById&&!document.all)) {



if (e.which==2||e.which==3) {(message);return false;}}}



if (document.layers)



{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}



else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}



document.oncontextmenu=new Function("return false")



// -->



</SCRIPT>

<!--Calander-->

<script language="JavaScript">

<!--

var months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");

var daysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

var days = new Array("S", "M", "T", "W", "T", "F", "S");



today = new getToday();

var element_id;



function getDays(month, year)

{

// test for leap year when February is selected.

if (1 == month)

return ((0 == year % 4) && (0 != (year % 100))) ||

(0 == year % 400) ? 29 : 28;

else

return daysInMonth[month];

}



function getToday()

{

// Generate today's date.

this.now = new Date();

this.year = this.now.getFullYear() ; // Returned year XXXX

this.month = this.now.getMonth();

this.day = this.now.getDate();

}





function newCalendar()

{

var parseYear = parseInt(document.all.year [document.all.year.selectedIndex].text);



var newCal = new Date(parseYear , document.all.month.selectedIndex, 1);

var day = -1;

var startDay = newCal.getDay();

var daily = 0;



today = new getToday(); // 1st call

if ((today.year == newCal.getFullYear() ) && (today.month == newCal.getMonth()))

day = today.day;

// Cache the calendar table's tBody section, dayList.

var tableCal = document.all.calendar.tBodies.dayList;



var intDaysInMonth =

getDays(newCal.getMonth(), newCal.getFullYear() );



for (var intWeek = 0; intWeek < tableCal.rows.length; intWeek++)

for (var intDay = 0;

intDay < tableCal.rows[intWeek].cells.length;

intDay++)

{

var cell = tableCal.rows[intWeek].cells[intDay];



// Start counting days.

if ((intDay == startDay) && (0 == daily))

daily = 1;



// Highlight the current day.

cell.style.color = (day == daily) ? "red" : "";

if(day == daily)

{

document.all.todayday.innerText= "Today: " + day + "/" +

(newCal.getMonth()+1) + "/" + newCal.getFullYear() ;

}

// Output the day number into the cell.

if ((daily > 0) && (daily <= intDaysInMonth))

cell.innerText = daily++;

else

cell.innerText = "";

}



}



function getTodayDay()

{

document.all[element_id].value = today.day + "/" + (today.month+1) +

"/" + today.year;

//document.all.calendar.style.visibility="hidden";

document.all.calendar.style.display="none";

document.all.year.selectedIndex =100;

document.all.month.selectedIndex = today.month;

}



function getDate()

{

// This code executes when the user clicks on a day

// in the calendar.

if ("TD" == event.srcElement.tagName)

// test whether day is valid.

if ("" != event.srcElement.innerText)

{

var mn = document.all.month.selectedIndex+1;

var Year = document.all.year [document.all.year.selectedIndex].text;

document.all[element_id].value=event.srcElement.innerText+"/"+mn +"/" +Year;

//document.all.calendar.style.visibility="hidden";

document.all.calendar.style.display="none";

}

}



function GetBodyOffsetX(el_name, shift)

{

var x;

var y;

x = 0;

y = 0;



var elem = document.all[el_name];

do

{

x += elem.offsetLeft;

y += elem.offsetTop;

if (elem.tagName == "BODY")

break;

elem = elem.offsetParent;

} while (1 > 0);



shift[0] = x;

shift[1] = y;

return x;

}



function SetCalendarOnElement(el_name)

{

if (el_name=="")

el_name = element_id;

var shift = new Array(2);

GetBodyOffsetX(el_name, shift);

document.all.calendar.style.pixelLeft = shift[0]; // - document.all.calendar.offsetLeft;

document.all.calendar.style.pixelTop = shift[1] + 25 ;

}







function ShowCalendar(elem_name)

{

if (elem_name=="")

elem_name = element_id;



element_id = elem_name; // element_id is global variable

newCalendar();

SetCalendarOnElement(element_id);

//document.all.calendar.style.visibility = "visible";

document.all.calendar.style.display="inline";

}



function HideCalendar()

{

//document.all.calendar.style.visibility="hidden";

document.all.calendar.style.display="none";

}



function toggleCalendar(elem_name)

{

//if (document.all.calendar.style.visibility == "hidden")

if(document.all.calendar.style.display=="none")

ShowCalendar(elem_name);

else

HideCalendar();

}

-->

</script>



</head>



<body style="font-family: Arial" bgcolor="#F4FFE4">

<form name="Form_New_Reg_User" action="db_qry/qry_Form_New_Registration.php" enctype="multipart/form-data" method="post" onSubmit="javascript:return validate('Form_New_Reg_User','Mail_Id');">



<table align="center" >







<tr>



<td>



<table align="center" bgcolor="#232323" border="0" cellspacing="0" cellpadding="0" width="1000px" >











<tr>







<td>







<table >







<tr>







<td align="right"><font color="white" size="+1"><strong><span id="clock"></span></font>&nbsp;&nbsp;</td>















</tr>







</table>



















<table align="center" bgcolor="#F4FFE4" width="1000">



<tr>



<td colspan="2" align="left">







<?php







if(isset($_REQUEST['msg'])&&$_REQUEST['msg']=='NewMembrCreate' )







{







echo '<h4 align="center"><font color="blue"> <b><strong>***Your information has been sent for approval.<br> We will contact you soon***</strong> </b></font> </h4>';







}







if(isset($_REQUEST['msg'])&&$_REQUEST['msg']=='MailIdExist' )







{







echo '<h4 align="center"><font color="red"> <b><strong>*** Mail Id already Registered ***</strong> </b></font> </h4>';







}







if(isset($_REQUEST['msg'])&&$_REQUEST['msg']=='MembrExists' )







{







echo '<h4 align="center"><font color="red"> <b><strong>*** User Name already Registered. Please select a new User Name ***</strong> </b></font> </h4>';







}







if(isset($_REQUEST['msg'])&&$_REQUEST['msg']=='PwdNotMatch' )







{



echo '<h4 align="center"><font color="red"> <b><strong>*** Password & Re-enter Password do not match ***</strong> </b></font> </h4>';







}



if(isset($_REQUEST['msg'])&&$_REQUEST['msg']=='BothExist' )







{



echo '<h4 align="center"><font color="red"> <b><strong>*** You have Already Chosen this Username/Mail ID ***</strong> </b></font> </h4>';







}



if(isset($_REQUEST['msg'])&&$_REQUEST['msg']=='NewMembrExists' )







{



echo '<h4 align="center"><font color="red"> <b><strong>*** You have Already Chosen this Username ***</strong> </b></font> </h4>';







}



if(isset($_REQUEST['msg'])&&$_REQUEST['msg']=='NewMailIdExist' )







{



echo '<h4 align="center"><font color="red"> <b><strong>*** You have Already Chosen this Mail ID ***</strong> </b></font> </h4>';







}



?>







</td>







</tr>







<tr bgcolor="#0000CC">







<td align="center" colspan="3"><font color="#FFFFFF"><strong>WEC-IMC SAMPARK - New Registration </strong ></font></td>







</tr>



<tr>







<td colspan="3">











<hr/>











</td>



</tr>



<tr >







<td align="left" >



<strong>



Personal Details <font color="#FF0000"> * </font>



</strong>







</td>



</tr>











<tr>



<td valign="top" align="left">



<table align="center" bgcolor="#F4FFE4" width="500">



<tr>



<td width="44%">Title</td>







<td width="56%"><select name="Title" style="width:80" Title="Please select your Title from Drop down list" >

<option value ="000" selected> Title</option>

<option value ="Mr"> Mr</option>



<option value ="Ms">Ms</option>



<option value ="Dr">Dr</option>



<option value ="Prof">Prof</option>







</select>







</td>







</tr>











<tr>







<td>First Name</td>







<td><input type="text" name="First_Name" value="" maxlength="40" size="30"/></td>







</tr>







<tr>







<td>Middle Name</td>







<td><input type="text" name="Middle_Name" value="" maxlength="40" size="30"/></td>







</tr>















<tr>







<td>Last Name</td>







<td><input type="text" name="Last_Name" value="" maxlength="40" size="30"/></td>







</tr>



<tr>







<td>Gender</td>







<td>









<input type="radio" name="Gender" value="Male" >



M &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;



<input type="radio" name="Gender" value="Female">



F

















</td>







</tr>







<tr>







<td>Date of Birth<br>



<br></td>







<td>





<input type= "text" id="Dateofbirth" name="Dateofbirth" size="20" readonly="true" title=" Please click on aero to select the Date of Birth"/>

<a href="JavaScript:;" onClick="toggleCalendar('Dateofbirth')">

<img src="/crm/images/cal.jpg" height="15" width="17" title="click here to select your DOB"> </img> </a>





</td>







</tr>







</table>



</td>



<td valign="top" align="left">



<table align="center" bgcolor="#F4FFE4" border="1">



<tr>



<td height="120" width="30">

<input name="MAX_FILE_SIZE" value="10000000" type="hidden">



<input type="file" name="image_filename" id="image_filename" accept="image/jpeg/.gif/.png " value="Upload Photograph" Title="please choose 'jpeg/.gif/.png ' image only "/>







</td>







</tr>



<tr>

<td >Upload Photo</td>

</tr>



</table>



</td>



</tr>







<tr>







<td colspan="3">











<hr/>











</td>



</tr>



<tr >



<td align="left" >



<strong>



Contact Details



</strong>



</td>



</tr>



<tr>



<td>



<table align="center" bgcolor="#F4FFE4" width="500">



<tr>



<td width="214">Mail Id <font color="#FF0000">* </font></td>







<td width="274"><input type="email" name="Mail_Id" value="" maxlength="40" size="30" /></td>











<tr>







<td>Phone(Residence)</td>







<td><input type="decimal" name="Res_No" value="" maxlength="13" size="30" onFocus="if(this.value=='N/A')this.value='';"/></td>







</tr>







<tr>







<td>Fax</td>







<td><input type="decimal" name="Fax_No" value="" maxlength="13" size="30" onFocus="if(this.value=='N/A')this.value='';"/></td>







</tr>











</table>



</td>



<td>



<table align="center" bgcolor="#F4FFE4" width="500">



<tr>











<td>Mobile Number</td>








<td><input type="decimal" name="Mob_No" value="" maxlength="13" size="30"/></td>







</tr>







<tr>







<td>Phone(Office)</td>







<td><input type="decimal" name="Office_No" value="" maxlength="13" size="30" onFocus="if(this.value=='N/A')this.value='';"/></td>











</tr>



<tr>







<td>Alternate Number</td>









<td><input type="decimal" name="Alt_No" value="" maxlength="13" size="30" onFocus="if(this.value=='N/A')this.value='';"/></td>











</tr>



</table>



</td>



</tr>



<tr>







<td colspan="3">











<hr/>











</td>



</tr>



<tr>



<td colspan="3">



<strong>



Address



</strong>



<br>







</td>



</tr>











<tr>



<td>



<table align="center" bgcolor="#F4FFE4" width="500">



<tr>



<td width="219"><b>Office</b></td>















</tr>







<tr>







<td> Address Line 1 </td>







<td width="269"> <input type= "text" name="address1" maxlength="30" size="30"/></td>







</tr>















<tr>







<td> Address Line 2 </td>







<td><input type="text" name="address2" maxlength="30" size="30" /></td>







</tr>















<tr>







<td>City </td>







<td><input type= "text" name="city" maxlength="30" size="30"/></td>







</tr>















<tr>







<td> State </td>







<td><input name="state" type="text" value="" maxlength="30" size="30"></td>







</tr>















<tr>







<td> Zip Code </td>







<td><input name="zip" type="decimal" value="" maxlength="30" size="30"></td>







</tr>















<tr>







<td> Country </td>







<td><select name="Country" style="width: 200" title="Please Select Country" >







<option value="" selected> Please Select Country</option>







<?php















include("/crm/connect_wec.php");















$query3 = "SELECT DISTINCT `country`







FROM country ";















$result3= mysql_query($query3);







$cnt3 = mysql_num_rows($result3);















if ($cnt3 != 0)







{















while($row3 = mysql_fetch_array($result3))







{







echo "<option value = '{$row3['country']}'> {$row3['country']}</option>";















}







echo "</select>";







}















?>







</select>







</td>







</tr>



</table>



</td>



<td>



<table align="center" bgcolor="#F4FFE4" width="500">







<tr>







<td width="202"><b>Residence </b></td>















</tr>







<tr>







<td>Address Line 1 </td>







<td width="286"> <input type= "text" name="address1_res" maxlength="30" size="30"/></td>







</tr>

















<tr>







<td> Address Line 2 </td>







<td><input type="text" name="address2_res" maxlength="30" size="30" /></td>







</tr>















<tr>







<td> City </td>







<td><input type= "text" name="city_res" maxlength="30" size="30"/></td>







</tr>















<tr>







<td> State </td>







<td><input name="state_res" type="text" value="" maxlength="30" size="30"></td>







</tr>















<tr>







<td> Zip Code </td>







<td><input name="zip_res" type="decimal" value="" maxlength="30" size="30"></td>







</tr>















<tr>







<tr>







<td> Country </td>







<td><select name="Country_res" style="width: 200" title="Please Select Country" >







<option value ="" selected> Please Select Country</option>







<?php







include("/crm/connect_wec.php");











$query3 = "SELECT DISTINCT `country`







FROM country ";











$result3= mysql_query($query3);







$cnt3 = mysql_num_rows($result3);















if ($cnt3 != 0)







{



while($row3 = mysql_fetch_array($result3))







{







echo "<option value = '{$row3['country']}'> {$row3['country']}</option>";











}







echo "</select>";







}















?>







</select>







</td> </tr>















</table>



</td>



</tr>



<tr>







<td colspan="3">











<hr/>











</td>



</tr>



<tr>



<td>







<b>



Professional Details



</b>







</td>



</tr>



<tr>



<td>



<table align="center" bgcolor="#F4FFE4" width="500">



<tr>







<td width="222">Organistion<br>



<br></td>







<td width="266"><input type="text" name="Company" value="" maxlength="400" size="30" onFocus="if(this.value=='N/A')this.value='';"/></td>







</tr>



<tr >







<td>Designation</td>







<td><input type="text" name="Designation" value="" maxlength="400" size="30" onFocus="if(this.value=='N/A')this.value='';"/></td>







</tr>







<tr>



<tr>







<td>Area of Interest</td>


<td>


<select name="Area_of_Interest[ ]" multiple style="width: 200" title="You can select More than one Areas of Interest" >







<!--<option value ="Select"> Please Select Area of Interest</option>-->







<?php















include("/crm/connect_wec.php");















$query2 = "SELECT DISTINCT `Area_of_Interest`







FROM area_of_interest ";















$result2= mysql_query($query2);







$cnt2 = mysql_num_rows($result2);















if ($cnt2 != 0)







{















while($row2 = mysql_fetch_array($result2))







{







echo "<option value = '{$row2['Area_of_Interest']}'> {$row2['Area_of_Interest']}</option>";


















}







echo "</select>";







}















?>







</select>















</td>







</tr>







<tr>







<td>Academic Qualification</td>







<td><input type="text" name="Academic_Qulification" value="" maxlength="40" size="30" onFocus="if(this.value=='N/A')this.value='';"/></td>







</tr>







<tr>







<td>Studies/International Papers</td>







<td><textarea name="Studies" value="" maxlength="100" rows="5" cols="22" onFocus="if(this.value=='N/A')this.value='';"/></textarea> </td>







</tr>







<tr>







<td>Profile</td>







<td><textarea name="Profile" value="" maxlength="150" rows="5" cols="22" onFocus="if(this.value=='N/A')this.value='';"/></textarea></td>







</tr>











</table>



</td>



</tr>











<tr>



<td>



<table align="center" bgcolor="#F4FFE4" width="500">



<tr>



<td width="224"><font color="#FF0000">* </font>User Name</td>







<td width="264"><input type="text" name="User_Name" value="" maxlength="400" size="30"/></td>







</tr>







<tr>







<td><font color="#FF0000">* </font>Password</td>







<td><input type="Password" name="Password" value="" maxlength="30" size="30"/></td>







</tr>



<tr>







<td><font color="#FF0000">* </font>Re Enter Password</td>







<td><input type="Password" name="RePassword" value="" maxlength="20" size="30"/></td>







</tr>











<tr>







<td><font color="#FF0000">* </font>Security



image</td>







<td>







<input id="security_code" name="security_code" type="text" />



<img src="/crm/CaptchaSecurityImages.php?width=100&height=40&characters=5" />



</tr>











<td></td>







<td ><br>















<input name='Submit' type='Submit' value='Submit'/>







<input name='Reset' type='Reset' value='Reset' /></td >







</tr>



</table>



</td>



</tr>



</table>



















</form>





<TABLE bgColor=#ffffff border=1 cellPadding=0 cellSpacing=3 id=calendar style="DISPLAY: none; POSITION: absolute; Z-INDEX: 4">

<TBODY>

<TR>

<TD colSpan=7 vAlign=center>

<!-- Month combo box -->

<SELECT id=month onchange=newCalendar()>

<SCRIPT language=JavaScript>

// Output months into the document.

// Select current month.

for (var intLoop = 0; intLoop < months.length; intLoop++)

document.write("<OPTION " + (today.month == intLoop ? "Selected" : "") + ">" + months[intLoop]);

</SCRIPT>

</SELECT>

<!-- Year combo box -->

<SELECT id=year onchange=newCalendar()>

<SCRIPT language=JavaScript>

// Output years into the document.

// Select current year.

for (var intLoop = 1920; intLoop < 2028; intLoop++)

document.write("<OPTION " + (today.year == intLoop ? "Selected" : "") + ">" + intLoop);

</SCRIPT>

</SELECT>



</TD>

</TR>







<TR class=days>

<!-- Generate column for each day. -->

<SCRIPT language=JavaScript>

// Output days.

for (var intLoop = 0; intLoop < days.length; intLoop++)

document.write("<TD>" + days[intLoop] + "</TD>");

</SCRIPT>

</TR>





<TBODY class=dates id=dayList onClick="getDate('')" vAlign=center>

<!-- Generate grid for individual days. -->

<SCRIPT language=JavaScript>

for (var intWeeks = 0; intWeeks < 6; intWeeks++)

{

document.write("<TR>");

for (var intDays = 0; intDays < days.length; intDays++)

document.write("<TD></TD>");

document.write("</TR>");

}

</SCRIPT>



<!-- Generate today day. --></TBODY>

<TBODY>

<TR>

<TD class=today colSpan=5 id=todayday onclick=getTodayDay()></TD>

<TD align=right colSpan=2><A href="javascript:HideCalendar();"><SPAN style="COLOR: black; FONT-SIZE: 10px"><B>Hide</B></SPAN></A></TD>

</TR>

</TBODY>



</TABLE>

</body>













</html>



<?php



}



?>







<!--script for validation-->



<!--script for validation-->







<script src="/crm/Code/Validation/gen_validatorv4.js" type="text/javascript"></script>







<!--validation script end-->















<script type="text/javascript">







var frmvalidator = new Validator("Form_New_Reg_User");

frmvalidator.addValidation("Title","dontselect=000");

// frmvalidator.addValidation("title","req","Please Select the Title !");







frmvalidator.addValidation("First_Name","req","Please enter First Name !");



frmvalidator.addValidation("First_Name","maxlen=40","Max length for First Name is 40");







frmvalidator.addValidation("Last_Name","req","Please enter Last Name !");



frmvalidator.addValidation("Last_Name","maxlen=40","Max length for Last Name is 40");

frmvalidator.addValidation("Gender","selone");

frmvalidator.addValidation("Mail_Id","req","Please enter Mail Id !");



//frmvalidator.addValidation("Country","dontselect=Select") ;

frmvalidator.addValidation("User_Name","req","Please enter User Name !");







frmvalidator.addValidation("Password","req","Please enter Password !");



frmvalidator.addValidation("RePassword","req","Please re-enter Password !");



frmvalidator.addValidation("RePassword","eqelmnt=Password","The confirmed password is not same as password");




frmvalidator.addValidation("security_code","req","Please enter Security Code !");







frmvalidator.addValidation("Designation","Please enter Designation or N/A !");







frmvalidator.addValidation("Designation","maxlen=400","Max length for Designation is 400");







frmvalidator.addValidation("Company","Please enter Company or N/A !");







frmvalidator.addValidation("Mob_No","Please enter Mobile Number !");

























frmvalidator.addValidation("Mob_No","decimal");















frmvalidator.addValidation("Lnd_No","Please enter Landline Number or N/A !");







frmvalidator.addValidation("Alt_No","Please enter Alternate Number or N/A !");







frmvalidator.addValidation("Ofc_Addr","Please enter Office Address or N/A !");







frmvalidator.addValidation("Res_Addr","Please enter Residence Address or N/A !");















</script>















<!--Live clock script -->







<script src="/crm/Code/Live_Date_Script/Live_Date_Script.js" type="text/javascript"></script>



<!--script for calander-->



<script language="javascript" src="/crm/Code/calendar/cal2.js"></script>



<script language="javascript" src="/crmCode/calendar/cal_conf2.js"></script>



<!--script for calander-->







<!--Live clock script -->



<script src="Code/Live_Date_Script/Live_Date_Script.js" type="text/javascript"></script>



<!--Live clock script end-->



<!--Live clock script end-->



<!--validation script end-->







<!--Live clock script -->
nehakarnatak
New php-forum User
New php-forum User
 
Posts: 11
Joined: Tue Feb 28, 2012 10:06 pm

Re: capta code is not working

Postby seandisanti » Thu Oct 11, 2012 8:01 am

wow. edit your post, put code tags around your code, and please explain what you mean by "not working". If you're getting an error message, please share it so someone can explain it, etc.
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 773
Joined: Mon Oct 01, 2012 12:32 pm


Return to PHP coding => General

Who is online

Users browsing this forum: Google Feedfetcher and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron