2 Votes Vote

Posting form data to another page and then Posting it again

Posted by topdog 378 days ago Questions| data posting messenger formpost sendsms All

Hi,

I am currently using this code to POST a form's data to https://www.esendex.com/secure/messenger/formpost/SendSMS.aspx:

<script type="text/javascript">

        $(document).ready(function(){
            $("#textnextofkin").validate({
                debug: false,
                rules: {
                    name: "required",
                    email: {
                        required: true,
                        email: true
                    }
                },
                messages: {
                    name: "Please let us know who you are.",
                    email: "",
                },
                submitHandler: function(form) {
                    // do other stuff for a valid form
                    $.post('https://www.esendex.com/secure/messenger/formpost/SendSMS.aspx', $("#textnextofkin").serialize(), function(data) {
                        $('#results').html(data);
                    });
                }
            });
        });

</script>

    <form name="textnextofkin" id="textnextofkin" method="POST" action="">
        <div class="hiddenfields">
            <p>Username:<br>
                <input name="EsendexUsername" type="text" value="example"></p>
            <p>Password:<br>
                <input name="EsendexPassword" type="password" value="example"></p>
            <p>Account:<br>
                <input name="EsendexAccount" type="text" value="EX0065365"></p>
            <p>Send Name<br>
                <input name="EsendexOriginator" type="text" value="example"></p>
            <p>Recipient:<br>
                <input name="EsendexRecipient" type="text" value="01234123456"></p>
            <p>Message:<br>
                <input name="EsendexBody" rows="3" cols="20" value="Hello test message"></p></div>
                <input type="submit" class="email-buttons" name="submit" value="Text next of kin">
    </form>

I need to alter this so that I can POST the form data to process.php instead, and then use process.php to send the information to the Esendex website. I need to do this because process.php contains data I need to include in the form (e.g. $_SESSION['first_name'] ). I suppose I will need to change the Esendex URL above to process.php, but then I don't know what to enter into the process.php page to send the information it recieves.

Could someone please help me to do this?

Thanks for any help

Originally asked by: Daniel H on Stack Overflow

Discuss Bury


Who Voted for this Question