Problems with script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kev T

    Problems with script

    Hi,

    OK Bare with me.New to php and trying to figure this out

    I trying to do the follwing. I have apage with a checkbox.. It posts to a
    new page to allow a user to make a paypal order.

    If the extension id say .com I want to display the relevant Paypla Add to
    cart code for a .com extension etc.

    Here is a a sample just to illustrate what Im trying to do. but its not
    working.
    The echos of the $domname and $key are really just to let me see what is
    going on with the vars

    reset($_POST);
    while (list($key, $val) = each($_POST)) {
    echo "$key => $val<br>";
    if ($key == "com" or $key =="net") {
    echo ("register $domname . $key<br>");}

    else {
    if ($key=="co_uk") {
    echo ("register $domname . $key<br>");
    echo ("<form target="paypal"
    action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="image" src="https://www.paypal.com/en_GB/i/btn/sc-but-03.gif"
    border="0" name="submit" alt="Make payments with PayPal - it's fast, free
    and secure!">
    <input type="hidden" name="add" value="1">
    <input type="hidden" name="cmd" value="_cart">
    <input type="hidden" name="business" value="myaccoun t@mydomain.com" >
    <input type="hidden" name="item_name " value="Domain Registration">
    <input type="hidden" name="amount" value="12.95">
    <input type="hidden" name="no_note" value="1">
    <input type="hidden" name="currency_ code" value="GBP">
    </form>"); }
    else {
    $domname=$val;
    echo ("domainname = $domname<br>"); }

    }

    }

    --
    Kev T


Working...