Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Feb 2003
    Location
    munich, germany, old europe
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    javascr. value -> php - mail() with SSL

    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?

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,073
    Thanks
    11
    Thanked 98 Times in 96 Posts
    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
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #3
    New Coder
    Join Date
    Feb 2003
    Location
    munich, germany, old europe
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes, the java-script calls the http://...send.php which gets the values from the the java script.

  • #4
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Passing Values

    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!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •