I don't have a SSL for my website, and I need to pass the credit card number from one page to another page. The scenario is like this.
- I will check the credit card number (is that a valid number)
- Then i will post the value to another one page response.php
The post value should be encrypted from index.php and I should be able to decrypt it in the next page (response.php)
<script type="text/javascript"> function validate(payment_form){ var error=""; if(trim(payment_form.credit_card_number.value).length==0){ document.getElementById("credit_card_number_error").innerHTML="Enter Credit Card Number"; error+= false; }else{ if(IsNumeric(payment_form.credit_card_number.value)==false){ document.getElementById("credit_card_number_error").innerHTML="Enter numeric values"; error+= false; } else{ document.getElementById("credit_card_number_error").innerHTML=""; error+= ""; } } if(error==""){ return true; } else{ return false; } } function IsNumeric(strString) { var strValidChars = "0123456789.-"; var strChar; var blnResult = true; if (strString.length == 0) return false; for (i = 0; i < strString.length && blnResult == true; i++) { strChar = strString.charAt(i); if (strValidChars.indexOf(strChar) == -1) { blnResult = false; } } return blnResult; } </script> <form id='payment-form' name="payment_form" onSubmit="return validate(this)" action='response.php' method='POST'> <table> <tr><td>Credit Card Number</td><td><input type="text" placeholder="Credit Card Number" value="" id="credit_card_number" name="credit_card_number"></td><td><label class="error" id="credit_card_number_error"/></td> <tr><td></td><td><input type="submit" value="PAYMENT" class="login" id="payment" name="payment"></td></tr> </table> </form>
To summarize all, I am using a form to post the credit card number and it needs to be encoded and I would be able to decode it in the next page. Is this possible.