...

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



a|landargin
02-10-2003, 10:38 PM
hi

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?

firepages
02-11-2003, 12: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

a|landargin
02-11-2003, 11:32 AM
yes, the java-script calls the http://...send.php which gets the values from the the java script.

missing-score
02-12-2003, 09: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 -->

</form>

<script type="text/javascript">
<!--

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

with(document.user){
cname.value = came;
csname.value = cname;
creditcard.value = ceditcard;
}

//-->
</script>

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:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum