View Full Version : javascr. value -> php - mail() with SSL

02-10-2003, 11:38 PM

in my shop values are transfered to a php send script which uses mail() to send the data.

is there a simple way to do the hand-over from java script to php and the mail() function thru SSL secured connection?

02-11-2003, 01:12 AM
well since javascript can not pass data directly to PHP so ... guessing you are POST'ing the javascript variables to a php page just POST to a https:// etc page ?

that or I don't understand your question which is quite likely :D

02-11-2003, 12:32 PM
yes, the java-script calls the http://...send.php which gets the values from the the java script.

02-12-2003, 10:43 AM
I couldn't tell if you have worked this out or not, so here goes...

It is true that you cannot pass values from javascript to php, but you can if you use hidden forms to store the values in...

<form name="user" action="send.php" method="post">
<input type="hidden" name="cname" value="" />
<input type="hidden" name="csname" value="" />
<input type="hidden" name="creditcard" value="" />

<!-- You will probably want more form fields here -->


<script type="text/javascript">

var came = "Customer Name";
var cname = "Customer Surname";
var ceditcard = "0294898274";

cname.value = came;
csname.value = cname;
creditcard.value = ceditcard;


Now when the form is submitted, the values of the variables are assigned to the hidden form values, which can then be acessed in the normal way.

Hope this helps! :thumbsup: