<?php <br mode="hold" /?>session_start(); if( isset($_POST['Submit'])) { if( $_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'] ) ) { // 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'].'"'; echo "<script>alert('Thank you. Your message said.....')</script>"; echo "<script type='text/javascript'> alert('".json_encode($_SESSION['security_code'])."'); </script>"; unset($_SESSION['security_code']); } else { // Insert your code for showing an error message here echo 'Sorry, you have provided an invalid security code'; echo "<script>alert('Sorry, you have provided an invalid security code')</script>"; } } else { ?> <tr> <td height="50" valign="top"> </td> <td valign="top"><img src="CaptchaSecurityImages.php?width=100&height=40&characters=5" /></td> </tr> <tr> <td height="30" valign="top">Security Code:<span class="required" style="color:#93B928;">*</span></td> <td valign="top"><input id="security_code" name="security_code" type="text" style="width:100px;"/></td> </tr> <tr> <td height="50" valign="top"> </td> <td valign="top"><input class="button" name="Submit" value="Send" type="submit" /></td> </tr> } ?>
function form_validation() { hh=document.WebToLeadForm; if(!hh.security_code.value==""){ var a = <?php echo $_SESSION['security_code']; ??> alert("Please wait to check for match"); return false; }
$data='some data'; ?> <script> var data="<?php echo $data??>"; //if there is new line you need to do extra care :D </script>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)