Re: [PHP] Parse error help.., thanks..



Hehe.., didn't i told i am poor in this, actually, never learn PHP before..
:)

No more such errors anymore thank you Tijnema! =)

Ian
""Tijnema !"" <tijnema@xxxxxxxxx> wrote in message
news:d8269d910703301520m164db1f1p5ea1a01ad631606e@xxxxxxxxxxxxxxxxx
On 3/30/07, Ian <ianlyy@xxxxxxxxx> wrote:
Hi everyone, i am new to PHP, but not a programmer..,
i got this php code to workout on something on my blog, but it seems that
it
gives me the following error:

Parse error: syntax error, unexpected ';' in
/hxxx/xxxxx/domains/xxxxx.com/public_html/blog/labels.php on line 15

<ul class="labels">
<?php
define('PREFIX', 'http://xxxx.xxxxx.com/labels');
define('SEARCH_DIR','/xxxx/xxxxx/domains/xxxxx.com/public_html/blog/labels');
define('THIS_FILE', 'cloud.php');
if(file_exists(SEARCH_DIR.'_cloud_include_cache.html') &&
filemtime(SEARCH_DIR.'_cloud_include_cache.html')>(time()-(60*60)))
echo file_get_contents(SEARCH_DIR.'_cloud_include_cache.html');
else
{
$output = '';
$files = array();
$dir = opendir(SEARCH_DIR);
while($file = readdir($dir))
if($file != '.' && $file != '..' && $file != THIS_FILE
&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;&

How can above string be ever correct....
$file != CACHE_FILE)
{
$files[] = $file;
}

--------
Anyhelp on this will ve be very much appreciated, thanks..

Ian
Try this code:
<ul class="labels">
<?php
define('PREFIX', 'http://xxxx.xxxxx.com/labels');
define('SEARCH_DIR','/xxxx/xxxxx/domains/xxxxx.com/public_html/blog/labels');
define('THIS_FILE', 'cloud.php');
if(file_exists(SEARCH_DIR.'_cloud_include_cache.html') &&
filemtime(SEARCH_DIR.'_cloud_include_cache.html')>(time()-(60*60)))
echo file_get_contents(SEARCH_DIR.'_cloud_include_cache.html');
else
{
$output = '';
$files = array();
$dir = opendir(SEARCH_DIR);
while($file = readdir($dir))
if($file != '.' && $file != '..' && $file != THIS_FILE && $file !=
CACHE_FILE)
{
$files[] = $file;
}

It should work, if not, come back here :)

Tijnema

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


.



Relevant Pages

  • Re: WhizBase vs. PHP
    ... NurAzije wrote: ... I am working on a study and I need expert opinion, ... and PHP please. ... Poor way to try and promote this stupid tool (and that's all ...
    (alt.php)
  • Re: [PHP] phpinfo displays blank page
    ... On 6/20/07, Tijnema wrote: ... So why doesn't my script work? ... you execute the PHP CLI with? ... >> you may have php setup to log elsewhere than the apache error log - if so ...
    (php.general)
  • Re: [PHP] dst and strtotime
    ... On 3/13/07, Tijnema! ... >>> Rob. ... It is not a PHP problem, i just checked it on a server running ... scalable system for accessing system services | ...
    (php.general)
  • Re: [PHP] Dreamhost! PHP as CGI!???
    ... Hi Tijnema! ... "DreamHost currently allows several PHP configurations. ... While it's no longer officially supported you currently still have the possibility to have PHP running as an Apache module. ...
    (php.general)
  • Re: [PHP] Saving css state in javascript and passing to php via form submit
    ... On 3/31/07, Tijnema! ... > 'processing' JSON formatted data is a matter of running a single eval ... All that "client side application logic" can also be done in PHP. ... then Javascript.(Tested using IE6, ...
    (php.general)