Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • King Bosnia: Any recommendations to private servers?
      October 18, 2018, 04:47:35 PM
    • FightMexoxo: oi i have the files if anyone whats em
      October 18, 2018, 12:44:42 AM
    • The Wanderer: Whoops
      October 15, 2018, 12:56:18 AM
    • The Wanderer: Making own operating system
      October 15, 2018, 12:56:11 AM
    • Travas: no
      October 07, 2018, 04:03:36 PM
    • Saltyspade10: Server still up and running?
      October 05, 2018, 07:13:41 PM
    • Wesam: Can someone upload moparscape.jar?
      October 05, 2018, 11:43:43 AM
    • Ligoe: yo
      September 30, 2018, 12:48:15 PM
    • Ligoe: how come i can't login the game
      September 30, 2018, 12:48:03 PM
    • fuzzout: Anybody here with experience in using Luna source? I'm looking to develop something, but can't seem to get any of my clients to work with it...
      September 26, 2018, 10:47:27 AM
    • `Discardedx2`: ?
      September 21, 2018, 12:24:09 PM
    • Pookey71: ARE YOU HERE TO RECEIVE MY LIMP PENIS!?
      September 20, 2018, 11:55:24 PM
    • Pookey71: THIS IS DEMOCRACY MANIFESTO
      September 20, 2018, 11:55:07 PM
    • Vasi28: Гранд
      September 03, 2018, 07:06:22 PM
    • Rash: test
      August 30, 2018, 09:09:18 PM
    • Guruu:[link]
      August 30, 2018, 12:04:45 AM
    • Guruu: am i allowed to post links shoutbox?
      August 30, 2018, 12:03:46 AM
    • drubrkletern:[link] feedback wanted
      August 28, 2018, 03:55:17 PM
    • bugz000: Anyone got a link for the old ass silab client and cache.zip? from mopar 3.2 era :) 317
      August 25, 2018, 12:48:15 AM
    • cholland2015: Does anyone know where I can download the old moparscape client/server?
      August 24, 2018, 02:30:51 PM

    Author Topic: PHP Help please.  (Read 1003 times)

    0 Members and 1 Guest are viewing this topic.

    OfflineVenge Drop

    • Member
    • ***
    • Posts: 160
    • Thanks: +0/-0
      • View Profile
      • Gunz The Last Duel
    PHP Help please.
    « on: April 09, 2015, 12:07:20 AM »
    Keep getting this parsing error.
    Code: [Select]
    Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\paypal\config.inc.php on line 38
     im trying to create a dropdown menu for my quantities. please help. heres my code.

    this is line 38
    Code: [Select]
    $paypal <option value="1200">$115</option>
    //Product Settings
    $paypal[item_number]="$_POST[item_number]";
    $paypal[amount]="$_POST[amount]";
    $paypal[on0]="$_POST[on0]";
    $paypal[os0]="$_POST[os0]";
    $paypal[on1]="$_POST[on1]";
    $paypal[os1]="$_POST[os1]";
    $paypal[quantity]="$_POST[quantity]";
    $paypal[edit_quantity]=""//1=yes ""=no
    $paypal <option value="1200">$115</option>
    $paypal <option value="1000">$100</option>
    $paypal <option value="750">$75</option>
    $paypal <option value="500">$50</option>
    $paypal <option value="200">$20</option>
    $paypal <option value="100">$10</option>
    $paypal[invoice]="$_POST[invoice]";
    $paypal[tax]="$_POST[tax]";





    « Last Edit: April 09, 2015, 12:53:09 AM by Venge Drop »
    Runescape Gambling

    OfflinestCky

    • Member
    • ****
    • Posts: 409
    • Thanks: +0/-0
      • View Profile
    Re: PHP Help please.
    « Reply #1 on: April 09, 2015, 12:25:58 AM »
    This should be in the Web Design and Development section here: https://forum.moparscape.org/index.php/board,228.0.html/

    The error is saying that you have a string that isn't wrapped in quotes, which makes sense as what instruction is the below code to the computer, nothing right?

    Code: [Select]
    $paypal <option value="1200">$115</option>
    Perhaps something similar, like below would be closer to what you're trying to achieve:

    Code: [Select]
    $paypal =  '<option value="1200">$115</option>';
    But this wont help as it will reset $paypal to now equal that string, effectively undoing all of this:

    Code: [Select]
    $paypal[item_number]="$_POST[item_number]";
    $paypal[amount]="$_POST[amount]";
    $paypal[on0]="$_POST[on0]";
    $paypal[os0]="$_POST[os0]";
    $paypal[on1]="$_POST[on1]";
    $paypal[os1]="$_POST[os1]";
    $paypal[quantity]="$_POST[quantity]";
    $paypal[edit_quantity]=""; //1=yes ""=no

    Can you post the code that creates the form you're trying to add the drop down to? This code seems to deal with the _POST array, which we'd receive after the form was submitted, not before the form is created.

    « Last Edit: April 09, 2015, 12:30:41 AM by stCky »
    HOLD CTRL AND TYPE "WTF" FOR ℱ𝓪𝓷𝓬𝔂 𝓦𝓣ℱ
    Runescape Gambling

    OfflineVenge Drop

    • Member
    • ***
    • Posts: 160
    • Thanks: +0/-0
      • View Profile
      • Gunz The Last Duel
    Re: PHP Help please.
    « Reply #2 on: April 09, 2015, 12:34:20 AM »
    Code: [Select]
    <?php
    $paypal
    [business]="[email protected]";
    $paypal[site_url]="/ca/home;;
    $paypal[site_url]=";;
    $paypal[success_url]="success.php";
    $paypal[cancel_url]="error.php";
    $paypal[return_method]="2"//1=GET 2=POST
    $paypal[currency_code]="USD"//[USD,GBP,JPY,CAD,EUR]
    $paypal[lc]="US";

    $paypal[url]="/ca/home;;
    //
    $paypal[url]="/ca/home;;
    //$paypal[url]=";;
    $paypal[post_method]="fso"//fso=fsockopen(); curl=curl command line libCurl=php compiled with libCurl support
    $paypal[curl_location]="/usr/local/bin/curl";

    $paypal[bn]="toolkit-php";
    $paypal[cmd]="_xclick";

    //Payment Page Settings
    $paypal[display_comment]="0"//0=yes 1=no
    $paypal[comment_header]="Comments";
    $paypal[continue_button_text]="Continue >>";
    $paypal[background_color]=""//""=white 1=black
    $paypal[display_shipping_address]=""//""=yes 1=no
    $paypal[display_comment]="1"//""=yes 1=no


    //Product Settings
    $paypal[item_number]="$_POST[item_number]";
    $paypal[amount]="$_POST[amount]";
    $paypal[on0]="$_POST[on0]";
    $paypal[os0]="$_POST[os0]";
    $paypal[on1]="$_POST[on1]";
    $paypal[os1]="$_POST[os1]";
    $paypal[quantity]="$_POST[quantity]";
    $paypal[edit_quantity]=""//1=yes ""=no
    $paypal <option value="1200">$115</option>
    $paypal <option value="1000">$100</option>
    $paypal <option value="750">$75</option>
    $paypal <option value="500">$50</option>
    $paypal <option value="200">$20</option>
    $paypal <option value="100">$10</option>
    $paypal[invoice]="$_POST[invoice]";
    $paypal[tax]="$_POST[tax]";

    //Shipping and Taxes
    $paypal[shipping_amount]="$_POST[shipping_amount]";
    $paypal[shipping_amount_per_item]="";
    $paypal[handling_amount]="";
    $paypal[custom_field]="";

    //Customer Settings
    $paypal[firstname]="$_POST[firstname]";
    $paypal[lastname]="$_POST[lastname]";
    $paypal[address1]="$_POST[address1]";
    $paypal[address2]="$_POST[address2]";
    $paypal[city]="$_POST[city]";
    $paypal[state]="$_POST[state]";
    $paypal[zip]="$_POST[zip]";
    $paypal[email]="$_POST[email]";
    $paypal[character]="$_POST[charname]";
    $paypal[item_name]="$_POST[item_name]";
    ?>

    this is my entire config file.
    Runescape Gambling

    OfflinestCky

    • Member
    • ****
    • Posts: 409
    • Thanks: +0/-0
      • View Profile
    Re: PHP Help please.
    « Reply #3 on: April 09, 2015, 12:39:14 AM »
    This doesn't really help as it doesn't show us how any of the other form fields are made. As requested can you please post the code that creates the form
    HOLD CTRL AND TYPE "WTF" FOR ℱ𝓪𝓷𝓬𝔂 𝓦𝓣ℱ

    OfflineVenge Drop

    • Member
    • ***
    • Posts: 160
    • Thanks: +0/-0
      • View Profile
      • Gunz The Last Duel
    Parsing Error for ppal donation page. PHP
    « Reply #4 on: April 09, 2015, 12:53:36 AM »
    Keep getting this parsing error.
    Code: [Select]
    Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\paypal\config.inc.php on line 38
     im trying to create a dropdown menu for my quantities. please help. heres my code.

    this is line 38
    Code: [Select]
    $paypal <option value="1200">$115</option>
    //Product Settings
    $paypal[item_number]="$_POST[item_number]";
    $paypal[amount]="$_POST[amount]";
    $paypal[on0]="$_POST[on0]";
    $paypal[os0]="$_POST[os0]";
    $paypal[on1]="$_POST[on1]";
    $paypal[os1]="$_POST[os1]";
    $paypal[quantity]="$_POST[quantity]";
    $paypal[edit_quantity]=""//1=yes ""=no
    $paypal <option value="1200">$115</option>
    $paypal <option value="1000">$100</option>
    $paypal <option value="750">$75</option>
    $paypal <option value="500">$50</option>
    $paypal <option value="200">$20</option>
    $paypal <option value="100">$10</option>
    $paypal[invoice]="$_POST[invoice]";
    $paypal[tax]="$_POST[tax]";




    « Last Edit: April 09, 2015, 01:24:58 AM by Venge Drop »

    OfflineHcoJustin

    • Member
    • ****
    • Posts: 2,400
    • Thanks: +0/-0
      • View Profile
    Re: Parsing Error for ppal donation page. PHP
    « Reply #5 on: April 09, 2015, 01:32:57 AM »
    Keep getting this parsing error.
    Code: [Select]
    Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\paypal\config.inc.php on line 38
     im trying to create a dropdown menu for my quantities. please help. heres my code.

    this is line 38
    Code: [Select]
    $paypal <option value="1200">$115</option>
    //Product Settings
    $paypal[item_number]="$_POST[item_number]";
    $paypal[amount]="$_POST[amount]";
    $paypal[on0]="$_POST[on0]";
    $paypal[os0]="$_POST[os0]";
    $paypal[on1]="$_POST[on1]";
    $paypal[os1]="$_POST[os1]";
    $paypal[quantity]="$_POST[quantity]";
    $paypal[edit_quantity]=""//1=yes ""=no
    $paypal <option value="1200">$115</option>
    $paypal <option value="1000">$100</option>
    $paypal <option value="750">$75</option>
    $paypal <option value="500">$50</option>
    $paypal <option value="200">$20</option>
    $paypal <option value="100">$10</option>
    $paypal[invoice]="$_POST[invoice]";
    $paypal[tax]="$_POST[tax]";






    You can't embed HTML within the PHP tags. They will need to be output somehow

    OfflinestCky

    • Member
    • ****
    • Posts: 409
    • Thanks: +0/-0
      • View Profile
    Re: Parsing Error for ppal donation page. PHP
    « Reply #6 on: April 09, 2015, 07:01:26 AM »
    Could you please post the other files used with this donation page? I'm not sure this is where you want to look to add the drop down, unless

    Code: [Select]
    //Product Settings
    $paypal[item_number]="$_POST[item_number]";
    $paypal[amount]="$_POST[amount]";
    $paypal[on0]="$_POST[on0]";
    $paypal[os0]="$_POST[os0]";
    $paypal[on1]="$_POST[on1]";
    $paypal[os1]="$_POST[os1]";
    $paypal[quantity]="$_POST[quantity]";
    $paypal[edit_quantity]=""; //1=yes ""=no
    $paypal[invoice]="$_POST[invoice]";
    $paypal[tax]="$_POST[tax]";

    You can fix the errors by replacing your code with this or if possible revert it to how you got it, then we can have a look to find where the form is made
    HOLD CTRL AND TYPE "WTF" FOR ℱ𝓪𝓷𝓬𝔂 𝓦𝓣ℱ

    OfflineVenge Drop

    • Member
    • ***
    • Posts: 160
    • Thanks: +0/-0
      • View Profile
      • Gunz The Last Duel
    Re: PHP Help please.
    « Reply #7 on: April 09, 2015, 10:44:36 AM »
    Im code tagging all 3 files the paypal process uses.Im assuming this is what you were needing stcky.
    This is config.inc.php
    Code: [Select]
    <?php
    $paypal
    [business]="[email protected]";
    $paypal[site_url]="/ca/home;;
    $paypal[site_url]=";;
    $paypal[success_url]="success.php";
    $paypal[cancel_url]="error.php";
    $paypal[return_method]="2"//1=GET 2=POST
    $paypal[currency_code]="USD"//[USD,GBP,JPY,CAD,EUR]
    $paypal[lc]="US";

    $paypal[url]="/ca/home;;
    //
    $paypal[url]="/ca/home;;
    //$paypal[url]=";;
    $paypal[post_method]="fso"//fso=fsockopen(); curl=curl command line libCurl=php compiled with libCurl support
    $paypal[curl_location]="/usr/local/bin/curl";

    $paypal[bn]="toolkit-php";
    $paypal[cmd]="_xclick";

    //Payment Page Settings
    $paypal[display_comment]="0"//0=yes 1=no
    $paypal[comment_header]="Comments";
    $paypal[continue_button_text]="Continue >>";
    $paypal[background_color]=""//""=white 1=black
    $paypal[display_shipping_address]=""//""=yes 1=no
    $paypal[display_comment]="1"//""=yes 1=no


    //Product Settings
    $paypal[item_number]="$_POST[item_number]";
    $paypal[amount]="$_POST[amount]";
    $paypal[on0]="$_POST[on0]";
    $paypal[os0]="$_POST[os0]";
    $paypal[on1]="$_POST[on1]";
    $paypal[os1]="$_POST[os1]";
    $paypal[quantity]="$_POST[quantity]";
    $paypal[edit_quantity]=""//1=yes ""=no
    $paypal <option value="1200">$115</option>
    $paypal <option value="1000">$100</option>
    $paypal <option value="750">$75</option>
    $paypal <option value="500">$50</option>
    $paypal <option value="200">$20</option>
    $paypal <option value="100">$10</option>
    $paypal[invoice]="$_POST[invoice]";
    $paypal[tax]="$_POST[tax]";

    //Shipping and Taxes
    $paypal[shipping_amount]="$_POST[shipping_amount]";
    $paypal[shipping_amount_per_item]="";
    $paypal[handling_amount]="";
    $paypal[custom_field]="";

    //Customer Settings
    $paypal[firstname]="$_POST[firstname]";
    $paypal[lastname]="$_POST[lastname]";
    $paypal[address1]="$_POST[address1]";
    $paypal[address2]="$_POST[address2]";
    $paypal[city]="$_POST[city]";
    $paypal[state]="$_POST[state]";
    $paypal[zip]="$_POST[zip]";
    $paypal[email]="$_POST[email]";
    $paypal[character]="$_POST[charname]";
    $paypal[item_name]="$_POST[item_name]";
    ?>

    This is global_config.inc.php
    Code: [Select]
    <?php
    /*
     * global_config.inc.php
     *
     * PHP Toolkit for PayPal v0.51
     * /docs/
     *
     * Copyright (c) 2004 PayPal Inc
     *
     * Released under Common Public License 1.0
     * https://opensource.org/licenses/cpl.php
     *
     */

    //create variable names to perform additional order processing

    function create_local_variables() {

    $array_name[business]="$_POST[business]";
    $array_name[receiver_email]="$_POST[receiver_email]";
    $array_name[receiver_id]="$_POST[receiver_id]";
    $array_name[item_name]="$_POST[item_name]";
    $array_name[item_number]="$_POST[item_number]";
    $array_name[quantity]="$_POST[quantity]";
    $array_name[invoice]="$_POST[invoice]";
    $array_name[custom]="$_POST[custom]";
    $array_name[memo]="$_POST[memo]";
    $array_name[tax]="$_POST[tax]";
    $array_name[option_name1]="$_POST[option_name1]";
    $array_name[option_selection1]="$_POST[option_selection1]";
    $array_name[option_name2]="$_POST[option_name2]";
    $array_name[option_selection2]="$_POST[option_selection2]";
    $array_name[num_cart_items]="$_POST[num_cart_items]";
    $array_name[mc_gross]="$_POST[mc_gross]";
    $array_name[mc_fee]="$_POST[mc_fee]";
    $array_name[mc_currency]="$_POST[mc_currency]";
    $array_name[settle_amount]="$_POST[settle_amount]";
    $array_name[settle_currency]="$_POST[settle_currency]";
    $array_name[exchange_rate]="$_POST[exchange_rate]";
    $array_name[payment_gross]="$_POST[payment_gross]";
    $array_name[payment_fee]="$_POST[payment_fee]";
    $array_name[payment_status]="$_POST[payment_status]";
    $array_name[pending_reason]="$_POST[pending_reason]";
    $array_name[reason_code]="$_POST[reason_code]";
    $array_name[payment_date]="$_POST[payment_date]";
    $array_name[txn_id]="$_POST[txn_id]";
    $array_name[txn_type]="$_POST[txn_type]";
    $array_name[payment_type]="$_POST[payment_type]";
    $array_name[for_auction]="$_POST[for_auction]";
    $array_name[auction_buyer_id]="$_POST[auction_buyer_id]";
    $array_name[auction_closing_date]="$_POST[auction_closing_date]";
    $array_name[auction_multi_item]="$_POST[auction_multi_item]";
    $array_name[first_name]="$_POST[first_name]";
    $array_name[last_name]="$_POST[last_name]";
    $array_name[payer_business_name]="$_POST[payer_business_name]";
    $array_name[address_name]="$_POST[address_name]";
    $array_name[address_street]="$_POST[address_street]";
    $array_name[address_city]="$_POST[address_city]";
    $array_name[address_state]="$_POST[address_state]";
    $array_name[address_zip]="$_POST[address_zip]";
    $array_name[address_country]="$_POST[address_country]";
    $array_name[address_status]="$_POST[address_status]";
    $array_name[payer_email]="$_POST[payer_email]";
    $array_name[payer_id]="$_POST[payer_id]";
    $array_name[payer_status]="$_POST[payer_status]";
    $array_name[notify_version]="$_POST[notify_version]";
    $array_name[verify_sign]="$_POST[verify_sign]";

    return 
    $array_name;

    }

    //post transaction data using curl

    function curlPost($url,$data)  {

    global 
    $paypal;

    //build post string

    foreach($data as $i=>$v) {
    $postdata.= $i "=" urlencode($v) . "&";
    }

    $postdata.="cmd=_notify-validate";

    //execute curl on the command line

    exec("$paypal[curl_location] -d \"$postdata\" $url"$info);

    $info=implode(",",$info);

    return 
    $info;

    }

    //posts transaction data using libCurl

    function libCurlPost($url,$data)  {

    //build post string

    foreach($data as $i=>$v) {

    $postdata.= $i "=" urlencode($v) . "&";

    }

    $postdata.="cmd=_notify-validate";

    $ch=curl_init();

    curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE);
    curl_setopt($ch,CURLOPT_URL,$url);
    curl_setopt($ch,CURLOPT_POST,1);
    curl_setopt($ch,CURLOPT_POSTFIELDS,$postdata);

    //Start ob to prevent curl_exec from displaying stuff.
    ob_start();
    curl_exec($ch);

    //Get contents of output buffer
    $info=ob_get_contents();
    curl_close($ch);

    //End ob and erase contents.
    ob_end_clean();

    return 
    $info;

    }

    //posts transaction data using fsockopen.
    function fsockPost($url,$data) {

    //Parse url
    $web=parse_url($url);

    //build post string
    foreach($data as $i=>$v) {
    $postdata.= $i "=" urlencode($v) . "&";
    }

    $postdata.="cmd=_notify-validate";

    //Set the port number
    if($web[scheme] == "https") { $web[port]="443";  $ssl="ssl://"; } else { $web[port]="80"; }

    //Create paypal connection
    $fp[email protected]fsockopen($ssl $web[host],$web[port],$errnum,$errstr,30);

    //Error checking
    if(!$fp) { echo "$errnum$errstr"; }

    //Post Data
    else {

      
    fputs($fp"POST $web[path] HTTP/1.1\r\n");
      
    fputs($fp"Host: $web[host]\r\n");
      
    fputs($fp"Content-type: application/x-www-form-urlencoded\r\n");
      
    fputs($fp"Content-length: ".strlen($postdata)."\r\n");
      
    fputs($fp"Connection: close\r\n\r\n");
      
    fputs($fp$postdata "\r\n\r\n");

    //loop through the response from the server
    while(!feof($fp)) { $info[][email protected]fgets($fp1024); }

    //close fp - we are done with it
    fclose($fp);

    //break up results into a string
    $info=implode(",",$info);

    }

    return 
    $info;

       }

    //Display Paypal Hidden Variables

    function showVariables() {

    global 
    $paypal;

    ?>


    <!-- PayPal Configuration -->
    <input type="hidden" name="business" value="<?=$paypal[business]?>">
    <input type="hidden" name="cmd" value="<?=$paypal[cmd]?>">
    <input type="hidden" name="image_url" value="<? echo "$paypal[site_url]$paypal[image_url]"; ?>">
    <input type="hidden" name="return" value="<? echo "$paypal[site_url]$paypal[success_url]"; ?>">
    <input type="hidden" name="cancel_return" value="<? echo "$paypal[site_url]$paypal[cancel_url]"; ?>">
    <input type="hidden" name="notify_url" value="<? echo "$paypal[site_url]$paypal[notify_url]"; ?>">
    <input type="hidden" name="rm" value="<?=$paypal[return_method]?>">
    <input type="hidden" name="currency_code" value="<?=$paypal[currency_code]?>">
    <input type="hidden" name="lc" value="<?=$paypal[lc]?>">
    <input type="hidden" name="bn" value="<?=$paypal[bn]?>">
    <input type="hidden" name="cbt" value="<?=$paypal[continue_button_text]?>">

    <!-- Payment Page Information -->
    <input type="hidden" name="no_shipping" value="<?=$paypal[display_shipping_address]?>">
    <input type="hidden" name="no_note" value="<?=$paypal[display_comment]?>">
    <input type="hidden" name="cn" value="<?=$paypal[comment_header]?>">
    <input type="hidden" name="cs" value="<?=$paypal[background_color]?>">

    <!-- Product Information -->
    <input type="hidden" name="item_name" value="<?=$paypal[item_name]?>">
    <input type="hidden" name="amount" value="<?=$paypal[amount]?>">
    <input type="hidden" name="quantity" value="<?=$paypal[quantity]?>">
    <input type="hidden" name="item_number" value="<?=$paypal[item_number]?>">
    <input type="hidden" name="undefined_quantity" value="<?=$paypal[edit_quantity]?>">
    <input type="hidden" name="on0" value="<?=$paypal[on0]?>">
    <input type="hidden" name="os0" value="<?=$paypal[os0]?>">
    <input type="hidden" name="on1" value="<?=$paypal[on1]?>">
    <input type="hidden" name="os1" value="<?=$paypal[os1]?>">

    <!-- Shipping and Misc Information -->
    <input type="hidden" name="shipping" value="<?=$paypal[shipping_amount]?>">
    <input type="hidden" name="shipping2" value="<?=$paypal[shipping_amount_per_item]?>">
    <input type="hidden" name="handling" value="<?=$paypal[handling_amount]?>">
    <input type="hidden" name="tax" value="<?=$paypal[tax]?>">
    <input type="hidden" name="custom" value="<?=$paypal[custom_field]?>">
    <input type="hidden" name="invoice" value="<?=$paypal[invoice]?>">

    <!-- Customer Information -->
    <input type="hidden" name="first_name" value="<?=$paypal[firstname]?>">
    <input type="hidden" name="last_name" value="<?=$paypal[lastname]?>">
    <input type="hidden" name="address1" value="<?=$paypal[address1]?>">
    <input type="hidden" name="address2" value="<?=$paypal[address2]?>">
    <input type="hidden" name="city" value="<?=$paypal[city]?>">
    <input type="hidden" name="state" value="<?=$paypal[state]?>">
    <input type="hidden" name="zip" value="<?=$paypal[zip]?>">
    <input type="hidden" name="email" value="<?=$paypal[email]?>">
    <input type="hidden" name="night_phone_a" value="<?=$paypal[phone_1]?>">
    <input type="hidden" name="night_phone_b" value="<?=$paypal[phone_2]?>">
    <input type="hidden" name="night_phone_c" value="<?=$paypal[phone_3]?>">

    <?php ?>

    This is process.inc.php
    Code: [Select]
    <?php
    include_once('paypal/config.inc.php'); 

    //Global Configuration File
    include_once('paypal/global_config.inc.php');

    $firstname $_POST['firstname'];
    $lastname $_POST['lastname'];
    $address1 $_POST['address1'];
    $city $_POST['city'];
    $state $_POST['state'];
    $zip $_POST['zip'];
    $email $_POST['email'];
    $amount $_POST['amount'];
    $itemname $_POST['item_name'];

    if(empty(
    $firstname) || empty($lastname) || empty($address1) || empty($city) || empty($state) || empty($email)){
    echo 
    "
    <script language=\"javascript\">
    window.location=\"index.php?gunz=coins&error=form\";
    </script>
    "
    ;
    } else {
    ?>

    <html>
    <head><title>::PHP PayPal::</title></head>
    <body onLoad="document.paypal_form.submit();">
    <form method="post" name="paypal_form" action="<?=$paypal[url]?>">

    <?php 
    //show paypal hidden variables

    showVariables(); 

    ?>


    <center><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#000000"><b>Processing Data wait . . . </b></font></center>

    </form>
    </body>   
    </html>
    <?
    }
    ?>
    « Last Edit: April 09, 2015, 10:57:29 AM by Venge Drop »

    OfflineVenge Drop

    • Member
    • ***
    • Posts: 160
    • Thanks: +0/-0
      • View Profile
      • Gunz The Last Duel
    Re: Parsing Error for ppal donation page. PHP
    « Reply #8 on: April 09, 2015, 10:58:18 AM »
    Im code tagging all 3 files the paypal process uses.Im assuming this is what you were needing stcky.
    This is config.inc.php
    Code: [Select]
    <?php
    $paypal
    [business]="[email protected]";
    $paypal[site_url]="/ca/home;;
    $paypal[site_url]=";;
    $paypal[success_url]="success.php";
    $paypal[cancel_url]="error.php";
    $paypal[return_method]="2"//1=GET 2=POST
    $paypal[currency_code]="USD"//[USD,GBP,JPY,CAD,EUR]
    $paypal[lc]="US";

    $paypal[url]="/ca/home;;
    //
    $paypal[url]="/ca/home;;
    //$paypal[url]=";;
    $paypal[post_method]="fso"//fso=fsockopen(); curl=curl command line libCurl=php compiled with libCurl support
    $paypal[curl_location]="/usr/local/bin/curl";

    $paypal[bn]="toolkit-php";
    $paypal[cmd]="_xclick";

    //Payment Page Settings
    $paypal[display_comment]="0"//0=yes 1=no
    $paypal[comment_header]="Comments";
    $paypal[continue_button_text]="Continue >>";
    $paypal[background_color]=""//""=white 1=black
    $paypal[display_shipping_address]=""//""=yes 1=no
    $paypal[display_comment]="1"//""=yes 1=no


    //Product Settings
    $paypal[item_number]="$_POST[item_number]";
    $paypal[amount]="$_POST[amount]";
    $paypal[on0]="$_POST[on0]";
    $paypal[os0]="$_POST[os0]";
    $paypal[on1]="$_POST[on1]";
    $paypal[os1]="$_POST[os1]";
    $paypal[quantity]="$_POST[quantity]";
    $paypal[edit_quantity]=""//1=yes ""=no
    $paypal <option value="1200">$115</option>
    $paypal <option value="1000">$100</option>
    $paypal <option value="750">$75</option>
    $paypal <option value="500">$50</option>
    $paypal <option value="200">$20</option>
    $paypal <option value="100">$10</option>
    $paypal[invoice]="$_POST[invoice]";
    $paypal[tax]="$_POST[tax]";

    //Shipping and Taxes
    $paypal[shipping_amount]="$_POST[shipping_amount]";
    $paypal[shipping_amount_per_item]="";
    $paypal[handling_amount]="";
    $paypal[custom_field]="";

    //Customer Settings
    $paypal[firstname]="$_POST[firstname]";
    $paypal[lastname]="$_POST[lastname]";
    $paypal[address1]="$_POST[address1]";
    $paypal[address2]="$_POST[address2]";
    $paypal[city]="$_POST[city]";
    $paypal[state]="$_POST[state]";
    $paypal[zip]="$_POST[zip]";
    $paypal[email]="$_POST[email]";
    $paypal[character]="$_POST[charname]";
    $paypal[item_name]="$_POST[item_name]";
    ?>

    This is global_config.inc.php
    Code: [Select]
    <?php
    /*
     * global_config.inc.php
     *
     * PHP Toolkit for PayPal v0.51
     * /docs/
     *
     * Copyright (c) 2004 PayPal Inc
     *
     * Released under Common Public License 1.0
     * https://opensource.org/licenses/cpl.php
     *
     */

    //create variable names to perform additional order processing

    function create_local_variables() {

    $array_name[business]="$_POST[business]";
    $array_name[receiver_email]="$_POST[receiver_email]";
    $array_name[receiver_id]="$_POST[receiver_id]";
    $array_name[item_name]="$_POST[item_name]";
    $array_name[item_number]="$_POST[item_number]";
    $array_name[quantity]="$_POST[quantity]";
    $array_name[invoice]="$_POST[invoice]";
    $array_name[custom]="$_POST[custom]";
    $array_name[memo]="$_POST[memo]";
    $array_name[tax]="$_POST[tax]";
    $array_name[option_name1]="$_POST[option_name1]";
    $array_name[option_selection1]="$_POST[option_selection1]";
    $array_name[option_name2]="$_POST[option_name2]";
    $array_name[option_selection2]="$_POST[option_selection2]";
    $array_name[num_cart_items]="$_POST[num_cart_items]";
    $array_name[mc_gross]="$_POST[mc_gross]";
    $array_name[mc_fee]="$_POST[mc_fee]";
    $array_name[mc_currency]="$_POST[mc_currency]";
    $array_name[settle_amount]="$_POST[settle_amount]";
    $array_name[settle_currency]="$_POST[settle_currency]";
    $array_name[exchange_rate]="$_POST[exchange_rate]";
    $array_name[payment_gross]="$_POST[payment_gross]";
    $array_name[payment_fee]="$_POST[payment_fee]";
    $array_name[payment_status]="$_POST[payment_status]";
    $array_name[pending_reason]="$_POST[pending_reason]";
    $array_name[reason_code]="$_POST[reason_code]";
    $array_name[payment_date]="$_POST[payment_date]";
    $array_name[txn_id]="$_POST[txn_id]";
    $array_name[txn_type]="$_POST[txn_type]";
    $array_name[payment_type]="$_POST[payment_type]";
    $array_name[for_auction]="$_POST[for_auction]";
    $array_name[auction_buyer_id]="$_POST[auction_buyer_id]";
    $array_name[auction_closing_date]="$_POST[auction_closing_date]";
    $array_name[auction_multi_item]="$_POST[auction_multi_item]";
    $array_name[first_name]="$_POST[first_name]";
    $array_name[last_name]="$_POST[last_name]";
    $array_name[payer_business_name]="$_POST[payer_business_name]";
    $array_name[address_name]="$_POST[address_name]";
    $array_name[address_street]="$_POST[address_street]";
    $array_name[address_city]="$_POST[address_city]";
    $array_name[address_state]="$_POST[address_state]";
    $array_name[address_zip]="$_POST[address_zip]";
    $array_name[address_country]="$_POST[address_country]";
    $array_name[address_status]="$_POST[address_status]";
    $array_name[payer_email]="$_POST[payer_email]";
    $array_name[payer_id]="$_POST[payer_id]";
    $array_name[payer_status]="$_POST[payer_status]";
    $array_name[notify_version]="$_POST[notify_version]";
    $array_name[verify_sign]="$_POST[verify_sign]";

    return 
    $array_name;

    }

    //post transaction data using curl

    function curlPost($url,$data)  {

    global 
    $paypal;

    //build post string

    foreach($data as $i=>$v) {
    $postdata.= $i "=" urlencode($v) . "&";
    }

    $postdata.="cmd=_notify-validate";

    //execute curl on the command line

    exec("$paypal[curl_location] -d \"$postdata\" $url"$info);

    $info=implode(",",$info);

    return 
    $info;

    }

    //posts transaction data using libCurl

    function libCurlPost($url,$data)  {

    //build post string

    foreach($data as $i=>$v) {

    $postdata.= $i "=" urlencode($v) . "&";

    }

    $postdata.="cmd=_notify-validate";

    $ch=curl_init();

    curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE);
    curl_setopt($ch,CURLOPT_URL,$url);
    curl_setopt($ch,CURLOPT_POST,1);
    curl_setopt($ch,CURLOPT_POSTFIELDS,$postdata);

    //Start ob to prevent curl_exec from displaying stuff.
    ob_start();
    curl_exec($ch);

    //Get contents of output buffer
    $info=ob_get_contents();
    curl_close($ch);

    //End ob and erase contents.
    ob_end_clean();

    return 
    $info;

    }

    //posts transaction data using fsockopen.
    function fsockPost($url,$data) {

    //Parse url
    $web=parse_url($url);

    //build post string
    foreach($data as $i=>$v) {
    $postdata.= $i "=" urlencode($v) . "&";
    }

    $postdata.="cmd=_notify-validate";

    //Set the port number
    if($web[scheme] == "https") { $web[port]="443";  $ssl="ssl://"; } else { $web[port]="80"; }

    //Create paypal connection
    $fp[email protected]fsockopen($ssl $web[host],$web[port],$errnum,$errstr,30);

    //Error checking
    if(!$fp) { echo "$errnum$errstr"; }

    //Post Data
    else {

      
    fputs($fp"POST $web[path] HTTP/1.1\r\n");
      
    fputs($fp"Host: $web[host]\r\n");
      
    fputs($fp"Content-type: application/x-www-form-urlencoded\r\n");
      
    fputs($fp"Content-length: ".strlen($postdata)."\r\n");
      
    fputs($fp"Connection: close\r\n\r\n");
      
    fputs($fp$postdata "\r\n\r\n");

    //loop through the response from the server
    while(!feof($fp)) { $info[][email protected]fgets($fp1024); }

    //close fp - we are done with it
    fclose($fp);

    //break up results into a string
    $info=implode(",",$info);

    }

    return 
    $info;

       }

    //Display Paypal Hidden Variables

    function showVariables() {

    global 
    $paypal;

    ?>


    <!-- PayPal Configuration -->
    <input type="hidden" name="business" value="<?=$paypal[business]?>">
    <input type="hidden" name="cmd" value="<?=$paypal[cmd]?>">
    <input type="hidden" name="image_url" value="<? echo "$paypal[site_url]$paypal[image_url]"; ?>">
    <input type="hidden" name="return" value="<? echo "$paypal[site_url]$paypal[success_url]"; ?>">
    <input type="hidden" name="cancel_return" value="<? echo "$paypal[site_url]$paypal[cancel_url]"; ?>">
    <input type="hidden" name="notify_url" value="<? echo "$paypal[site_url]$paypal[notify_url]"; ?>">
    <input type="hidden" name="rm" value="<?=$paypal[return_method]?>">
    <input type="hidden" name="currency_code" value="<?=$paypal[currency_code]?>">
    <input type="hidden" name="lc" value="<?=$paypal[lc]?>">
    <input type="hidden" name="bn" value="<?=$paypal[bn]?>">
    <input type="hidden" name="cbt" value="<?=$paypal[continue_button_text]?>">

    <!-- Payment Page Information -->
    <input type="hidden" name="no_shipping" value="<?=$paypal[display_shipping_address]?>">
    <input type="hidden" name="no_note" value="<?=$paypal[display_comment]?>">
    <input type="hidden" name="cn" value="<?=$paypal[comment_header]?>">
    <input type="hidden" name="cs" value="<?=$paypal[background_color]?>">

    <!-- Product Information -->
    <input type="hidden" name="item_name" value="<?=$paypal[item_name]?>">
    <input type="hidden" name="amount" value="<?=$paypal[amount]?>">
    <input type="hidden" name="quantity" value="<?=$paypal[quantity]?>">
    <input type="hidden" name="item_number" value="<?=$paypal[item_number]?>">
    <input type="hidden" name="undefined_quantity" value="<?=$paypal[edit_quantity]?>">
    <input type="hidden" name="on0" value="<?=$paypal[on0]?>">
    <input type="hidden" name="os0" value="<?=$paypal[os0]?>">
    <input type="hidden" name="on1" value="<?=$paypal[on1]?>">
    <input type="hidden" name="os1" value="<?=$paypal[os1]?>">

    <!-- Shipping and Misc Information -->
    <input type="hidden" name="shipping" value="<?=$paypal[shipping_amount]?>">
    <input type="hidden" name="shipping2" value="<?=$paypal[shipping_amount_per_item]?>">
    <input type="hidden" name="handling" value="<?=$paypal[handling_amount]?>">
    <input type="hidden" name="tax" value="<?=$paypal[tax]?>">
    <input type="hidden" name="custom" value="<?=$paypal[custom_field]?>">
    <input type="hidden" name="invoice" value="<?=$paypal[invoice]?>">

    <!-- Customer Information -->
    <input type="hidden" name="first_name" value="<?=$paypal[firstname]?>">
    <input type="hidden" name="last_name" value="<?=$paypal[lastname]?>">
    <input type="hidden" name="address1" value="<?=$paypal[address1]?>">
    <input type="hidden" name="address2" value="<?=$paypal[address2]?>">
    <input type="hidden" name="city" value="<?=$paypal[city]?>">
    <input type="hidden" name="state" value="<?=$paypal[state]?>">
    <input type="hidden" name="zip" value="<?=$paypal[zip]?>">
    <input type="hidden" name="email" value="<?=$paypal[email]?>">
    <input type="hidden" name="night_phone_a" value="<?=$paypal[phone_1]?>">
    <input type="hidden" name="night_phone_b" value="<?=$paypal[phone_2]?>">
    <input type="hidden" name="night_phone_c" value="<?=$paypal[phone_3]?>">

    <?php ?>

    This is process.inc.php
    Code: [Select]
    <?php
    include_once('paypal/config.inc.php'); 

    //Global Configuration File
    include_once('paypal/global_config.inc.php');

    $firstname $_POST['firstname'];
    $lastname $_POST['lastname'];
    $address1 $_POST['address1'];
    $city $_POST['city'];
    $state $_POST['state'];
    $zip $_POST['zip'];
    $email $_POST['email'];
    $amount $_POST['amount'];
    $itemname $_POST['item_name'];

    if(empty(
    $firstname) || empty($lastname) || empty($address1) || empty($city) || empty($state) || empty($email)){
    echo 
    "
    <script language=\"javascript\">
    window.location=\"index.php?gunz=coins&error=form\";
    </script>
    "
    ;
    } else {
    ?>

    <html>
    <head><title>::PHP PayPal::</title></head>
    <body onLoad="document.paypal_form.submit();">
    <form method="post" name="paypal_form" action="<?=$paypal[url]?>">

    <?php 
    //show paypal hidden variables

    showVariables(); 

    ?>


    <center><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#000000"><b>Processing Data wait . . . </b></font></center>

    </form>
    </body>   
    </html>
    <?
    }
    ?>
    « Last Edit: April 09, 2015, 01:52:37 PM by Venge Drop »

    OfflinePwnd

    • pround player of moparscape.org
    • Member
    • ****
    • *
    • *
    • Posts: 8,553
    • Thanks: +0/-0
      • View Profile
    Re: PHP Help please.
    « Reply #9 on: April 09, 2015, 03:56:36 PM »
    $paypal <option value="1200">$115</option>
    $paypal <option value="1000">$100</option>
    $paypal <option value="750">$75</option>
    $paypal <option value="500">$50</option>
    $paypal <option value="200">$20</option>
    $paypal <option value="100">$10</option>

    This is certainly an issue. 

    [ +lawl ] web dev more like pleb dev

    OfflinestCky

    • Member
    • ****
    • Posts: 409
    • Thanks: +0/-0
      • View Profile
    Re: PHP Help please.
    « Reply #10 on: April 09, 2015, 05:02:55 PM »
    Thanks for taking the time to post those files, are these the only files involved? I was expecting to see one that outputs some html to create a form, this code below from process.inc.php mentions index.php, could you please post index.php? thanks :)

    Code: [Select]
    if(empty($firstname) || empty($lastname) || empty($address1) || empty($city) || empty($state) || empty($email)){
    echo "
    <script language=\"javascript\">
    window.location=\"index.php?gunz=coins&error=form\"; //this is the line mentioning index.php
    </script>
    ";
    } else {
    HOLD CTRL AND TYPE "WTF" FOR ℱ𝓪𝓷𝓬𝔂 𝓦𝓣ℱ

    OfflineVenge Drop

    • Member
    • ***
    • Posts: 160
    • Thanks: +0/-0
      • View Profile
      • Gunz The Last Duel
    Re: PHP Help please.
    « Reply #11 on: April 10, 2015, 12:32:58 PM »
    ok close thread. I fixed thanks for the assistance though. And i was able to cross embed the <option> tags in it. that was a goal in this. Had to output in a diff way.

    OfflinePwnd

    • pround player of moparscape.org
    • Member
    • ****
    • *
    • *
    • Posts: 8,553
    • Thanks: +0/-0
      • View Profile
    Re: PHP Help please.
    « Reply #12 on: April 11, 2015, 10:46:01 PM »
    So, in case someone else has a similar issue, what was your solution?
    [ +lawl ] web dev more like pleb dev

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal