unexpected T_VARIABLE 'please need help)

Discussion in 'PHP' started by Lydie, Jan 1, 2008.

  1. #1
    Hi!

    I'm newbie and try to install a script but I get an error

    Parse error: parse error, unexpected T_VARIABLE in /homepages/45/d214711367/htdocs/ebooks-shop/conn.php on line 60

    I think someting is missing but don't know whatis it?

    Line 60 is =
    $TopBanner = "<a href="$afull1[BannerURL]" target=_blank><img src="banners/$afull1[BannerFile]" border=0
    title="$afull1[AltText]"></a>";


    Need you help please!

    I'm french and My english is bad so sorry for my english laguage.

    Lydie
     
    Lydie, Jan 1, 2008 IP
  2. hogan_h

    hogan_h Peon

    Messages:
    199
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You need to escape double quotes inside double quotes, etc...
    Try this:
    
     $TopBanner = "<a href=\"{$afull1['BannerURL']}\" target=\"_blank\"><img src=\"banners/{$afull1['BannerFile']}\" border=\"0\" title=\"{$afull1['AltText']}\"></a>";
    
    PHP:
     
    hogan_h, Jan 1, 2008 IP
  3. commandos

    commandos Notable Member

    Messages:
    3,648
    Likes Received:
    329
    Best Answers:
    0
    Trophy Points:
    280
    #3
    Lydie comme hogan le mentionne quand tu mets des guillemets pour un text il faut dire a php que ce n'est pas la fin en ajoutant un \ sauf pour le premier et dernier ...
     
    commandos, Jan 1, 2008 IP
  4. lv211

    lv211 Peon

    Messages:
    168
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Make sure you are using the right script for the right version of PHP.

    I have some sites on a host using PHP 4.x and I get a similar error when I'm using a script designed for PHP 5.x.
     
    lv211, Jan 1, 2008 IP
  5. Lydie

    Lydie Peon

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Merci beaucoup pour votre aide rapide.
    Thanks for your fast reply.

    Now there is another error

    Parse error: parse error, unexpected T_ELSEIF in /homepages/45/d214711367/htdocs/ebooks-shop/conn.php on line 62

    line 62 is : elseif(mysql_num_rows($rfull) == '1')

    Can you tell me what is the problem please
    Lydie



    $TopBanner = "<a href=\"{$afull1['BannerURL']}\" target=\"_blank\"><img src=\"banners/{$afull1['BannerFile']}\" border=\"0\" title=\"{$afull1['AltText']}\"></a>";

    elseif(mysql_num_rows($rfull) == '1')

    $afull = mysql_fetch_array($rfull);
    $TopBanner = "<a href=\"{$afull1['BannerURL']}\" target=\"_blank\"><img src=\"banners/{$afull1['BannerFile']}\" border=\"0\" title=\"{$afull1['AltText']}\"></a>";
     
    Lydie, Jan 1, 2008 IP
  6. nicangeli

    nicangeli Peon

    Messages:
    828
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I'm no PHP expert, but i would say try,

    
     elseif(mysql_num_rows($rfull) == 1)
    
    Code (markup):
     
    nicangeli, Jan 1, 2008 IP
  7. hogan_h

    hogan_h Peon

    Messages:
    199
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Uhm, if you got finished script, it could be something wrong with it, it looks like it wasn't even tested if it works or like lv211 said, you are using script version with php version for which it wasn't written for.

    Post some more code, post few lines before and after that line, because either an "if" statement is missing before that line or "curly" brackets aren't closed properly.
     
    hogan_h, Jan 1, 2008 IP
  8. Lydie

    Lydie Peon

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    it's a paypalestore srcipt I bought on the official website.

    Nicangeli I try

    elseif(mysql_num_rows($rfull) == 1)

    but the message error still the same.

    the right script for the right version of PHP. => sais on the website php4 or +

    I use php 5

    I send several email to the seller but he don't answer me. Maybe in holiday!:rolleyes:
     
    Lydie, Jan 1, 2008 IP
  9. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #9
    This error has nothing with the PHP version you are using.

    You have a mistake someplace, I need the entire IF statement.

    Use brackets "{}" to avoid mistakes:

    
    if ($a > $b) {
        echo "a is bigger than b";
    } elseif ($a == $b) {
        echo "a is equal to b";
    } else {
        echo "a is smaller than b";
    }
    
    PHP:
    Peace,
     
    Barti1987, Jan 1, 2008 IP
  10. Lydie

    Lydie Peon

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Hi azizny!
    thank you very much it's correct {} missed in the script.

    now i have another error line92

    Parse error: parse error, unexpected '{' in /homepages/45/d214711367/htdocs/ebooks-shop/conn.php on line 92

    and i don't see it?

    }elseif(mysql_num_rows($rbb) == '1')

    $abb = mysql_fetch_array($rbb);
    $SideBanner = "<a href=\"{$abb['BannerURL']}\" target=\"_blank\"><img src=\"banners/{$abb['BannerFile']}\" border=\"0\" title=\="{$abb['AltText']}\"></a>";

    an you tell me what is wrong please?

    Thank you
    Lydie
     
    Lydie, Jan 1, 2008 IP
  11. Lydie

    Lydie Peon

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    I find my error on line 92 but I have another one :

    Parse error: parse error, unexpected T_ELSE in /homepages/45/d214711367/htdocs/ebooks-shop/conn.php on line 127


     
    Lydie, Jan 2, 2008 IP
  12. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #12
    
    if($aset['LogMode'] == '1'){
    	if(!empty($_SESSION['cmr_name']) && !empty($_SESSION['cmr_pass'])){
    		$user_name = $_SESSION['cmr_name'];
    		@$user_pass = $_SESSION['cmr_pass'];
    		$status = $tpl->tbHtml('session_tpl.php', 'MY_CART_1');
    	}else{
    		@$user_name = $_SESSION['cmr_name'];
    		$status = $tpl->tbHtml('session_tpl.php', 'LOGIN_FORM');
    	}
    }else{
    	$_SESSION['cmr_name'] = 'customer';
    	$user_name = $_SESSION['cmr_name'];
    	$status = $tpl->tbHtml('session_tpl.php', 'MY_CART_2');
    }
    
    PHP:
    Always use indentation and brackets to avoid mistakes.

    Peace,
     
    Barti1987, Jan 2, 2008 IP
  13. Lydie

    Lydie Peon

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    ok, Thank you all!

    Lydie
     
    Lydie, Jan 2, 2008 IP
  14. commandos

    commandos Notable Member

    Messages:
    3,648
    Likes Received:
    329
    Best Answers:
    0
    Trophy Points:
    280
    #14
    close your else correctly , i can see few { not closed

    like at the last 2 else
     
    commandos, Jan 2, 2008 IP
  15. Lydie

    Lydie Peon

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #15
    It means working but when I want to connect this message display.

    Access denied for user 'dbo2267387'@'212.227.114.128' (using password: YES)

    In the Installation file is not written this message will display

    I don't what to do . Have you got an idea about this, please?

    Lydie
     
    Lydie, Jan 2, 2008 IP
  16. commandos

    commandos Notable Member

    Messages:
    3,648
    Likes Received:
    329
    Best Answers:
    0
    Trophy Points:
    280
    #16
    this looks more as a database error

    check your username and password
     
    commandos, Jan 2, 2008 IP
  17. Lydie

    Lydie Peon

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #17

    I configure database and register password YES and add other information but still not working.

    Do Someone have an idea?

    Lydie
     
    Lydie, Jan 2, 2008 IP
  18. commandos

    commandos Notable Member

    Messages:
    3,648
    Likes Received:
    329
    Best Answers:
    0
    Trophy Points:
    280
    #18
    did u add the user to the database ?
     
    commandos, Jan 2, 2008 IP
  19. Lydie

    Lydie Peon

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #19
    Yes, A database.sql file is join to the the script and I import it to my phpMyAdmin. But I thing I must set more information

    There are all tables and a "settings" table with admin information.

    Do I dowload this database.sql on ftp? the root of my website?


    Lydie
     
    Lydie, Jan 2, 2008 IP
  20. coffear

    coffear Member

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    43
    #20
    the error you received simply states that the user trying to connect to the database has been denied and that they did supply a password.

    If you use cPanel as the control panel ensure that you associated the user with the database. If I remember correctly it used to do it automatically after you created the suer but it does not now. Until you associate the user with the database that user will be denied.

    Also ensure that the control panel has not added a prefix to the username older versions of cPanel also did this.
     
    coffear, Jan 3, 2008 IP