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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    May 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Posting Form with Multiple Actions

    Hi,

    I need a bit of help on an issue.

    I need to post 4 variables to our server from our clients servers so need to implement the page for them.

    So far I have this but cannot get it to parse the data:
    (This is a broken down version of the code)

    Code:
    <form action="https://XXXXX.com/payment.asp?u=&p=&ref=&amount=" method=post target="_parent">
    
    Username:<input type=text size=20 name="u" value="XXXXXX">
    Password: <input type=text size=20 name="p" value="XXXXXX">
    Reference: <input type=text size=20 name="ref" value="XXXXXX">
    Amount: <input type=text size=20 name="amount" value="XXXXXX">
    </form>
    I need to take these fields that are entered and submit them into the url before loading it.

    Any advice please?

  • #2
    Regular Coder
    Join Date
    Dec 2010
    Location
    London
    Posts
    338
    Thanks
    63
    Thanked 11 Times in 11 Posts
    Your 'post' is not in punctuation marks.

    .... method="post" target="_parent"

  • #3
    Regular Coder dan-dan's Avatar
    Join Date
    Aug 2009
    Location
    England
    Posts
    483
    Thanks
    22
    Thanked 79 Times in 78 Posts
    There's also no submit button.

    I'm by no means an expert in forms or scripting, but I'm pretty sure you can't use action in this way. Action should contain the script to process the form, then the form itself will send the data or do whatever else.

    This form would send the data using PHP and header().
    However, sending usernames and passwords over the internet needs to be dealt with properly. What I wrote demonstrates it in its most simplistic form. You need to take real took into internet security.

    PHP Code:
    <?php
    if (isset($_POST['u'])) {
        
    $user $_POST['u'];
        
    $pass $_POST['p'];
        
    $ref $_POST['ref'];
        
    $amount $_POST['amount'];
        
        
    header('location: https://XXXXX.com/payment.asp?u='.$user.'&p='.$pass.'&ref='.$ref.'&amount='.$amount);
    }
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
    <title></title>
    </head>
    <body>
        
        <form action="" method="post">
            Username:<input type="text" size="20" name="u" value="" />
            Password: <input type="text" size="20" name="p" value="" />
            Reference: <input type="text" size="20" name="ref" value="" />
            Amount: <input type="text" size="20" name="amount" value="" />
            <input type="submit" value="Submit" />
            <input type="reset" value="Clear" />
        </form>

    </body> 
    </html>

  • #4
    New to the CF scene
    Join Date
    May 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That was just a sample script but thanks for your replies. Managed to get it to do what I needed it to using a vbscript file before going to said url.

  • #5
    Regular Coder
    Join Date
    Dec 2010
    Location
    London
    Posts
    338
    Thanks
    63
    Thanked 11 Times in 11 Posts
    I'm glad you got it working. Even if you are posting a 'sample' script it still needs to include the correct syntax otherwise it's going to be impossible for anyone to see where the actual problem is


  •  

    Posting Permissions

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