Need Help Urgently Please!

Discussion in 'PHP' started by spineshank, Mar 25, 2010.

  1. #1
    Hello. I am in need of a PHP expert to help me out with a little line of code. Basically, the site I need this fixed for is a Craigslist phone verified account seller, and when they click buy, it attempts to go to the buy page and I get a syntax error:

    Parse error: syntax error, unexpected $end in /home/xxxxxxxx/public_html/paypal.php on line 70
    Code (markup):
    Here is line 70:
    ?>
    Code (markup):
    And a few lines above, including line 70:
    if(constant('thanks_page')!=""){
    	$return_url=urlencode(constant('domainurl')."/".constant('thanks_page').";
    	$buyNow->addVar('return_url',$return_url);	
    }
    header('Location: '.$buyNow->getLink());
    require_once('clearresource.php');
    ?>
    Code (markup):
    If someone could help me, or if you need more information, just let me know.

    Thanks, appreciated very much! Whoever helps will get +rep.
     
    spineshank, Mar 25, 2010 IP
  2. Gray-Fox

    Gray-Fox Greenhorn

    Messages:
    90
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    I'm no PHP expert but I think the problem is:
    
    if(constant('thanks_page')!=""){
    	$return_url=urlencode(constant('domainurl')."/".constant('thanks_page')."[B][COLOR="Red"])[/COLOR][/B];
    	$buyNow->addVar('return_url',$return_url);	
    }
    header('Location: '.$buyNow->getLink());
    require_once('clearresource.php');
    ?>
    
    Code (markup):
    You need to close the urlencode() function. I've put the parentheses in Red where it has to be placed.
    Try to see if it works.
     
    Last edited: Mar 25, 2010
    Gray-Fox, Mar 25, 2010 IP
  3. spineshank

    spineshank Active Member

    Messages:
    304
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    75
    #3
    Oh! Thank you so much, it works now.

    Appreciate it. :) +rep
     
    spineshank, Mar 25, 2010 IP
  4. ThePHPMaster

    ThePHPMaster Well-Known Member

    Messages:
    737
    Likes Received:
    52
    Best Answers:
    33
    Trophy Points:
    150
    #4
    If you use programs with code highlighting it would pick up such problems and it will make your coding way easier. Just my 2 cents.
     
    ThePHPMaster, Mar 26, 2010 IP
  5. ivan.kristianto

    ivan.kristianto Active Member

    Messages:
    136
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #5
    i suggest use notepad++, it is the best free and light text editor.
     
    ivan.kristianto, Mar 26, 2010 IP
  6. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #6
    Its called syntax highlighting :p
     
    danx10, Mar 26, 2010 IP
  7. Gray-Fox

    Gray-Fox Greenhorn

    Messages:
    90
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #7
    Well I always used "PHP Editor" it has some small bugs, like freezing sometimes, then you have to pay attention and keep saving your work everytime.
    But even with this bug it's the best editor I ever used.
    *It comes in Portuguese, but after instalation you can set its langague to English.
     
    Gray-Fox, Mar 26, 2010 IP