NameSilo

Wts wrong here?

Spaceship Spaceship
Watch
Impact
19
hey
i duno y its not working
check it out for me please
PHP:
<?php 
$images = "gallery/thumb"; 
$big = "gallery"; 
$cols = "2"; 

if ($handle = opendir($images)) { 
while (false !== ($file = readdir($handle))) { 
if ($file != "." && $file != ".." && $file != rtrim($big,"/")) { 
$files[] = $file; 
} 
} 
closedir($handle); 
} 

$colCtr = 0; 

echo '<table width="100%" cellspacing="3"><tr>'; 

foreach($files as $file) 
{ 
if($colCtr %$cols == 0) 
echo '</tr><tr><td colspan="2"><hr /></td></tr><tr>'; 
echo '<td align="center"><a href="' . $images . $big . $file . '"><img src="' . $images . $file . '" /></a></td>'; 
$colCtr++; 
} 

echo '</table>' . "\r\n"; 

?>
it gives me the error
PHP:
Parse error: parse error, unexpected T_VARIABLE in F:\InetPub\wwwroot\schools\LauraScrds\thumbnail.php on line 2
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable DomainsUnstoppable Domains
I don't get a PHP parse error (or any error at all). Maybe it's not the code but something else that's wrong.
 
0
•••
hm i dont know
here is the url
http://www.dsbn.edu.on.ca/schools/LauraScrds/thumbnail.php

basically i m making a website for my school and i used cpgnuke at first but my staff is like old fashion ppl n they think cpgnuke is some kinda spyware tht will attack there server n stuff like tht so i have to use something tht has nothing to do wid cpgnuke..no mysql n all
n they want a gallery there..n it sux to make a page for every single picture..so i was looking for a simple PHP code [no mysql..because mysql is a "spyware" lol] to display images...
 
0
•••
I don't see anything wrong with line 2 or anywhere else. All I can think of is that something is messed up with the newline characters or variable options in php.ini. Does everything else work okay?
 
0
•••
hm well yea..
 
0
•••
very weird, what version of PHP and what kinda of server do you have
 
0
•••
lol
all they gave me was ftp acess...dont know wt version of php or wt kinda server they got
 
0
•••
Hmm... this is weird...

Have you tried just doing a simple example like

PHP:
<?php
echo 'Hello World';
?>

Just to make sure that works, I have no idea why you would be getting an error there. Is this the entire code? Is this file being included somewhere or are there includes above it or something?
 
0
•••
php works...yea i have tried tht..the site is using other simple php stuff like the include feature..
 
0
•••
Try adding a slash (/) after thumb in line 2 i.e.

$images = "gallery/thumb/";

Let me know of the results...
 
0
•••
Same error :(
 
0
•••
Unstoppable Domains
Domain Recover
DomainEasy โ€” Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back