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.
Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Regular Coder
    Join Date
    May 2006
    Location
    Canada
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool Paypal script help

    PHP Code:
    <?
    function paypal($price,$credits,$custom)
    {
        global 
    $GAMENAME$DOMAIN;
        
    ?>
        <input type="hidden" name="cmd" value="_xclick">
        <input type="hidden" name="custom" value="<?=$custom?>">
        <input type="hidden" name="business" value="rawlijr@hotmail.com">
        <input type="hidden" name="item_name" value="<?=$credits?> <?=$GAMENAME?> credits for user <?=$custom?>">
        
        <input type="hidden" name="amount" value="<?=$price?>">
        <input type="hidden" name="no_shipping" value="1">
        <input type="hidden" name="no_note" value="1">
        <input type="hidden" name="currency_code" value="USD">
        <input type="hidden" name="notify_url" value="http://<?=$DOMAIN?>/ipn.php">
        <input type="hidden" name="return" value="http://<?=$DOMAIN?>/myaccount.php">
        <input type="hidden" name="cancel_return" value="http://<?=$DOMAIN?>/myaccount.php">
        <input type="submit" class="text" border="0" class="button" name="submit" value="purchase">
        <?if ($action==purchase) {
            
    ?>
            <table>
            <tr>
            <td>
            <br><b>How many credits do i buy?</b>
            <br><font color="#770000">Well that all depends on how you look at it. Each round you can only transfer up to so many credits not including name changes or attack resets. The more credits you purchase, the more credits your going to get for your money. If you have extra credits, its alright because you can save them for another round. </font> <small><font color="#cc0000">e-checks take 3-5 days to process!</font></small>
            <br>
            </td>
            </tr>
            </table>
            
            <br>
            
            
            <table cellspacing="1" width="100%">
            <tr>
            <td><small>price</small></td>
            <td><small>credits</small></td>
            <td width="100" align="center"><small>purchase</small></td>
            </tr>
            <tr bgcolor="#bb915e">
            <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
            <td>$20.00</td>
            <td>7,500</td>
            <td align="center">
            <?=paypal(20.00,'7,500',$custom)?>
            </td>
            </form>
            </tr>
            <tr bgcolor="#b18044">
            <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
            <td>$12.50</td>
            <td>5,000</td>
            <td align="center">
            <?=paypal(12.50,'5,000',$custom)?>
            </td>
            </form>
            </tr>
            <tr bgcolor="#bb915e">
            <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
            <td>$10.00</td>
            <td>2,800</td>
            <td align="center">
            <?=paypal(10.00,'2,800',$custom)?>
            </td>
            </form>
            </tr>
            <tr bgcolor="#b18044">
            <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
            <td>$7.50</td>
            <td>1,200</td>
            <td align="center">
            <?=paypal(7.50,'1,200',$custom)?>
            </td>
            </form>
            </tr>
            </table>
            <br><br><small><b>Purchasing credits for a friend?</b><br>
            After the credits are added to your account, you may transfer them to other players.<br>
            You'll need to know the accounts email address to identify them.</small><br><br>
            <table width="98%">
                <?} else {
            
    ?>
            <tr>
            <td>
            <?if ($action==transfer) {
                
    ?>
                <br>
                <form method="post" action="credits.php?action=transfer">
                <table align="center" cellspacing="1" cellpadding="4">
                <tr>
                <td align='center'><b>Transfer your credits as reserves.</b></td>
                </tr>
                <tr>
                <td align="center">
                <select name="round" class="text"><option value="">Select from your current rounds...</option>
                </select>
                </td>
                </tr>
                <tr>
                <td align="center">
                add <input type="text" class="text" size="5" name="transfer"> credits to this round. <input type="submit" class="submit" value="transfer">
                </td>
                </tr>
                </table>
                </form>
                <br><b>What are credits?</b>
                <br><font color="#770000">Credits are kinda like turns/reserves except you can do more with credits like change your pimp name during game play, or reseting your attacks. Once you purchase credits, your account status changes to supporter. Having a supporters account unlocks more features for you in the game, you can read below to see the listed features for supporters.</font>
                <br>
                <br>
                <br>&nbsp;
                <b>What would you like to do?</b>
                <br>&bull;
                <a href="?action=purchase"><b>Purchase credits with paypal</b></a>
                <br>&bull;
                <a href="?action=transfer"><b>Transfer credits as reserves to my rounds</b></a>
                <br>&bull;
                <a href="?action=send"><b>Transfer credits to another player</b></a>
                <br>&bull;
                <strike><a href="?action=pimpname">Change my character name</b></a></strike>
                <br>&bull;
                <strike><a href="?action=attackout">Reset your attacks out</b></a></strike>
                <br>
                <br>
                <br><b>Supporter status?</b>
                <br><font color="#770000">Having supporters status unlocks more features and limits in <?=$GAMENAME?>. By becoming a supporter, you are not only paying for great entertainment, you are helping pay for the games server, the resources it uses and to keep the programers alive as we work on our games for a living.</font>
                <br>
                <br>
                <br><b>Supporter Features</font></b>
                <br>&bull;
                <font color="#770000">game autosets the amount of turns you use when exploring so you dont have to keep typing in the amount of turns you want every time you use scout, produce and discipline.</font>
                <br>&bull;
                <font color="#770000">use macromedia flash for your profile and crew profile media.</font>
                <br>&bull;
                <font color="#770000">crew icons upload limit goes to 5000 bytes.</font>
                <br>&bull;
                <font color="#770000">change pimp name during game play.</font>
                <br>&bull;
                <font color="#770000">reset your attacks out.</font>
                <br>&bull;
                <font color="#770000">and more...</font>
                <br>
                <br>
                </td>
                </tr>
                </table>
                        <?
             
    }
             
    ?>
    that script outputs Parse error: syntax error, unexpected $end in /home/thugki/public_html/credits.php on line 147

    and i honestly cant find it ....or fix it can i have some help plzz?

    Cheers
    Rawlijr
    Rawli

  • #2
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    is that all the code? it looks like you need 2 curly braces at the end of it.

  • #3
    Regular Coder
    Join Date
    May 2006
    Location
    Canada
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PHP Code:
    <? 
             

             }
             
    ?>

    so the end of the script it would be that?

    and with that a error comes

    Parse error: syntax error, unexpected $end in /home/thugki/public_html/credits.php on line 151
    Rawli

  • #4
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    this is what the last 10 lines should look like:
    PHP Code:
                <br>
                </td>
                </tr>
                </table>
                        <?
             
    }
        }
    }

    ?>

  • #5
    Regular Coder
    Join Date
    May 2006
    Location
    Canada
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok i got that thanx, but it still puts this dang error?


    Parse error: syntax error, unexpected $end in /home/thugki/public_html/credits.php on line 153
    Rawli

  • #6
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    why don't you copy paste your updated code since what I suggested is correct.
    you also should be doing $action=='purchase' instead of $action==purchase

  • #7
    Regular Coder
    Join Date
    May 2006
    Location
    Canada
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts
    here is the new code


    PHP Code:
    <?
    function paypal($price,$credits,$custom)
    {
        global 
    $GAMENAME$DOMAIN;
        
    ?>
        <input type="hidden" name="cmd" value="_xclick">
        <input type="hidden" name="custom" value="<?=$custom?>">
        <input type="hidden" name="business" value="rawlijr@hotmail.com">
        <input type="hidden" name="item_name" value="<?=$credits?> <?=$GAMENAME?> credits for user <?=$custom?>">
        
        <input type="hidden" name="amount" value="<?=$price?>">
        <input type="hidden" name="no_shipping" value="1">
        <input type="hidden" name="no_note" value="1">
        <input type="hidden" name="currency_code" value="USD">
        <input type="hidden" name="notify_url" value="http://<?=$DOMAIN?>/ipn.php">
        <input type="hidden" name="return" value="http://<?=$DOMAIN?>/myaccount.php">
        <input type="hidden" name="cancel_return" value="http://<?=$DOMAIN?>/myaccount.php">
        <input type="submit" class="text" border="0" class="button" name="submit" value="purchase">
        <?if ($action=='purchase') {
            
    ?>
            <table>
            <tr>
            <td>
            <br><b>How many credits do i buy?</b>
            <br><font color="#770000">Well that all depends on how you look at it. Each round you can only transfer up to so many credits not including name changes or attack resets. The more credits you purchase, the more credits your going to get for your money. If you have extra credits, its alright because you can save them for another round. </font> <small><font color="#cc0000">e-checks take 3-5 days to process!</font></small>
            <br>
            </td>
            </tr>
            </table>
            
            <br>
            
            
            <table cellspacing="1" width="100%">
            <tr>
            <td><small>price</small></td>
            <td><small>credits</small></td>
            <td width="100" align="center"><small>purchase</small></td>
            </tr>
            <tr bgcolor="#bb915e">
            <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
            <td>$20.00</td>
            <td>7,500</td>
            <td align="center">
            <?=paypal(20.00,'7,500',$custom)?>
            </td>
            </form>
            </tr>
            <tr bgcolor="#b18044">
            <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
            <td>$12.50</td>
            <td>5,000</td>
            <td align="center">
            <?=paypal(12.50,'5,000',$custom)?>
            </td>
            </form>
            </tr>
            <tr bgcolor="#bb915e">
            <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
            <td>$10.00</td>
            <td>2,800</td>
            <td align="center">
            <?=paypal(10.00,'2,800',$custom)?>
            </td>
            </form>
            </tr>
            <tr bgcolor="#b18044">
            <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
            <td>$7.50</td>
            <td>1,200</td>
            <td align="center">
            <?=paypal(7.50,'1,200',$custom)?>
            </td>
            </form>
            </tr>
            </table>
            
            <br><br><small><b>Purchasing credits for a friend?</b><br>
            After the credits are added to your account, you may transfer them to other players.<br>
            You'll need to know the accounts email address to identify them.</small><br><br>
            <table width="98%">
                   <?
                    

                    
    ?>
            <tr>
            <td>
            <?if ($action=='transfer') {
                
    ?>
                <br>
                <form method="post" action="credits.php?action=transfer">
                <table align="center" cellspacing="1" cellpadding="4">
                <tr>
                <td align='center'><b>Transfer your credits as reserves.</b></td>
                </tr>
                <tr>
                <td align="center">
                <select name="round" class="text"><option value="">Select from your current rounds...</option>
                </select>
                </td>
                </tr>
                <tr>
                <td align="center">
                add <input type="text" class="text" size="5" name="transfer"> credits to this round. <input type="submit" class="submit" value="transfer">
                </td>
                </tr>
                </table>
                </form>
                <br><b>What are credits?</b>
                <br><font color="#770000">Credits are kinda like turns/reserves except you can do more with credits like change your pimp name during game play, or reseting your attacks. Once you purchase credits, your account status changes to supporter. Having a supporters account unlocks more features for you in the game, you can read below to see the listed features for supporters.</font>
                <br>
                <br>
                <br>&nbsp;
                <b>What would you like to do?</b>
                <br>&bull;
                <a href="?action=purchase"><b>Purchase credits with paypal</b></a>
                <br>&bull;
                <a href="?action=transfer"><b>Transfer credits as reserves to my rounds</b></a>
                <br>&bull;
                <a href="?action=send"><b>Transfer credits to another player</b></a>
                <br>&bull;
                <strike><a href="?action=pimpname">Change my character name</b></a></strike>
                <br>&bull;
                <strike><a href="?action=attackout">Reset your attacks out</b></a></strike>
                <br>
                <br>
                <br><b>Supporter status?</b>
                <br><font color="#770000">Having supporters status unlocks more features and limits in <?=$GAMENAME?>. By becoming a supporter, you are not only paying for great entertainment, you are helping pay for the games server, the resources it uses and to keep the programers alive as we work on our games for a living.</font>
                <br>
                <br>
                <br><b>Supporter Features</font></b>
                <br>&bull;
                <font color="#770000">game autosets the amount of turns you use when exploring so you dont have to keep typing in the amount of turns you want every time you use scout, produce and discipline.</font>
                <br>&bull;
                <font color="#770000">use macromedia flash for your profile and crew profile media.</font>
                <br>&bull;
                <font color="#770000">crew icons upload limit goes to 5000 bytes.</font>
                <br>&bull;
                <font color="#770000">change pimp name during game play.</font>
                <br>&bull;
                <font color="#770000">reset your attacks out.</font>
                <br>&bull;
                <font color="#770000">and more...</font>
                <br>
    <br>
                </td>
                </tr>
                </table>
                        <?
             
    }
        }
    }

    ?>

    and that does

    Parse error: syntax error, unexpected $end in /home/thugki/public_html/credits.php on line 153
    Rawli

  • #8
    New Coder
    Join Date
    Jul 2006
    Location
    California
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try:
    PHP Code:
    <?
    function paypal($price,$credits,$custom)
    {
        global 
    $GAMENAME$DOMAIN;
        
    ?>
        <input type="hidden" name="cmd" value="_xclick">
        <input type="hidden" name="custom" value="<?=$custom?>">
        <input type="hidden" name="business" value="rawlijr@hotmail.com">
        <input type="hidden" name="item_name" value="<?=$credits?> <?=$GAMENAME?> credits for user <?=$custom?>">
        
        <input type="hidden" name="amount" value="<?=$price?>">
        <input type="hidden" name="no_shipping" value="1">
        <input type="hidden" name="no_note" value="1">
        <input type="hidden" name="currency_code" value="USD">
        <input type="hidden" name="notify_url" value="http://<?=$DOMAIN?>/ipn.php">
        <input type="hidden" name="return" value="http://<?=$DOMAIN?>/myaccount.php">
        <input type="hidden" name="cancel_return" value="http://<?=$DOMAIN?>/myaccount.php">
        <input type="submit" class="text" border="0" class="button" name="submit" value="purchase">
        <? if ($action=='purchase') {
            
    ?>
            <table>
            <tr>
            <td>
            <br><b>How many credits do i buy?</b>
            <br><font color="#770000">Well that all depends on how you look at it. Each round you can only transfer up to so many credits not including name changes or attack resets. The more credits you purchase, the more credits your going to get for your money. If you have extra credits, its alright because you can save them for another round. </font> <small><font color="#cc0000">e-checks take 3-5 days to process!</font></small>
            <br>
            </td>
            </tr>
            </table>
            
            <br>
            
            
            <table cellspacing="1" width="100%">
            <tr>
            <td><small>price</small></td>
            <td><small>credits</small></td>
            <td width="100" align="center"><small>purchase</small></td>
            </tr>
            <tr bgcolor="#bb915e">
            <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
            <td>$20.00</td>
            <td>7,500</td>
            <td align="center">
            <?= paypal(20.00,'7,500',$custom?>
            </td>
            </form>
            </tr>
            <tr bgcolor="#b18044">
            <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
            <td>$12.50</td>
            <td>5,000</td>
            <td align="center">
            <?=paypal(12.50,'5,000',$custom)?>
            </td>
            </form>
            </tr>
            <tr bgcolor="#bb915e">
            <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
            <td>$10.00</td>
            <td>2,800</td>
            <td align="center">
            <?=paypal(10.00,'2,800',$custom)?>
            </td>
            </form>
            </tr>
            <tr bgcolor="#b18044">
            <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
            <td>$7.50</td>
            <td>1,200</td>
            <td align="center">
            <?=paypal(7.50,'1,200',$custom)?>
            </td>
            </form>
            </tr>
            </table>
            
            <br><br><small><b>Purchasing credits for a friend?</b><br>
            After the credits are added to your account, you may transfer them to other players.<br>
            You'll need to know the accounts email address to identify them.</small><br><br>
            <table width="98%">
                   <?
                    

                    
    ?>
            <tr>
            <td>
            <?if ($action=='transfer') {
                
    ?>
                <br>
                <form method="post" action="credits.php?action=transfer">
                <table align="center" cellspacing="1" cellpadding="4">
                <tr>
                <td align='center'><b>Transfer your credits as reserves.</b></td>
                </tr>
                <tr>
                <td align="center">
                <select name="round" class="text"><option value="">Select from your current rounds...</option>
                </select>
                </td>
                </tr>
                <tr>
                <td align="center">
                add <input type="text" class="text" size="5" name="transfer"> credits to this round. <input type="submit" class="submit" value="transfer">
                </td>
                </tr>
                </table>
                </form>
                <br><b>What are credits?</b>
                <br><font color="#770000">Credits are kinda like turns/reserves except you can do more with credits like change your pimp name during game play, or reseting your attacks. Once you purchase credits, your account status changes to supporter. Having a supporters account unlocks more features for you in the game, you can read below to see the listed features for supporters.</font>
                <br>
                <br>
                <br>&nbsp;
                <b>What would you like to do?</b>
                <br>&bull;
                <a href="?action=purchase"><b>Purchase credits with paypal</b></a>
                <br>&bull;
                <a href="?action=transfer"><b>Transfer credits as reserves to my rounds</b></a>
                <br>&bull;
                <a href="?action=send"><b>Transfer credits to another player</b></a>
                <br>&bull;
                <strike><a href="?action=pimpname">Change my character name</b></a></strike>
                <br>&bull;
                <strike><a href="?action=attackout">Reset your attacks out</b></a></strike>
                <br>
                <br>
                <br><b>Supporter status?</b>
                <br><font color="#770000">Having supporters status unlocks more features and limits in <?=$GAMENAME?>. By becoming a supporter, you are not only paying for great entertainment, you are helping pay for the games server, the resources it uses and to keep the programers alive as we work on our games for a living.</font>
                <br>
                <br>
                <br><b>Supporter Features</font></b>
                <br>&bull;
                <font color="#770000">game autosets the amount of turns you use when exploring so you dont have to keep typing in the amount of turns you want every time you use scout, produce and discipline.</font>
                <br>&bull;
                <font color="#770000">use macromedia flash for your profile and crew profile media.</font>
                <br>&bull;
                <font color="#770000">crew icons upload limit goes to 5000 bytes.</font>
                <br>&bull;
                <font color="#770000">change pimp name during game play.</font>
                <br>&bull;
                <font color="#770000">reset your attacks out.</font>
                <br>&bull;
                <font color="#770000">and more...</font>
                <br>
    <br>
                </td>
                </tr>
                </table>
                        <?
             
    }
        }
    }

    ?>
    If that doesn't work, then try adding/subtracting { and }s from the bottom of the script.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rich Cook

  • #9
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    what you posted now is different from your original post. do this on the last couple lines
    PHP Code:
                </td>
                </tr>
                </table>
                        <?
                
    }
            }
        }
    }

    ?>

  • #10
    Regular Coder
    Join Date
    May 2006
    Location
    Canada
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok i tried that and it didnt work...but then i added a }...and now nothing shows up?


    so now the bottom looks like this


    PHP Code:
                        <?
                  
    }
             }
        }
    }

    ?>
    Rawli

  • #11
    New Coder
    Join Date
    Jul 2006
    Location
    California
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, this may be simple.... you are calling a function. Are you actually calling it?
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rich Cook

  • #12
    Regular Coder
    Join Date
    May 2006
    Location
    Canada
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts
    not sure lol
    Rawli

  • #13
    New Coder
    Join Date
    Jul 2006
    Location
    California
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts
    xP

    Well that may be something to check out.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rich Cook

  • #14
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    do you see where it says function paypal(...) ? it means you need to call that function now if you want it to run what's inside the function.
    here you go:
    http://us2.php.net/manual/en/languag...s.user-defined

  • #15
    Regular Coder
    Join Date
    May 2006
    Location
    Canada
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PHP Code:
    <?
    function paypal($price,$credits,$custom)
    {
     echo 
    " function paypal.\n";

        global 
    $GAMENAME$DOMAIN;
        
    ?>

    that is at the top of the script now...and still nothing enless i didnt so something right?
    Rawli


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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