I have been trying to do some simple PHP to help with a Game Data Base on my website. i can’t use MySQL because the server does not support it BUT i am doing well with text files to store the info..
now the program is i keep getting errors.. really, i don’t know much about PHP so am a bit stuck. The Current error is ‘unexpected T_VARIABLE’.. All the errors seam to appear within the first few lines, which are the following..
[code=php]<?php
// Script pretty much created by Manic Man with help ^_^
// Declare Variable
global $GameTitle; //Name of the Game
global $GamePic; //Shorten Name used for Pictures etc..
global $Developer; //Developer Name
global $ReleaseJP; //Japanese Release Date
global $ReleaseUK; //English Release Date
global $ReleaseUS; //Amercian Release Date
global $Style; //Game Style
global $ActInfo; //Text about Level size
global $LevTot; //Total Number of Levels
global $LevNum; //Place to store Current Level Number
global $Levtitle; //Title of Current Level
global $userPage; //Stores the Page Name to be used in file getting
global $TextArray; //Temp array
global $N; //stores which number off the array is being added to
$N = 0;
?>
<?php
$userPage = $_GET[“page”];
$file = file($userPage & ‘.txt’);
foreach($file as $val)
{
$TextArray[$N] = ‘$val’;
$N = $N + 1;
}
?>
<? php
$GameTitle = $TextArray[0];
$GamePic = $TextArray[1];
$Developer = $TextArray[2];
$ReleaseJP = $TextArray[3];
$ReleaseUK = $TextArray[4];
$ReleaseUS = $TextArray[5];
$Style = $TextArray[6];
$ActInfo = $TextArray[7];
$LevTot = $TextArray[8];
$LevNum = $TextArray[9];
$Levtitle = $TextArray[10];
?>
I have so many <?php ?> because i find it easyer to have it in small bits so i can check it easyer.. what do you lot think?