Page 2 of 2
Posted: Fri Apr 04, 2003 10:14 am
by Sly
i tried another webserver and i get this new error
Parse error: parse error, unexpected T_GLOBAL in /home3/loyalty/public_html/splash.php on line 8
my new line 8 is:
global $img_array;
following lines is:
$img_array[1] = "splashes/1/index.php";
$img_array[2] = "splashes/2/index.php";
$img_array[3] = "splashes/3/index.php";
global $random;
// if $random hasn't been defined by a prior call to this function
if (!isset($random)) {
// initialize the random-generator (obsolete for php 4.2+
srand ((double) microtime() * 1000000);
// get a random number that can be used as index for img_array
$random = rand(1, count($img_array));
Posted: Fri Apr 04, 2003 10:15 am
by volka
but a simpler script works?
for example?
what version do you use on what OS? phpinfo() will tell you.
Posted: Fri Apr 04, 2003 10:45 am
by twigletmac
What are the lines before the line on which the error is reported (1-7).
The problem is generally found in the lines before the one stated in the error message.
Mac
Posted: Sat Apr 05, 2003 12:51 am
by Sly
volka wrote:but a simpler script works?
for example?
what version do you use on what OS? phpinfo() will tell you.
yes this works
Posted: Sat Apr 05, 2003 2:51 am
by Sly
twigletmac wrote:What are the lines before the line on which the error is reported (1-7).
line 1-8
<?php
/**
creates an array img_array in global scope containing
the paths to all available splash-documents
returns a random doc-path once a request (if called again within the same request returns the same doc)
*/
function random_background() {
global $img_array;
it seems tat nothing was wrong...........
i can't get it running why?
i just add some comments
Posted: Sat Apr 05, 2003 3:08 am
by volka
what version do you use on what OS? phpinfo() will tell you.
Code: Select all
<?php
/**
dummy comment
dummy function
*/
function dummy() {
echo 'test';
}
dummy();
?>
does this work?
Posted: Sat Apr 05, 2003 6:47 am
by Sly
volka wrote:what version do you use on what OS? phpinfo()
i am trying it on 2 webhost,
spaceports and tripod
tripod is using php 4.1
spaceport's php version is 4.2.2
both doesnot work........
does it means that the features only support version 4.3 and above?
this is from spaceports' error (version 4.2.2)
Parse error: parse error, unexpected T_ECHO in /home3/loyalty/public_html/dummy.php on line 7
Posted: Sat Apr 05, 2003 7:15 am
by Sly
i downloaded php 4.3.1 and bad blue on my computer to try it
but it is still the same:
Parse error: parse error, unexpected T_STRING in D:\Program Files\BadBlue\PE\php\splash.php on line 2
line 1 and line 2 is:
<?php
function random_background() {
according to site admin, if i get a parse error means the above line got errors in it....
but
wat is the error in <?php
Posted: Sat Apr 05, 2003 7:20 am
by Sly
twigletmac wrote:I copied and pasted your code but didn't get any parse errors, have you tried deleting the first two lines completely and retyping them?
er.....
can you do it again and post the url in here,
is it convenient for you to do it?
if yes,
i could save the source down