Forum Moderators: coopster

Message Too Old, No Replies

T_STRING problem

help

         

dspro04

3:30 pm on Jun 1, 2005 (gmt 0)

10+ Year Member



Parse error: parse error, unexpected T_STRING in /home/example/public_html/db_connect.php on line 33

and here is my code

<?php
if(DB_CONNECT == 1) return;
define("DB_CONNECT",1);

$DEMO = true;
$CONST_COMPANY = "Dspro LTD "; // Company name (e.g. Truelove, Inc)
$CONST_AFFMAIL = "example@example.com"; // Affiliate mail address
$CONST_ADDR1 = "13 latham rd"; // Address line 1
$CONST_ADDR2 = "twickenham"; // Address line 2
$CONST_ADDR3 = "middlesex tw1 1bn"; // Address line 3
$CONST_ADDR4 = "United Kingdom"; // Address line 4
$CONST_MAIL = "info@example.com"; // Main mail address
$CONST_SUPPMAIL = "info@example.com"; // Support mail address
$CONST_URL = "www.example.com"; // Site URL www.sitename.com
$CONST_SD_URL = "www.example.com/demo/speeddating"; // Site URL www.sitename.com
$CONST_PAYMAIL = "pay@example.com"; // Paypal Account
$CONST_DEFAULT_LANGUAGE = 'EN';
$CONST_CURRENCY = "GB"; // Payments currency
$CONST_SYMBOL = "$"; // Payments currency symbol
$CONST_ZIPCODES = "Y"; // Include the zipcodes
$CONST_THUMBS = "Y"; // include thumnails (requires GD libraries)
$CONST_VIDEOS = "Y"; // include video profiles
$CONST_AUDIOS = "Y"; // include audio profiles
$CONST_FLIRT="Y"; // Include Flirting code
$CONST_RATING="Y"; // Include Rating code
$CONST_EMAIL_CONFIRM = "Y";
$CONST_FLIRTMAIL="info@example.com"; // email displayed for flirts
$CONST_IMAGE_COUNT = 4;
$CONST_INCLUDE_ROOT = "/usr/local/apache/home/username/public_html";
$CONST_LINK_ROOT = 'http://www.example.com;

// Date and time formats (See the PHP Manual for more info)
$CONST_FORMAT_DATE_SHORT = 'm/d/Y'; // e.g. 11/28/1981
$CONST_FORMAT_TIME_SHORT = 'H:i'; // e.g. 16:47

###########################################################
## start new text

//
// Layout Formatting
//
$CONST_TABLE_WIDTH = '100%'; // main table width (recommend 500 to 750, default 600, can also be %)
$CONST_TABLE_CELLPADDING = 0; // main table cellpadding (recommend 0 to 20, default 0)
$CONST_TABLE_CELLSPACING = 12; // main table cellspacing (recommend 0 to 20, default 10)
$CONST_MEMIMAGE_HEIGHT = 18; // member status image height - Do Not Change unless recreating image (default 18)
$CONST_MEMIMAGE_WIDTH = 120; // member status image width - Do Not Change unless recreating image (default 120)
$CONST_SUBTABLE_CELLSPACING = 0; // sub table cellspacing (recommend 1 to 5, default 0)
$CONST_SUBTABLE_CELLPADDING = 3; // sub table cellpadding (recommend 0 to 2, default 3)
$CONST_TABLE_ALIGN = "center"; // alignment of main table

$CONST_STORYIMAGE_HEIGHT = 75; // story image height pixels
$CONST_STORYIMAGE_WIDTH = 150; // story image width pixels
$CONST_STORYIMAGE_WEIGHT = 10; // story image weight KB

## end new text
###########################################################

//
// Database setup
//
$CONST_DB_HOST = "example";
$CONST_DB_NAME = "somename";
$CONST_DB_USER = "user";
$CONST_DB_PASS = "pass";

$CONST_SPEED_MATCH = 60*60*24*5; //how many time have users to define their matches after speed dating
$CONST_SPEED_SELECT = 2;

$CONST_INIT_FILE = $CONST_INCLUDE_ROOT."/init.php";
include $CONST_INIT_FILE;
?>

[edited by: jatar_k at 7:00 pm (utc) on June 1, 2005]
[edit reason] removed url [/edit]

dreamcatcher

3:52 pm on Jun 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi dspro04, welcome to Webmaster World. :)

This line is incorrect:

$CONST_LINK_ROOT = 'http://www.example.com;

Has a opening apostrophe, but no closing one.

dc

[edited by: jatar_k at 6:59 pm (utc) on June 1, 2005]
[edit reason] removed url [/edit]

Romeo

3:52 pm on Jun 1, 2005 (gmt 0)

10+ Year Member



Hi dspro04 and welcome here.

Thank you for your posting -- but what should we do with it?

Some unrelated comments:
-- I would not post database login details to a public forum.
$CONST_DB_HOST = "#*$!";
$CONST_DB_NAME = "#*$!";
$CONST_DB_USER = "#*$!";
$CONST_DB_PASS = "xxx";
-- do not hardwire these login values into the program, but put them into an include file instead which is best put 1 level above the web server's document root directory level ..
-- You may put a single quote sign at the end of this line:
$CONST_LINK_ROOT = 'http://xxxxx';
in case you don't like that T_STRING message

Regards,
R.

[edited by: Romeo at 3:56 pm (utc) on June 1, 2005]

dspro04

3:54 pm on Jun 1, 2005 (gmt 0)

10+ Year Member



now it says

Warning: main(): open_basedir restriction in effect. File(/usr/local/apache/home/username/public_html/init.php) is not within the allowed path(s): (/home/example/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/example/public_html/db_connect.php on line 70

Warning: main(/usr/local/apache/home/username/public_html/init.php): failed to open stream: Operation not permitted in /home/example/public_html/db_connect.php on line 70

Warning: main(): open_basedir restriction in effect. File(/usr/local/apache/home/username/public_html/init.php) is not within the allowed path(s): (/home/example/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/example/public_html/db_connect.php on line 70

Warning: main(/usr/local/apache/home/username/public_html/init.php): failed to open stream: Operation not permitted in /home/example/public_html/db_connect.php on line 70

Warning: main(): Failed opening '/usr/local/apache/home/username/public_html/init.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/example/public_html/db_connect.php on line 70

[edited by: jatar_k at 7:01 pm (utc) on June 1, 2005]
[edit reason] generalized url [/edit]

dspro04

7:26 pm on Jun 1, 2005 (gmt 0)

10+ Year Member



heres the problem

Warning: main(home/public_html/init.php): failed to open stream: No such file or directory in /home/dspro04/public_html/db_connect.php on line 70

Warning: main(home/public_html/init.php): failed to open stream: No such file or directory in /home/dspro04/public_html/db_connect.php on line 70

Warning: main(): Failed opening 'home/public_html/init.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/dspro04/public_html/db_connect.php on line 70

and heres the code

code is as above - jatar_k

[edited by: jatar_k at 7:41 pm (utc) on June 1, 2005]
[edit reason] removed urls and code [/edit]

dspro04

6:00 pm on Jun 2, 2005 (gmt 0)

10+ Year Member



any one

jatar_k

6:02 pm on Jun 2, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



the path you are using to include init.php in db_connect.php is wrong

dspro04

6:33 pm on Jun 2, 2005 (gmt 0)

10+ Year Member



wht whould it be im a total new 2 scripting

jatar_k

7:57 pm on Jun 2, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Warning: main(home/public_html/init.php): failed to open stream: No such file or directory in /home/dspro04/public_html/db_connect.php on line 70

the above error states that it could not open the file init.php because it does not exist in the place that is specified in the file dbconnect.php on line 70

open dbconnect.php and look at line 70
the path there is wrong
you need to find the right path to the file and put it into the function on line 70 in dbconnect.php

hard for me to explain more, once the path is right those specific errors should go away, though they may be replaced by others. ;)

An important thing to remember is to always work through your errors one by one from first to last. Often some errors pop out just because of previous errors.

dspro04

10:57 am on Jun 3, 2005 (gmt 0)

10+ Year Member



done some fixing and now at

Failure in connection Access denied for user: 'dspro04_admin@localhost' to database 'dspro04_dspro04dat'

dreamcatcher

1:51 pm on Jun 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This sounds like your database username/password or database name are incorrect.

Check your settings.

dspro04

3:20 pm on Jun 3, 2005 (gmt 0)

10+ Year Member



t_string erro alot of pages

exzple of one Parse error: parse error, unexpected T_STRING in /home/dspro04/public_html/login.php(39) : eval()'d code on line 8

and somem images and links are [adress**.com...]

they should be

[adress***.com...]

jatar_k

4:45 pm on Jun 3, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



sounds like you have an undefined constant in that one

dspro04

5:51 pm on Jun 3, 2005 (gmt 0)

10+ Year Member



i have this on many pages

jatar_k

6:03 pm on Jun 3, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



my gut says that constant is defined in some common library

dspro04

11:53 am on Jun 4, 2005 (gmt 0)

10+ Year Member



wht do nead 2 fix

jatar_k

4:19 pm on Jun 6, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you'll need to find what file that constant is defined in and then make sure it is being properly included.

my guess
the definition is in init.php
the includes for that file still aren't working properly and all of these problems are still coming from your original issue.

cctaco

10:00 pm on Jun 6, 2005 (gmt 0)



I have the exact same problem with os cart, did you get it fixed? I made a backup of the file and it still doesn't work after I restored it. I need help.

[edited by: jatar_k at 11:24 pm (utc) on June 6, 2005]
[edit reason] no urls thanks [/edit]