PDA

View Full Version : THREADS MERGED - [ot] Php Help



Syntax-Error
04-10-03, 22:20
I need some help with PHP. im getting the following error

Parse error: parse error, unexpected T_STRING in Parse error: parse error, unexpected T_STRING in "" on line 50




<?php
include('const.php') or die('damn const.php file is missing, kicking you out of the install process;')

$link = @mysql_connect($dbhost, $dbuser, $dbpass) or die('cannot find the database, captain');

mysql_select_db($dbname) or die('cannot select the database');

the bold italic text is line 50



anyone PLEASE help me?

Nidhogg
04-10-03, 22:57
semi-colon missing off the end of the previous line? The include statement is not terminated.

N

P.S. I know we talked about this last night but I didn't know anything about PHP then.

d3ik
04-10-03, 22:57
Excuse me while I ponder the irony of your name versus the problem presented to us... :)

Typically with that error the problem would actually be on the line before... send me the complete source: devacon@devaconlabs.com and i'll fix it for you.

[Edit] - Lol... yeah or I could've just read your code in detail and seen what Nidhogg saw... good eye, Nid!

Syntax-Error
04-10-03, 23:02
o good now i get

Parse error: parse error, unexpected T_LNUMBER in "" on line 59


lol.. what now ?


(btw .. what happened nid.. u read a book on PHP ??)

Nidhogg
04-10-03, 23:08
Originally posted by Syntax-Error
(btw .. what happened nid.. u read a book on PHP ??) It was weird. I just happened to say "Tank, give me a coding program for the PHP scripting language", and next thing I know, it all makes sense. Go figure. :p

N

Syntax-Error
04-10-03, 23:12
lol

took me 3 times reading to work that out

i worried cos one of my mates nickname ingame is tank

and u really freaked me out cos i thort u were sumone for a sec...

dnt do that man

also.. it didnt work :P

Syntax-Error
05-10-03, 02:51
Still getting these errors even with the changes ive been told to add.. anyone else got anything new?

If you need to look at something just ask

LTA
05-10-03, 03:32
include('const.php') or die('damn const.php file is missing, kicking you out of the install process;') <---- try putting that ; outside the bracket first see if it helps it's almost nearly always a missing ; or to many spaces between lines or something O_o

Syntax-Error
05-10-03, 03:37
tried that. also replaced all with the actual values. changed the ' to " played with ;s and such like.. nothing :/

LTA
05-10-03, 03:48
hummm

include('const.php') or die('damn const.php file is missing, kicking you out of the install process;')


see the ) or die( try removing the space before "or"

Syntax-Error
05-10-03, 21:14
Use of undefined constant "" - assumed ""

lots of these. heres the script.. what can i do?


<? // All the constants in the game

$dbhost = 'localhost'; // MySQL server hostname
$dbuser = '';(removed for secuity) // MySQL username
$dbpass = '';(removed for secuity) // MySQL password
$dbname = 'elitesqu_promgames'; // MySQL database name
$version = 'ES 2.3.1'; // Game version number
$tbl = 'game3m_'; // Table prefix to run multiple games from the same DB
$playerdb = $tbl.'players'; // Player table name
$racedb = $tbl.'races'; // Races table name
$eradb = $tbl.'eras'; // Eras table name
$lotterydb = $tbl.'lottery'; // Lottery table name
$marketdb = $tbl.'market'; // Public Market table name
$messagedb = $tbl.'messages'; // Messages table name
$newsdb = $tbl.'news'; // News table name
$clandb = $tbl.'clan'; // Clans table name
$forumdb= $tbl.'forum'; //Forums table name
$threaddb= $tbl.'thread'; //Thread table name
$clanForumdb= $tbl.'clanForum'; //clan forum table name
$clanThreaddb= $tbl.'clanThread'; //clan forum's thread table name
$titledb= $tbl.'titles'; //table for titles
$forumconfig = $tbl.'config'; //forum config file

//INSTALLER
$installpwd = 'iamgod'; //this is the password to allow the installer script to install the db CHANGE IT

// REQUIRED
$httpref[1] = 'comp1'; // You can put here your full host: prom.test.com or part of it: test.com or: test
$httpref[2] = '192.168.8.2'; // You put here your IP or part of it: 127.0.0.1 or 127.0.0

//solve the WB bug
$config[allowwb] = 1; //0 = no, 1= yes

$config[protection] = 200; // Duration of protection
$config[initturns] = 150; // Turns given on signup
$config[maxturns] = 480; // Max accumulated turns (Default: 960 = 48 hours)
$config[maxstoredturns] = 240; // Max stored turns (Default: 480 = 24 hours)
$config[valturns] = 175; // How long before validation is necessary
$config[shamemult] = 5; // The 3% Multiplier. (Default: 5)
$config[nonattack] = 20; // The "Can't attack" (Default: 50)
$config[edneed] = 65000; // Acres Need for casting Emminent Domain (Default: 10000)
$config[edcap] = 750; // Emminent Domain Cap (Default: 5000)
$config[buymarket] = 0; // Let users in protection buy in the public market? (Default: 0) (0 = no) (1 = yes)
$config[maxattacks] = 20; // Too many attacks

$config[clans] = 1; // Let clans? (0=no)(1=yes)

$config[wmd] = 0; // Allow weapons of Mass Destruction? (0=no)(1=yes) note this is not yet available

$config[minvacation] = 48; // Minimum vacation duration
$config[vacationdelay] = 6; // Delay before empire is protected

//Cheating config created by Unimatrix
$cheat[ipcheck] = 1; //On sign up checks to see if anyone else has signed up using same IP. While it helps stop multis, families with multiple players and those behind proxies will have problems (0=no)(1=Yes)
$cheat[multiwait] = 48; //How many hours long until declared multi accounts are deleted (Default = 48 hour)
$cheat[cheatadmin] = 'cheating@mydomain.com'; //this is the email of who is incharge of dealing with cheaters.


// Styles Configuration

$config[maxstyles] = 5; // Max Styles
$styles[0] = "Default Style"; // 2nd Style
$styles[1] = "EZCLAN"; //3rd styles
$styles[2] = "EliteRed"; //4th style
$styles[3] = "QM Standard"; //5th style
$styles[4] = "Nuitari"; //Christmass theme

// Message Configuration

$config[maxmsg] = 10; // Max Messages you can send. (Default: 10)

// Aid Configuration

$config[canaid] = 1; // Can Send Aid? (0 = No, 1 = Yes)
$config[aidtax] = .33; // Aid Tax (Default: .10) (.10 = 10%)
$config[nonaid] = 3; // The Aid multiplier (Default: .75) meaning you can aid someone 1/75 your size.
$config[aid_ac] = 1; // This is an anti cheating measure, if you want to turn it off put 0 (Default: 1)
$config[maxaid] = 2; // This is the max aiding you can do. (Default: 1)
$config[aidhours] = 24; // The hours to reset the aiding :P (Default: 24) (From 1-24 please)
$config[maxaidget] = 1; // This is how many aid can you get (Default: 1)

// DB Configuration

$signupsclosed = 0; // Signups closed?
$lockdb = 0; // Lock the players database?
$lastweek = 0; // Last week of the game? don't allow loans

$turnsper = 10; // X turns
$perminutes = 30; // per Y minutes
$turnoffset = 0; // in case we don't run exactly 0 minutes after the hour
// Note: perminutes must divide evenly into 60
$healthper = 2; // how many health points do you recover everytime the turns.php script is runned.

$maxtickets = 5; // Maximum # of lottery tickets per empire
$config[jackpot] = 250000000000; //lottery base jackpot

$tick_curjp = 0; // DO NOT MODIFY THESE
$tick_lastjp = 1; // DO NOT MODIFY THESE
$tick_lastnum = 2; // DO NOT MODIFY THESE
$tick_lastwin = 3; // DO NOT MODIFY THESE
$tick_jpgrow = 4; // DO NOT MODIFY THESE

$trplst[0] = 'armtrp'; // an array of troop names so for loops can be used when all types are referenced
$trplst[1] = 'lndtrp'; // DO NOT MODIFY THESE
$trplst[2] = 'flytrp'; // DO NOT MODIFY THESE
$trplst[3] = 'seatrp'; // DO NOT MODIFY THESE
$trplst[4] = 'food'; // this commonly follows the troop listings


$config[armtrp] = 120; // Base market costs
$config[lndtrp] = 220;
$config[flytrp] = 360;
$config[seatrp] = 550;
$config[food] = 25;

$config[loanbase] = 6; // Base savings/loan rates
$config[savebase] = 4;
$config[buildings] = 2000; // Base building cost
$config[maxbuild] = 1000; // max builds
$config[market] = 1; // Hours to arrive on market
$config[mktshops] = 0.25; // percentage of cost black market bonus for which shops are responsible



// News text
$config[news] = '<span class="gnews">Prom Enhanced Patch installed<br><a href="http://www.hotscripts.com/cgi-bin/rate.cgi?ID=19896" target=_blank>Rate Our Program @ HotScripts.com</a>';

// Name of primary script file. DO NOT MODIFY
$config[main] = 'promisance.php';

// Site/path in which the game resides (always end it with /)
$config[sitedir] = 'http://server1.elitesquadrons.net/';

// server title
$config[servname] = 'Server1: Clans | Game 3';

// where we go when we logout
$config[home] = 'http://www.elitesquadrons.net/';

// link to forum for this game
$config[forums] = 'http://forums.elitesquadrons.net/index.php?c=6';

// administrative contact
$config[adminemail] = 'kfickert@drury.edu';

// From address of validation emails
$config[valemail] = 'nobody@elitesquadrons.net';

$config[updater] = 1; // Default: 1

DEFINE("VSI",10202012); //not sure what this is, let it be



$time = time(); // not really constants, but stuff used for all pages
$datetime = date('r');
$cookie = $HTTP_COOKIE_VARS;
?>

Nidhogg
05-10-03, 21:21
Thread merged.

N

Syntax-Error
05-10-03, 21:34
Hmm sorry nid never thought of that. cos it wuda been counted as a double post :rolleyes:

Nidhogg
05-10-03, 21:38
Double posting outside of the edit time limit is now allowed - so long as the new post is new and substantive (basically the same rule as for a bump).

N

Syntax-Error
05-10-03, 21:39
GOOD!!!

that or remove the time limit on editing your own posts.. i mean whats all that about?