Free ringtones and mp3 music - Child Trust Funds - Credit Check - Credit Cards - Free Advertising

PDA

View Full Version : unexpected T_VARIABLE 'please need help)


Lydie
Jan 1st 2008, 4:05 pm
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

hogan_h
Jan 1st 2008, 4:43 pm
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>";

commandos
Jan 1st 2008, 5:00 pm
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 ...

lv211
Jan 1st 2008, 5:07 pm
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.

Lydie
Jan 1st 2008, 5:36 pm
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>";

nicangeli
Jan 1st 2008, 5:45 pm
I'm no PHP expert, but i would say try,


elseif(mysql_num_rows($rfull) == 1)

hogan_h
Jan 1st 2008, 5:47 pm
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.

Lydie
Jan 1st 2008, 5:56 pm
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:

azizny
Jan 1st 2008, 8:49 pm
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";
}


Peace,

Lydie
Jan 1st 2008, 9:23 pm
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 2nd 2008, 8:23 pm
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


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');
}

azizny
Jan 2nd 2008, 8:35 pm
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');
}


Always use indentation and brackets to avoid mistakes.

Peace,

Lydie
Jan 2nd 2008, 9:39 pm
ok, Thank you all!

Lydie

commandos
Jan 2nd 2008, 9:44 pm
close your else correctly , i can see few { not closed

like at the last 2 else

Lydie
Jan 2nd 2008, 9:55 pm
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');
}


Always use indentation and brackets to avoid mistakes.

Peace,

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

commandos
Jan 2nd 2008, 10:12 pm
this looks more as a database error

check your username and password

Lydie
Jan 2nd 2008, 10:27 pm
this looks more as a database error

check your username and password


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

Do Someone have an idea?

Lydie

commandos
Jan 2nd 2008, 10:30 pm
did u add the user to the database ?

Lydie
Jan 2nd 2008, 10:35 pm
did u add the user to the database ?

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

coffear
Jan 3rd 2008, 2:54 am
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.

Lydie
Jan 3rd 2008, 4:56 am
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.

Hi coffear!

How do you create and associate the user account with database?

I have already a admin account with ID and password. Is it the same thing?

Lydie

Lydie
Jan 4th 2008, 12:59 pm
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.


Hi!

I create database admin. How to associate the user with database, please.

Lydie