PDA

View Full Version : Is there anything wrong with this code?



anhedonia
June 30th, 2003, 03:25
I am having some problems with this PHP code:


<?php
/************************************************************ **************
* *
* īmages - A Web Based image Gallery management system *
* --------------------------------------------------------------- *
* *
* File: config.php *
* Copyright: (C) 2002 January Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.7 *
* *
* Never released without support from: Nicky (http://www.nicky.net) *
* *
************************************************************ **************
* *
* This Script is not Freeware. Please you read the license *
* conditions (Lizenz.txt) for further information. *
* -------------------------------------------------------------- *
* This script is EMERGENCY freeware! Please READ the copyright Notice *
* (Licence.txt) for information. *
* *
************************************************************ *************/

$$db_servertype = " mysql ";
$$db_host = " localhost ";
$$db_name = " dbname ";
$$db_user = " myusername ";
$$db_password = " mypassword ";

$$table_prefix = " īmages _ ";

define('ĪMAGES_ACTIVE ', 1);

? >

When uploaded onto the server this error appears:


Parse error: parse error, unexpected '?' in /home/hillm/public_html/david/photos/config.php on line 35

I am a total PHP newbie, so I don't know how to fix this. Also, I presumed because I got this code off the support website for the particular thing I am trying to install (4imagesde), it would be correct... No such luck! Thanks in advance. :)

CareBear
June 30th, 2003, 04:14
replace "? >" with "?>" and try again :)

Added to say that you will probably need to replace the values for:
$$db_name = " dbname ";
$$db_user = " myusername ";
$$db_password = " mypassword "; with the details your host gave you. Just replace what's in between the " " with the proper name/password.

anhedonia
June 30th, 2003, 05:54
I tried removing the space so it was "?>", it didn't work. :( Also, I just removed all my server info (db name, username, etc etc) for "security reasons" before posting here.

Thanks for your reply...I don't know why it isn't working. :confused2

HugoLeite
June 30th, 2003, 06:29
try using " instead of ' in
define('ĪMAGES_ACTIVE ', 1);

and try using a IMAGES_ACTIVE over the ĪMAGES_ACTIVE, because of the ^ sign...

don't really know if it is going to work...

:) hope it helps...

go here to the explanation of define function, since that it's where you error line is define function (http://pt.php.net/manual/en/function.define.php)

dawizman
June 30th, 2003, 12:43
Well, your comments were done wrong. This should work:



<?php
/* ************************************************************ **************
* *
* īmages - A Web Based image Gallery management system *
* --------------------------------------------------------------- *
* *
* File: config.php *
* Copyright: (C) 2002 January Sorgalla *
* Email: jan@4homepages.de *
* Web: <a href="http://www.4homepages.de" target="_blank">http://www.4homepages.de</a> *
* Scriptversion: 1.7 *
* *
* Never released without support from: Nicky (<a href="http://www.nicky.net" target="_blank">http://www.nicky.net</a>) *
* *
************************************************************ **************
* *
* This Script is not Freeware. Please you read the license *
* conditions (Lizenz.txt) for further information. *
* -------------------------------------------------------------- *
* This script is EMERGENCY freeware! Please READ the copyright Notice *
* (Licence.txt) for information. *
* *
************************************************************ ************
*/

$db_servertype = "mysql";
$db_host = "localhost";
$db_name = "dbname";
$db_user = "myusername";
$db_password = "mypassword";

$table_prefix = "images _";

define('IMAGES_ACTIVE', 1);

? >

anhedonia
July 2nd, 2003, 02:26
Well thanks for your help guys, but none of what you have said has worked so far. :(

dawizman, I get this error with your code:


Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/hillm/public_html/david/photos/config.php on line 54

dawizman
July 2nd, 2003, 02:50
oh, my bad, try this:


<?php
/* ************************************************************ **************
* *
* īmages - A Web Based image Gallery management system *
* --------------------------------------------------------------- *
* *
* File: config.php *
* Copyright: (C) 2002 January Sorgalla *
* Email: jan@4homepages.de *
* Web: <a href="http://www.4homepages.de" target="_blank"><a href="http://www.4homepages.de" target="_blank">http://www.4homepages.de</a></a> *
* Scriptversion: 1.7 *
* *
* Never released without support from: Nicky (<a href="http://www.nicky.net" target="_blank"><a href="http://www.nicky.net" target="_blank">http://www.nicky.net</a></a> ) *
* *
************************************************************ **************
* *
* This Script is not Freeware. Please you read the license *
* conditions (Lizenz.txt) for further information. *
* -------------------------------------------------------------- *
* This script is EMERGENCY freeware! Please READ the copyright Notice *
* (Licence.txt) for information. *
* *
************************************************************ ************
*/

$db_servertype = "mysql";
$db_host = "localhost";
$db_name = "dbname";
$db_user = "myusername";
$db_password = "mypassword";

$table_prefix = "images _";

define('IMAGES_ACTIVE', 1);

?>

awayfromforum
July 2nd, 2003, 02:59
<?php

$db_servertype = "mysql";
$db_host = "localhost";
$db_name = "dbname";
$db_user = "myusername";
$db_password = "mypassword";

$table_prefix = "images_";

define('IMAGES_ACTIVE', '1');

?>


why make it hard when it could be as simple as could be?

anhedonia
July 2nd, 2003, 03:51
Neither of those work. I really have no idea. It looks like it just isn't going to. Thanks for all your help, everybody.

awayfromforum
July 2nd, 2003, 22:11
I think the define is the problem.

anhedonia
July 3rd, 2003, 04:33
I am unfamiliar with PHP, having only just started using it, so I have little to no idea how to even go about fixing this.

bloodyveins
July 3rd, 2003, 09:17
i didn't find something wrong with the codes. would you please add previous and following scripts. due to compilation matter, error signal sent doesn't always refer to the exact location.

anhedonia
July 4th, 2003, 02:41
All the codes I have tried are posted here... The first one that I posted is the code from the official site of the program I am attempting to use; so you would think it would work.