Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Wts wrong here?

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
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
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
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
Close
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
Close
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
Close
hm well yea..
 
0
Close
very weird, what version of PHP and what kinda of server do you have
 
0
Close
lol
all they gave me was ftp acess...dont know wt version of php or wt kinda server they got
 
0
Close
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
Close
php works...yea i have tried tht..the site is using other simple php stuff like the include feature..
 
0
Close
Try adding a slash (/) after thumb in line 2 i.e.

$images = "gallery/thumb/";

Let me know of the results...
 
0
Close
Same error :(
 
0
Close
CatchedCatched

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back