HTML - Help With Inserting Math Captcha In Registration Form
ah sorry i think this should be in php thread
Hi, im trying to have a math captcha in my registration form, but having trouble with setting it up in my form. sorry for the large code. If i change the value of $_POST['Submit'] to something else like $_POST['Submit1'] and then same for the math image captcha then it works, but i would like it to work as part of the form, makes sense? lol right now the form just posts the value and doesnt check for captcha values! if someone could help me out here that would be great! thank you. <?php if(isset($_POST['Submit'])){ if($_POST['Submit'] != $_SESSION['security_number']) { $error = ""; } else { $error = ""; } //NEED TO CHECK IF FIELDS ARE FILLED IN if( empty($_POST['name']) && (empty($_POST['email']))){ header("Location:Messages.php?msg=3"); exit(); } if( empty($_POST['pw1']) && (empty($_POST['pw2']))){ header( "Location:Messages.php?msg=4" ); exit(); } $name=$_POST['name']; $email=$_POST['email']; $pw1=$_POST['pw1']; $pw2=$_POST['pw2']; if("$pw1" !== "$pw2" ){ header( "Location:Messages.php?msg=5" ); exit(); } $ip = $_SERVER['REMOTE_ADDR']; //connect to the db server , check if uname exist include('config.php'); $query1=("Select * from user where email='$email'"); $result1= mysql_query($query1); $num1=mysql_num_rows($result1); if ($num1 > 0) {//Email already been used header( "Location:Messages.php?msg=11" ); exit(); }else{ $query=("Select * from user where uname='$name'"); $result= mysql_query($query); $num=mysql_num_rows($result); if ($num > 0) {//Username already exist header( "Location:Messages.php?msg=6" ); exit(); }else{ //if username does not exist insert user details $query=( "INSERT INTO user (uname, pw,email,date_joined,ip,level) VALUES ('$name',md5('$pw1'),'$email',NOW(),'$ip','Normal')"); if (@mysql_query ($query)) { header("location:login.php?reg=1"); exit; } } } mysql_close(); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html><!-- InstanceBegin template="/Templates/Auth.dwt.php" codeOutsideHTMLIsLocked="false" --> <head> <!-- InstanceBeginEditable name="doctitle" --> <title>Registration</title> <!-- InstanceEndEditable --> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <!-- InstanceBeginEditable name="head" --> <!-- InstanceEndEditable --> <link href="styleLog.css" rel="stylesheet" type="text/css"> <script language="javascript" type="text/javascript"> function reloadCaptcha() { document.getElementById('captcha').src = document.getElementById('captcha').src+ '?' +new Date(); } </script> </head> <body> <table width="100%" border="0" cellspacing="7" cellpadding="0"> <tr class="temptitle"> <td><!-- InstanceBeginEditable name="EditRegion4" -->New User Registration <!-- InstanceEndEditable --></td> </tr> <tr> <td><!-- InstanceBeginEditable name="EditRegion3" --> <form name="form1" action="register.php" method="post"> <table width="657" border="0"> <tr> <td width="122"><div align="left">Name</div></td> <td width="525"><input name="name" type="text" size="40"></td> </tr> <tr> <td><div align="left">Email</div></td> <td><input name="email" type="text" size="40"></td> </tr> <tr> <td><div align="left">Password</div></td> <td><input name="pw1" type="password" size="40"></td> </tr> <tr> <td ><div align="left">Confirm Password </div></td> <td><input name="pw2" type="password" size="40"></td> </tr> <tr> <td><img src="math_captcha/image.php" alt="Click to reload image" title="Click to reload image" id="captcha" onclick="javascript:reloadCaptcha()" /></td> <td><input type="text" name="Submit" value="what's the result?" onclick="this.value=''" /></td> <td> </tr> <tr> <td></td> <td> <input name="Submit" type="submit" value="Register"></td> </tr> </table> </form> <?=$error?> Similar TutorialsHi I want to add a CAPTCHA to my contact form as i have been getting hit badly by spammers was wondering if any one could give me some advice or script on how to do that....thanks in advance I am having a problem adding captcha to this form. I am looking at tutorials but are even more confused by them please help.
HTML Code: <head> <link rel=stylesheet href="stylesheet2004.css" type="text/css"> <script language="javascript" src="hide.js" type="text/javascript"></script> <script type="text/javascript"> <!-- function MM_validateForm() { //v4.0 if (document.getElementById){ var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments; for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]); if (val) { nm=val.name; if ((val=val.value)!="") { if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@'); if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n'; } else if (test!='R') { num = parseFloat(val); if (isNaN(val)) errors+='- '+nm+' must contain a number.\n'; if (test.indexOf('inRange') != -1) { p=test.indexOf(':'); min=test.substring(8,p); max=test.substring(p+1); if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n'; } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; } } if (errors) alert('The following error(s) occurred:\n'+errors); document.MM_returnValue = (errors == ''); } } <script language="JavaScript"> // Code for validating the form // Visit http://www.javascript-coder.com/html-form/javascript-form-validation.phtml // for details var frmvalidator = new Validator("contact_form"); //remove the following two lines if you like error message box popups frmvalidator.EnableOnPageErrorDisplaySingleBox(); frmvalidator.EnableMsgsTogether(); frmvalidator.addValidation("name","req","Please provide your name"); frmvalidator.addValidation("email","req","Please provide your email"); frmvalidator.addValidation("email","email","Please enter a valid email address"); </script> <script language='JavaScript' type='text/javascript'> function refreshCaptcha() { var img = document.images['captchaimg']; img.src = img.src.substring(0,img.src.lastIndexOf("?"))+"?rand="+Math.random()*1000; } </script> //--> </script> <script language="javascript" src="emailvalidation.js" type="text/javascript"></script> </head> <body> width="386" height="65" border="0"></div></nobr> <table border="0" width="770" cellspacing="0" cellpadding="0" align="center"> </tr> </table> <table border="0" width="770" cellspacing="0" cellpadding="0" align="center"> <tr> <td id="navigation" valign="top" width="155"> <!-- navigation--> <script language="javascript" src="navigation.js" type="text/javascript"></script> <noscript> <div class="nav"><a href="/instruments/index.html">Products</a></div> <div class="nav"><a href="/applications/index.html">Applications Gallery</a></div> <div class="nav"><a href="/downloads.html">Product Literature</a></div> <div class="nav"><a href="/order.html">How to Order</a></div> <div class="nav"><a href="/about.html">About Mark-10</a></div> <div class="nav"><a href="/contact.html">Contact Us</a></div> <div class="nav"><a href="/faq.html">Frequent Questions</a></div> <div class="nav"><a href="/distributor.html">Distributors</a></div> <div class="nav"><a href="/tools/angle.html">Conversion Calculators</a></div> <div class="nav"><a href="/list.html">Join Mailing List</a></div> <div class="nav"><a href="/index.html">Home</a></div></noscript> <!-- end navigation--> </td> <td id="spacer" class="divid"><img src="images/spacer.gif" alt="" width="11" height="1" border="0"></td> <td id="content_table"> <h1>INQUIRIES</h1> <p>Thank you for taking an interest in Mark-10 force and torque measurement products. If you have any specific questions or an application for which you would like us to recommend a solution, please complete the appropriate fields below. If you wish to receive our latest catalog and/or be added to our mailing list, please check the appropriate boxes below.</p> <p> </p> <FORM id="frmCaptcha" NAME="frmCaptcha" METHOD="POST" action="http://www.mark-10.com/cgi-bin/mailto" style="padding:0px; margin:0px;"> <INPUT TYPE="hidden" NAME="RECIPIENT" VALUE="info@mark-10.com"> <INPUT TYPE="hidden" NAME="subject" VALUE="Mark-10 Web Submit Form"> <INPUT TYPE="hidden" NAME="THANKURL" VALUE="http://www.mark-10.com/thankyou-inquiry.html"> <input type="hidden" name="identicalfields" value="Email,Emailconfirm"> <table border="0" cellpadding="2" style="border-collapse: collapse" bordercolor="#111111" width="600" height="493"> <tr> <tr> <td width="131" height="22" colspan="2" align="right">*Name:</td> <td height="22" colspan="2" onfocus=><input type="text" name="Name" id="Name"></td> </tr> <tr> <td width="131" height="22" colspan="2" align="right"><font size="2">Title:</font></td> <td colspan="2" height="22"><input name="Title" type="text" size="41"></td> </tr> <tr> <p style="width:300px; text-align:right;"> <td colspan="2" style="text-align: right"> *Email:</td> <td height="22" colspan="2" align="left"><input type="text" name="Email" id="Email"></td> </tr> <tr> <td width="131" height="22" colspan="2" align="right">*Confirm Email: </td> <td height="22" colspan="2" align="left"><input type="text" name="Emailconfirm" size="22" id="Emailconfirm"></td> </tr> <tr> <td width="131" height="22" colspan="2" align="right"><font size="2">Company: </font></td> <td colspan="2" height="22"><input name="Company" type="text" size="41"></td> </tr> <tr> <td width="131" height="22" colspan="2" align="right"><p align="left" style="text-align: right; margin-top: 0; margin-bottom: 0"> Industry:</td> <td colspan="2" height="22"><input name="Industry" type="text" size="41"></td> </tr> <tr> <td width="131" height="22" colspan="2" align="right"><font size="2">*Address:</font></td> <td colspan="2" height="22"><input name="Address1" type="text" id="Address1" size="53"></td> </tr> <tr> <td width="131" height="22" colspan="2" align="right">*<font size="2">City:</font></td> <td colspan="2" height="22"><input name="City" type="text" id="City" size="30"></td> </tr> <tr> <td width="131" height="22" colspan="2" align="right"><font size="2">*State/Province:</font></td> <td colspan="2" height="22"><input name="State" type="text" id="State" size="30"></td> </tr> <tr> <td width="131" height="22" colspan="2" align="right"><font size="2">*Zip / Postal Code:</font></td> <td colspan="2" height="22"><input name="Zip" type="text" id="Zip" size="30"></td> </tr> <tr> <td width="131" height="22" colspan="2" align="right"><font size="2">Country:</font></td> <td colspan="2" height="22"><input name="Country" type="text" size="30"></td> </tr> <tr> <td width="131" height="22" colspan="2" align="right"><font size="2">Telephone:</font></td> <td width="202" height="22"><input name="Tel" type="text" size="30"></td> <td width="247" height="22"><font size="2">Ext: </font> <input name="Ext" type="text" size="9"></td> </tr> <tr> <td width="131" height="22" colspan="2" align="right"><font size="2">Fax:</font></td> <td colspan="2" height="22"><input name="Fax" type="text" size="30"></td> </tr> <tr> <td width="131" height="75" colspan="2" align="right"><p style="text-align: right; margin-top: 0; margin-bottom: 0"><font size="2"> Application </font></p> <p style="text-align: right; margin-top: 0; margin-bottom: 0"><font size="2"> or Question:</font> <p> </td> <td colspan="2" height="75"><textarea name="Application" style="width:425px; height: 75px;" rows="1" cols="20"></textarea></td> </tr> <tr> <td width="131" height="6" colspan="2" align="right"></td> <td colspan="2" height="6"><input type="checkbox" name="SendCatalog" value="Yes"> <font size="2"> Send me your latest catalog</font></td> </tr> <tr> <td height="34" colspan="2" align="right"> </td> <td colspan="2" height="34"><input type="checkbox" name="AddToMailingList" value="Yes"> <font size="2"> Add me to your mailing list</font></td> </tr> <tr> <td height="34" colspan="2" align="right"> </td> <td colspan="2" height="34"> <img id="imgCaptcha" src="create_image.php" /> <label for="message"><br> Enter the code above here :</label> <input id="txtCaptcha" type="text" name="txtCaptcha" value="" maxlength="10" size="32" /></td> </tr> <tr> <td height="34" colspan="2" align="right"> </td> <td colspan="2" height="34"><input id="btnCaptcha" type="button" value="Captcha Test" name="btnCaptcha" onClick="MM_validateForm('Name','','R','Email','','RisEmail','Emailconfirm','','RisEmail','Address1','','R','City','','R','State','','R','Zip','','R');return document.MM_returnValue; return ErrorCheck(); getParam(document.frmCaptcha)" value="Submit"> <input type="reset" value="Clear" name="Reset"></td> </tr> </table> </form></td> </tr> </table> <br> <table cellspacing="2" width=525 border=0 celpadding="3"> </table> </FORM> </body> The contactus page currently sends data to 3 email addresses. I dont verify these fields currently but wish to do so. I merely have them sent to feedback.php which accepts the data and sends the emails. I want two things done where I need help: 1, I need all fields to be validated in the contactus page itself before going to the feedback.php file 2, I want a simple captcha that can also be verified on contactus.php itself. Can someone help? Thanks Navs We currently have a feedback form (feedback.php) that is used in our contactus page. This gets sent to three email address. I now want to add a captcha to it and create a verification for all the fields in the contactus page itself I have been working on building my own website for about two weeks now, and I am trying to make a registration form to allow new users access to the private aspects of my website, such as my FTP server. I have the HTML outline for my registration form here. What I want to have it do is one of two things: either send me an email with the new users information (without using an email client, so no action="mailto:default@email.com"), or save the new users information to a file on my server (this is preferred, but I have no clue how to use php or asp). Could somebody please help me figure this out? It would be greatly appreciated. -CLiB Hello peeps, I need badly quick a html registration form code or something i can implent easy in my html code. I need a registration form, when the user fills in the info and press OK, that those info are sent to my email and that the user gets an email with THANK YOU for joining! See the Attach file for the registration form how it needs to look like! Hope someown can help me with this. Thanks! Hello, I have three courses, .net, j2ee, php with starting dates like 12-01-2007, 13-01-2007, 14-01,2007, the courses will be displayed in drop down box. the question is how to write the html code for this logic, if a user select .net then its starting date should be displayed i.e, 12-01-2007, if a user select j2ee then its starting should be displayed i.e, 13-01-2007. Any help in this matter. Thanks. Greetings from Kalyan Hi all, I need a registration form the fields are like Name Mobile Address and when i click on submit button these details will be saved in a text file. I am new to html coding. Please help me regarding this. Thanks P Kalyan Kumar Hey guys i need a bit of help i have been looking for a snippet of code to add to my site which will allow my users to register an email from my domain [eg:username@mydomain.com] if anyone would be so kind as to steer me in the right direction Any help would be greatly appreciated. Timmy Would like to use CAPTCHA or something on my web site instead of simply providing a contact email address. I'm interested in suggestions or a simple CAPTCHA type solution, recommendation or script. Thank you. Can anyone point me to a (free or commercial) advanced registration template? (only the HTML/css/Javascript client side part) By advanced I mean: 1. Every form is confirmed to be valid and passwords lengths are checked and compared to be the same error messages are displayed client-side. 2. Some form of a bar indicating how strong the password is. (although not required) 3. The form is sent using Javascript without leaving the page. Thanks in advance, Regards. hey guys...how can we introduce registration process in our website.... please give details coz i dunno anything about it.... Hey, i was wondering if anyone can help me, Ive made a website on angelfire, free hosting at the moment, and i want to create a 'register' form..so people can become members, before viewing a certain part of my site. I dont have a clue how to go about this, so if anyone can explain, im very grateful. thanks. I have dreamweaver cs3 if thats needed? but ive never used it..so i dont have a clue I am just learning how to do HTML & I want to do a login page for my final website. I need the HTML code with ALL directions on where to put it what to change so the things save to somewhere, how to direct the page so after you hit "Login" it will go to another page. I want the most simple codes possible, ty I have a client that would like to have an online registration setup on his website. It is a fitness website in which he would like the client to enter some basic information and pay online for the classes. I have a basic knowledge of HTML so if someone could lead me in the right direction it would be greatly appreciated. Thanks in advance. Hi, Wondering what are some good ways to restrict access to files / links for a visitor until they have registered their details... for example, when a user tries to access a certain file from a download page, they click on the file link >> I want to send them to a registration page (a simple form), and - only once they've filled it out and submitted their details - to send them back to the download page with unrestricted access to that file (or any other resitrcted files). Any suggestions / pointers would be greatly appreciated. Thanks, Hi, I wish to insert the same HTML code into every page as it is the code for a Menu Bar which will need to be changed. How would i go about this? Thanks Henry This might get a laught or two but how do I insert an affiliate link into an eBook that will be a PDF. All I have are html links and javascript links. Thanks in advance... Hi, I hope I am posting this in the right place. I would like to insert the <h> tags to headings & sub headings in certain areas of a web page. But if I place the <h> tag next to the word or phrase that is relevant, it increases the font size. Am I ok to have the code like below or will the SE’s read everything between the tags, including the code & confuse the whole thing. Its just a case of wanting to not have the text as large as some of the <h> tags want to make it. <center><h1><font face="arial" size="3" color="000000"><b>My text here</b></font></h1></center> Hope you can help! Many thanks. Chris. I am new to html, and I am trying to add images, this is what I have been typing to get my img, but i doesn't work. <body> <img src="imagename.jpg"> </body> the web browser knows there is supposed to be an image but it broken picture image where the picture is supposed to be. Anybody know what I am doing wrong, i have tried loading it on both firefox and IE. thanks for your help in advance Jesse bjr 2 created a site ac XHTML / CSS Oh sorry, here is no Sms :p Hello =) I try to create a site with XHTML / CSS, for now, I'm doing pretty good! No luck, to insert the banner hangs her: / I insert this code: Citation Code: <Div id = "<img src="images/hawai.jpg" alt="Photo Hawaii" /> <! - Here we put the banner -> </ Div> <div id="menu"> <! - Here we will put the menu -> </ Div> <div id="corps"> <! - Here we put the main content of the page (all text what) -> </ Div> <div id="pied_de_page"> <! - Finally, we will down the page the name of the author, copyright ... -> </ Div> (Example teo21 @ m) But nothing happens! So, hoping you can help me: / Regards! |