Jump to content

Recommended Posts

Posted

Hello, I'm new here, just hosted a web to helio host ( why I need a new username for helio net ? )

 

Anyway, I need help with PHP script.

Always end up with T_VARIABLE error.

Here is the script :

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>Simple Smiley</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href="links.css" rel="stylesheet" type="text/css">

</head>

<style type="text/css">

<!--

.links { text-decoration: none; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt; color: #000000}

-->

</style>

<?php

$PictFolder=server.mappath("/picture/normal");

 

Set $fs=CreateObject("Scripting.FileSystemObject");

Set $f=$fs.$GetFolder[$PictFolder];

Set $fc=$f.$files;

 

$counter=0;

?>

 

<body link="#000000" vlink="#000000" alink="#000000">

<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td><img src="header.gif" width="800" height="100"></td>

</tr>

</table>

<table width="800" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#FF9900">

<tr bgcolor="#FFCC66">

<td height="25" colspan="2">  </td>

</tr>

<tr>

<td width="175" valign="top" bgcolor="#FFCC66">

<table width="175" border="0" cellspacing="0" cellpadding="0">

<tr>

<td height="30" background="menu.gif"> </td>

</tr>

</table>

<br>

<a href="index.php" class="links"><img src="dot.gif" width="15" height="10" border="0">Home</a><br>

<a href="normalsmiley.php" class="links"><img src="dot.gif" width="15" height="10" border="0">Normal smiley</a><br>

<a href="boardsmiley.php" class="links"><img src="dot.gif" width="15" height="10" border="0">Board smiley</a><br>

<a href="flagsmiley.php" class="links"><img src="dot.gif" width="15" height="10" border="0">Flag smiley</a><br>

<a href="zodiacsmiley.php" class="links"><img src="dot.gif" width="15" height="10" border="0">Zodiac smiley</a><br>

</td>

<td width="625" valign="top"> <br>

<table width="600" border="0" align="center" cellpadding="2" cellspacing="2">

<tr>

<?php

For each $fl in $fc;

if ($fl.$Type=="GIF Image") {

?>

<td><font size="2"><div align="center"><a href="download.php?Loc=picture/normal/<?php =$fl.$Name; ?>">

<img src= "picture/normal/<?php =$fl.$Name; ?>" border="0"></a><br>

<?php

$nama=$fl.$name;

echo strreverse(mid(strreverse($nama),5));

?>

</font></div></td>

<?php

$counter=$counter+1;

if (($counter $mod 7 == 0)) {

?>

</tr>

<tr>

<?php

}

}

}

?>

</tr>

</table>

<br>

</td>

</tr>

</table>

<?php

set $fs=nothing;

set $f=nothing;

set $fc=nothing;

?>

</body>

</html>

 

 

 

The error line always at scripting file system object.

Can someone help me ?

 

PS : sorry for any typos, English is not my 1st language.

Posted

Hello everyone!

 

( why I need a new username for helio net ? )

I guess the webmaster doesnt want or cant mod the forum and the webservers to use the same accounts list.

The forum uses its own structure to save user accounts, so does the accountscript for webservers.

If I am wrong, correct me, admin :P

 

For the script error part...

 

Hmm... Can you copy the errormessage?

I think there also is a linenumber given in it?

<?php

For each $fl in $fc;

if ($fl.$Type=="GIF Image") {

?>

EDIT: Whatever, I guess $fl is being retriven by the for loop. And what does the for loop do? Dont you need to mark the area the forloop needs to process for every hit?

And... Why do you use "Set"? Does it even do anything? You do not need to use that... Or do you?

I am not sure IF you show us the complete script, I even have no idea about $mod in...

<?php

$counter=$counter+1;

if (($counter $mod 7 == 0)) {

?>

 

Best you show us the errormessage, dont wanna tell anything wrong.

Posted

Well, I'm trying to create a picture gallery. That's the loop for, to keep reading the file in a directory.

That mod is for limiting picture number in a row.

 

Uhh... this script is heavily influenced from my asp experience. So, this is my 1st time using php using any reference I can get....

I guess the mod part is wrong. Not sure with the loop....

 

T_VARIABLE erroe on at line 16. That place will be this line.

 

Set $fs=CreateObject("Scripting.FileSystemObject");

 

Sorry, I'm really a newbie for php. ( I get those set command reference from any php examples I can get )

 

 

Posted

Parse error: syntax error, unexpected T_VARIABLE in /home/fsxyz/public_html/normalsmiley.php on line 16

 

Still keep having this error....

Is command set unusable with php ?

  • 2 weeks later...
Posted

Also not sure if this relates to this at all, but putting an @ symbol before the function removes the error message that can confuse a lot of users. :mellow:

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...