SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2008
    Posts
    551
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Passing form fields to action page

    Hi all,

    I am trying to pass the fields from the form page to the action page how do I do I reference them please? (I am going to use them in the action page code where it says ***USD*** and ***CAD***)

    Thank-you





    Form page:
    PHP Code:
    <form action="ws.php" method="get">

    <
    select name="FromCurrency">
    <
    option value=""></option>
    </
    select>
    </
    p>

     

    <
    p>
    <
    select name="ToCurrency">
    <
    option value=""></option>
    </
    select>
    </
    p>


    <
    input type="submit" />
    </
    form






    Action page:


    PHP Code:
    <?php
    require_once 'lib/nusoap.php';

    $oClient   = new nusoap_client(
        
    'http://www.webservicex.net/CurrencyConvertor.asmx?WSDL',
        
    TRUE // Needs to be TRUE because we are using WSDL
    );
    $oResponse $oClient->call(
        
    'ConversionRate',
        array(
            
    'FromCurrency' => '***USD***',
            
    'ToCurrency'   => '***CAD***'
        
    )
    );

     

    $fConversionRate = (float) $oResponse['ConversionRateResult'];
    echo 
    $fConversionRate;
    ?>

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
        array( 
            
    'FromCurrency' => $_GET['FromCurrency'],
            
    'ToCurrency'   => $_GET['ToCurrency']
        ) 

  3. #3
    SitePoint Evangelist
    Join Date
    Mar 2008
    Posts
    551
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks dan!


Bookmarks

Posting Permissions

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