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

2007-03-30 Thread Davi
Em Sexta 30 Março 2007 18:55, Ian escreveu:
 Parse error: syntax error, unexpected ';' in
 /hxxx/x/domains/x.com/public_html/blog/labels.php on line 15

 ul class=labels
 ?php
1 define('PREFIX', 'http://.x.com/labels');
2 
define('SEARCH_DIR','//x/domains/x.com/public_html/blog/labels');
3 define('THIS_FILE', 'cloud.php');
4 if(file_exists(SEARCH_DIR.'_cloud_include_cache.html') 
5 filemtime(SEARCH_DIR.'_cloud_include_cache.html')(time()-(60*60)))
6 echo file_get_contents(SEARCH_DIR.'_cloud_include_cache.html');
7 else
8 {
9 $output = '';
10 $files = array();
11 $dir = opendir(SEARCH_DIR);
12 while($file = readdir($dir))
13 if($file != '.'  $file != '..'  $file != THIS_FILE
14 amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;am
15 p;amp;amp; $file != CACHE_FILE)
16 {
17 $files[] = $file;
18 }

Try remove the amp;s...

[]s


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
Toothpaste never hurts the taste of good scotch.

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



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

2007-03-30 Thread Tijnema !

On 3/30/07, Ian [EMAIL PROTECTED] 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/x/domains/x.com/public_html/blog/labels.php on line 15

ul class=labels
?php
define('PREFIX', 'http://.x.com/labels');
define('SEARCH_DIR','//x/domains/x.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://.x.com/labels');
define('SEARCH_DIR','//x/domains/x.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




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



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

2007-03-30 Thread Ian
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 ! [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 On 3/30/07, Ian [EMAIL PROTECTED] 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/x/domains/x.com/public_html/blog/labels.php on line 15

 ul class=labels
 ?php
 define('PREFIX', 'http://.x.com/labels');
 define('SEARCH_DIR','//x/domains/x.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://.x.com/labels');
 define('SEARCH_DIR','//x/domains/x.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

 

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



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

2007-03-30 Thread Ian
Thanks very much for the help, Davi,, no more such errors.. :)

Ian
Davi [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
Em Sexta 30 Março 2007 18:55, Ian escreveu:
 Parse error: syntax error, unexpected ';' in
 /hxxx/x/domains/x.com/public_html/blog/labels.php on line 15

 ul class=labels
 ?php
1 define('PREFIX', 'http://.x.com/labels');
2
define('SEARCH_DIR','//x/domains/x.com/public_html/blog/labels');
3 define('THIS_FILE', 'cloud.php');
4 if(file_exists(SEARCH_DIR.'_cloud_include_cache.html') 
5 filemtime(SEARCH_DIR.'_cloud_include_cache.html')(time()-(60*60)))
6 echo file_get_contents(SEARCH_DIR.'_cloud_include_cache.html');
7 else
8 {
9 $output = '';
10 $files = array();
11 $dir = opendir(SEARCH_DIR);
12 while($file = readdir($dir))
13 if($file != '.'  $file != '..'  $file != THIS_FILE
14 
amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;am
15 p;amp;amp; $file != CACHE_FILE)
16 {
17 $files[] = $file;
18 }

Try remove the amp;s...

[]s


-- 
Davi Vidal
[EMAIL PROTECTED]
[EMAIL PROTECTED]
--

Agora com fortune:
Toothpaste never hurts the taste of good scotch. 

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



RE: [PHP] Parse Error - Help? (AGAIN)

2002-04-25 Thread Ford, Mike [LSS]

 -Original Message-
 From: Jason Soza [mailto:[EMAIL PROTECTED]]
 Sent: 25 April 2002 05:06
 
 Yike, now I wish I hadn't found it:
 
 [Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Wrong 
 datatype for second
 argument in call to in_array in beta_up.asp on line 61

57 function ext_valid ($filename) {
58
59 $extget = substr( strrchr($filename, .), 1);
60
61 $found = in_array($extget, $extval);
62
63 if ( $found ) {
64echo pfont color='red'center
65   . $message[invext]./font/center/p;
66
67$rc = 2;
68 }
69 }

$extval is undefined on line 61 -- it's neither a parameter to the function nor a 
variable defined in the function.  If you are intending to refer to the $extval 
defined in the global scope, you need to global it in the function:

57 function ext_valid ($filename) {
58
59 global $extval;

etc.

 [Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Undefined variable:
 upload_path in beta_up.php on line 73

Same.

 [Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Undefined variable:
 timestamp in beta_up.php on line 73

Same.

... and, I'd guess, same for most of the others.  Try globalling all the global 
variables you're using in functions, or passing them as parameters, and then try again.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 



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




Re: [PHP] Parse Error - Help? (AGAIN)

2002-04-25 Thread 1LT John W. Holmes

I don't have your original code (which, btw, you shoudn't ever post that
much code without explicitly saying what the error was, what line it was
one, highlighting that line, and saying what you've done so far), but these
errors are caused by not giving a default value to a variable, basically.

If you have something like this:

if($id = 5)
{
  //whatever
}

and $id hasn't been assigned a value, then you'll get that warning. In
previous versions of PHP, you wouldn't get the warning, you'd just get
FALSE.

So, before you test the value of a variable, or echo the value out, make
sure you've assigned it something.

if(!isset($id)) { $id = 0; }

Hopefully that's not too confusingit's hard to explain.

---John Holmes...


- Original Message -
From: Jason Soza [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, April 25, 2002 12:06 AM
Subject: RE: [PHP] Parse Error - Help? (AGAIN)


 Yike, now I wish I hadn't found it:

 [Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Wrong datatype for second
 argument in call to in_array in beta_up.asp on line 61
 [Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Undefined variable:
 upload_path in beta_up.php on line 73
 [Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Undefined variable:
 timestamp in beta_up.php on line 73
 [Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Undefined variable:  id
in
 beta_up.php on line 73
 [Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Undefined variable:
 HTTP_POST_FILES in beta_up.php on line 78
 [Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Undefined variable:
 upload_path in beta_up.php on line 79
 [Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Undefined variable:
 timestamp in beta_up.php on line 79
 [Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Undefined variable:  id
in
 beta_up.php on line 79
 [Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Undefined variable:
 message in beta_up.php on line 83
 [Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Undefined variable:
 filename3 in beta_up.php on line 177
 [Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Undefined variable:
 filename4 in beta_up.php on line 178

 What more do I have to do to define variables? I name what each variable
is
 with normal conventions - what would cause the above error messages? I
think
 the one that's most disturbing is the in_array() warning, need that to
work!

 Again, any help would be greatly appreciated!

 Jason

 -Original Message-
 From: Jason Soza [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 24, 2002 7:56 PM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] Parse Error - Help?


 Found it - just added another curly brace to the end of the code and it
 worked, so I searched up from there and found:

 function ext_valid ($filename) {

  $extget = substr( strrchr($filename, .), 1);

  $found = in_array($extget, $extval);

  if ( $found ) {
 echo pfont color='red'center
. $message[invext]./font/center/p;

 $rc = 2;
 }

 This function should have another curly brace at the end. Aha! Thanks for
 your help!

 Jason

 -Original Message-
 From: Tyler Longren [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 24, 2002 7:22 PM
 To: Jason Soza; [EMAIL PROTECTED]
 Subject: Re: [PHP] Parse Error - Help?


 Copy and paste the parse error into your e-mail.  Also, try placing
another
 } at the end of the code.  If you're missing a closing bracket
somewhere,
 that will take care of it.

 Tyler Longren
 Captain Jack Communications
 www.captainjack.com
 [EMAIL PROTECTED]


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



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




Re: [PHP] Parse Error - Help? (AGAIN)

2002-04-25 Thread Jason Soza

Sorry for the length of the code, but I felt I described the problem, 
(parse error, last line) and if I hadn't posted the entire code I 
probably would've been asked to. This list can be a little confusing 
for a newbie: just a couple days ago I read someone saying too much 
information is better than not enough and now I'm getting that I 
posted too much. I'm still learning! :)

What does the ! in if(!isset($id)) { $id = 0; } do? I think I get what 
this bit does in general: checks if $id has been assigned anything, if 
it's empty it gets assigned 0. Correct? Then I can use if($id) 
statements later on without having PHP return Undefined Variable 
errors. Right?

Thanks for your help, I'll work on my PHP listetiquette.

Jason Soza

- Original Message -
From: 1LT John W. Holmes [EMAIL PROTECTED]
Date: Thursday, April 25, 2002 5:35 am
Subject: Re: [PHP] Parse Error - Help? (AGAIN)

 I don't have your original code (which, btw, you shoudn't ever 
 post that
 much code without explicitly saying what the error was, what line 
 it was
 one, highlighting that line, and saying what you've done so far), 
 but these
 errors are caused by not giving a default value to a variable, 
 basically.
 If you have something like this:
 
 if($id = 5)
 {
  //whatever
 }
 
 and $id hasn't been assigned a value, then you'll get that 
 warning. In
 previous versions of PHP, you wouldn't get the warning, you'd just get
 FALSE.
 
 So, before you test the value of a variable, or echo the value 
 out, make
 sure you've assigned it something.
 
 if(!isset($id)) { $id = 0; }
 
 Hopefully that's not too confusingit's hard to explain.
 
 ---John Holmes...


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




RE: [PHP] Parse Error - Help? (AGAIN)

2002-04-25 Thread Maxim Maletsky \(PHPBeginner.com\)

 What does the ! in if(!isset($id)) { $id = 0; } do? 


It checks for the false return. If isset($id) returns false then the
'if' statement with (!) returns you true, and, as you just guessed, it
will assign a (0) to $id.



 this bit does in general: checks if $id has been assigned anything, if
 it's empty it gets assigned 0. Correct? Then I can use if($id)
 statements later on without having PHP return Undefined Variable
 errors. Right?


To stop receiving the messages from undefined variables add this at top
of your files:

error_reporting(55);

 
 Thanks for your help, I'll work on my PHP listetiquette.
 
 Jason Soza




Sincerely,

Maxim Maletsky
Founder, Chief Developer

www.PHPBeginner.com   // where PHP Begins









 
 - Original Message -
 From: 1LT John W. Holmes [EMAIL PROTECTED]
 Date: Thursday, April 25, 2002 5:35 am
 Subject: Re: [PHP] Parse Error - Help? (AGAIN)
 
  I don't have your original code (which, btw, you shoudn't ever
  post that
  much code without explicitly saying what the error was, what line
  it was
  one, highlighting that line, and saying what you've done so far),
  but these
  errors are caused by not giving a default value to a variable,
  basically.
  If you have something like this:
 
  if($id = 5)
  {
   //whatever
  }
 
  and $id hasn't been assigned a value, then you'll get that
  warning. In
  previous versions of PHP, you wouldn't get the warning, you'd just
get
  FALSE.
 
  So, before you test the value of a variable, or echo the value
  out, make
  sure you've assigned it something.
 
  if(!isset($id)) { $id = 0; }
 
  Hopefully that's not too confusingit's hard to explain.
 
  ---John Holmes...
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



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




RE: [PHP] Parse Error - Help? (AGAIN)

2002-04-25 Thread Philip Olson

 To stop receiving the messages from undefined variables add this at top
 of your files:
 
 error_reporting(55);

Or better yet, keep as you're doing and develop with E_ALL 
and fix those E_NOTICE errors correctly! ;)

Regards,
Philip Olson


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




Re: [PHP] Parse Error - Help? (AGAIN)

2002-04-25 Thread Nathan

I'll second that one... always better to code with register_globals = Off and E_ALL 
reporting level
IMHO.

# Nathan

- Original Message -
From: Philip Olson [EMAIL PROTECTED]
To: Maxim Maletsky (PHPBeginner.com) [EMAIL PROTECTED]

 To stop receiving the messages from undefined variables add this at top
 of your files:

 error_reporting(55);

Or better yet, keep as you're doing and develop with E_ALL
and fix those E_NOTICE errors correctly! ;)

Regards,
Philip Olson


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




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




Re: [PHP] Parse Error - Help? (AGAIN)

2002-04-25 Thread Jason Soza

Yeah, I think I'd rather fix the errors rather than just not see them. 
I'd still know they were there and it'd bug me!

Thanks everyone for your help!

Jason Soza

- Original Message -
From: Nathan [EMAIL PROTECTED]
Date: Thursday, April 25, 2002 9:14 am
Subject: Re: [PHP] Parse Error - Help? (AGAIN)

 I'll second that one... always better to code with 
 register_globals = Off and E_ALL reporting level
 IMHO.
 
 # Nathan
 
 - Original Message -
 From: Philip Olson [EMAIL PROTECTED]
 To: Maxim Maletsky (PHPBeginner.com) [EMAIL PROTECTED]
 
  To stop receiving the messages from undefined variables add this 
 at top
  of your files:
 
  error_reporting(55);
 
 Or better yet, keep as you're doing and develop with E_ALL
 and fix those E_NOTICE errors correctly! ;)
 
 Regards,
 Philip Olson


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




Re: [PHP] Parse Error - Help? (AGAIN)

2002-04-25 Thread 1LT John W. Holmes

I guess I missed the last line part, my bad.

Yes, you've got the idea for isset(). ! means NOT. So isset($id) will check
to see if $id is set, it doesn't care what the value is. !isset($id) will
see if $id is NOT set. A variable can be set and have an empty value, or be
false, null, etc.

The idea behind undefined variable is that you must assign a default value
to to the variable before you print it out or use it in a comparison. You
can adjust your error_reporting() so you don't get these errors, but it's
better to leave it on and make your code work. You can see they are just
warnings, and your code will still work. It's an easy way to find typo'd
variable names. Also, when register_globals is ON, you might use $id and
expect the value to be passed through the URL. By getting this warning when
you check $id, you should realize that the variable needs to be validated,
because it can be anything coming through the URL.

Hope that helps.

---John Holmes...

- Original Message -
From: Jason Soza [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, April 25, 2002 12:33 PM
Subject: Re: [PHP] Parse Error - Help? (AGAIN)


 Sorry for the length of the code, but I felt I described the problem,
 (parse error, last line) and if I hadn't posted the entire code I
 probably would've been asked to. This list can be a little confusing
 for a newbie: just a couple days ago I read someone saying too much
 information is better than not enough and now I'm getting that I
 posted too much. I'm still learning! :)

 What does the ! in if(!isset($id)) { $id = 0; } do? I think I get what
 this bit does in general: checks if $id has been assigned anything, if
 it's empty it gets assigned 0. Correct? Then I can use if($id)
 statements later on without having PHP return Undefined Variable
 errors. Right?

 Thanks for your help, I'll work on my PHP listetiquette.

 Jason Soza

 - Original Message -
 From: 1LT John W. Holmes [EMAIL PROTECTED]
 Date: Thursday, April 25, 2002 5:35 am
 Subject: Re: [PHP] Parse Error - Help? (AGAIN)

  I don't have your original code (which, btw, you shoudn't ever
  post that
  much code without explicitly saying what the error was, what line
  it was
  one, highlighting that line, and saying what you've done so far),
  but these
  errors are caused by not giving a default value to a variable,
  basically.
  If you have something like this:
 
  if($id = 5)
  {
   //whatever
  }
 
  and $id hasn't been assigned a value, then you'll get that
  warning. In
  previous versions of PHP, you wouldn't get the warning, you'd just get
  FALSE.
 
  So, before you test the value of a variable, or echo the value
  out, make
  sure you've assigned it something.
 
  if(!isset($id)) { $id = 0; }
 
  Hopefully that's not too confusingit's hard to explain.
 
  ---John Holmes...


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



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




Re: [PHP] Parse Error - Help? (AGAIN)

2002-04-25 Thread 1LT John W. Holmes

  To stop receiving the messages from undefined variables add this at top
  of your files:
  
  error_reporting(55);
 
 Or better yet, keep as you're doing and develop with E_ALL 
 and fix those E_NOTICE errors correctly! ;)

Well said...don't hide and ignore the warnings...fix them.

---John Holmes...


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




RE: [PHP] Parse Error - Help? (AGAIN)

2002-04-25 Thread Maxim Maletsky \(PHPBeginner.com\)

You know, I once said the same: better fix the notices and keep the code
clean. But as I've done several performance tests I came to a
conclusion that there's no much difference debugging the code yourself
or let PHP doing it. Often predefining manually a variable resulted to
me being even more 'expensive' then when PHP debugs it. I think it is
wise using this feature of PHP. The only reason not to is for having the
full control of your code.

Just my 2 Eurocents

Sincerely,

Maxim Maletsky
Founder, Chief Developer

www.PHPBeginner.com   // where PHP Begins



 -Original Message-
 From: Nathan [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 25, 2002 7:15 PM
 To: PHP
 Subject: Re: [PHP] Parse Error - Help? (AGAIN)
 
 I'll second that one... always better to code with register_globals =
Off and E_ALL
 reporting level
 IMHO.
 
 # Nathan
 
 - Original Message -
 From: Philip Olson [EMAIL PROTECTED]
 To: Maxim Maletsky (PHPBeginner.com) [EMAIL PROTECTED]
 
  To stop receiving the messages from undefined variables add this at
top
  of your files:
 
  error_reporting(55);
 
 Or better yet, keep as you're doing and develop with E_ALL
 and fix those E_NOTICE errors correctly! ;)
 
 Regards,
 Philip Olson
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



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




Re: [PHP] Parse Error - Help? (AGAIN)

2002-04-25 Thread Nathan

I would agree that performance-wise, there may be little difference in how fast a 
script runs. And
for pre-defining variables, sure you can get away without doing that and php will 
happily help you
out. However, I find it easier to debug my code knowing whether or not I remembered to 
assign a
value to my variable and where the heck it got assigned from. :-)

I would also like to point out that the combo of not registering globals and having 
all errors
reported will ensure you get the right data type when using the same variable names 
for _POST,
_SESSION, et cetera data. I had a few scripts that behaved differently than I though 
because I was
looking for the value of $foo and not realizing that my $foo was grabbing my session 
data instead of
what I thought I was assigning it to. I changed my php.ini and now I tear out far less 
hair this way
;-)

# Nathan


- Original Message -
From: Maxim Maletsky (PHPBeginner.com) [EMAIL PROTECTED]
To: 'Nathan' [EMAIL PROTECTED]; 'PHP' [EMAIL PROTECTED]
Sent: Thursday, April 25, 2002 12:18 PM
Subject: RE: [PHP] Parse Error - Help? (AGAIN)


You know, I once said the same: better fix the notices and keep the code
clean. But as I've done several performance tests I came to a
conclusion that there's no much difference debugging the code yourself
or let PHP doing it. Often predefining manually a variable resulted to
me being even more 'expensive' then when PHP debugs it. I think it is
wise using this feature of PHP. The only reason not to is for having the
full control of your code.

Just my 2 Eurocents

Sincerely,

Maxim Maletsky
Founder, Chief Developer

www.PHPBeginner.com   // where PHP Begins



 -Original Message-
 From: Nathan [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 25, 2002 7:15 PM
 To: PHP
 Subject: Re: [PHP] Parse Error - Help? (AGAIN)

 I'll second that one... always better to code with register_globals =
Off and E_ALL
 reporting level
 IMHO.

 # Nathan



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




RE: [PHP] Parse Error - Help? (AGAIN)

2002-04-25 Thread Maxim Maletsky \(PHPBeginner.com\)

 I would agree that performance-wise, there may be little difference in
how fast a
 script runs. And
 for pre-defining variables, sure you can get away without doing that
and php will
 happily help you
 out. However, I find it easier to debug my code knowing whether or not
I
 remembered to assign a
 value to my variable and where the heck it got assigned from. :-)


This is true. Whatever I write I always have variable *I* created, all
the rest are $_*[] and good old $HTTP_*_VARS[]. I always had register
globals off. So, in this way, since I know that every variable is mine,
why do I have to leave error_reporting E_ALL?

 
 I would also like to point out that the combo of not registering
globals and having all
 errors
 reported will ensure you get the right data type when using the same
variable names
 for _POST,
 _SESSION, et cetera data. I had a few scripts that behaved differently
than I though
 because I was
 looking for the value of $foo and not realizing that my $foo was
grabbing my session
 data instead of
 what I thought I was assigning it to. I changed my php.ini and now I
tear out far less
 hair this way
 ;-)


Once again, use $_SEESION and this is resolved.
Good point about variable types. Setting them before solves this
problem.

Sincerely,

Maxim Maletsky
Founder, Chief Developer

www.PHPBeginner.com   // where PHP Begins

 
 # Nathan
 
 
 - Original Message -
 From: Maxim Maletsky (PHPBeginner.com)
[EMAIL PROTECTED]
 To: 'Nathan' [EMAIL PROTECTED]; 'PHP'
[EMAIL PROTECTED]
 Sent: Thursday, April 25, 2002 12:18 PM
 Subject: RE: [PHP] Parse Error - Help? (AGAIN)
 
 
 You know, I once said the same: better fix the notices and keep the
code
 clean. But as I've done several performance tests I came to a
 conclusion that there's no much difference debugging the code yourself
 or let PHP doing it. Often predefining manually a variable resulted to
 me being even more 'expensive' then when PHP debugs it. I think it is
 wise using this feature of PHP. The only reason not to is for having
the
 full control of your code.
 
 Just my 2 Eurocents
 
 Sincerely,
 
 Maxim Maletsky
 Founder, Chief Developer
 
 www.PHPBeginner.com   // where PHP Begins
 
 
 
  -Original Message-
  From: Nathan [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, April 25, 2002 7:15 PM
  To: PHP
  Subject: Re: [PHP] Parse Error - Help? (AGAIN)
 
  I'll second that one... always better to code with register_globals
=
 Off and E_ALL
  reporting level
  IMHO.
 
  # Nathan
 



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




Re: [PHP] Parse Error - Help? (AGAIN)

2002-04-25 Thread Nathan

Fair enough, I suppose at that point it is simply a matter of preference, though I 
must maintain my
debug commentary... I really like knowing that the reason my $variable isn't 
displaying anything is
because I speeled it $varaible. :-)

Cheers,

# Nathan


- Original Message -
From: Maxim Maletsky (PHPBeginner.com) [EMAIL PROTECTED]
To: 'Nathan' [EMAIL PROTECTED]; 'PHP' [EMAIL PROTECTED]
Sent: Thursday, April 25, 2002 12:58 PM
Subject: RE: [PHP] Parse Error - Help? (AGAIN)


 I would agree that performance-wise, there may be little difference in
how fast a
 script runs. And
 for pre-defining variables, sure you can get away without doing that
and php will
 happily help you
 out. However, I find it easier to debug my code knowing whether or not
I
 remembered to assign a
 value to my variable and where the heck it got assigned from. :-)


This is true. Whatever I write I always have variable *I* created, all
the rest are $_*[] and good old $HTTP_*_VARS[]. I always had register
globals off. So, in this way, since I know that every variable is mine,
why do I have to leave error_reporting E_ALL?


 I would also like to point out that the combo of not registering
globals and having all
 errors
 reported will ensure you get the right data type when using the same
variable names
 for _POST,
 _SESSION, et cetera data. I had a few scripts that behaved differently
than I though
 because I was
 looking for the value of $foo and not realizing that my $foo was
grabbing my session
 data instead of
 what I thought I was assigning it to. I changed my php.ini and now I
tear out far less
 hair this way
 ;-)


Once again, use $_SEESION and this is resolved.
Good point about variable types. Setting them before solves this
problem.

Sincerely,

Maxim Maletsky
Founder, Chief Developer

www.PHPBeginner.com   // where PHP Begins


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




RE: [PHP] Parse Error - Help? (AGAIN)

2002-04-25 Thread John Holmes

I don't think performance should be as much of a concern as security.
When you get warnings about undefined variables, it should make you
think about where this variable's value is coming from. If
register_globals is off, then this isn't as much of an issue. If I use
$id, at least I know it's not coming from user input. 

Either way, you should develop with E_ALL so that you can make sure that
variables are set and checked correctly and to spot all the
mistakes/holes that you can. Once you go live, you set it so that NO
errors are reported (default in PHP 4.2) so that viewers can't glean any
info from failed scripts like path directories and file names...

---John Holmes...

 -Original Message-
 From: Maxim Maletsky (PHPBeginner.com)
 [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 25, 2002 11:19 AM
 To: 'Nathan'; 'PHP'
 Subject: RE: [PHP] Parse Error - Help? (AGAIN)
 
 You know, I once said the same: better fix the notices and keep the
code
 clean. But as I've done several performance tests I came to a
 conclusion that there's no much difference debugging the code yourself
 or let PHP doing it. Often predefining manually a variable resulted to
 me being even more 'expensive' then when PHP debugs it. I think it is
 wise using this feature of PHP. The only reason not to is for having
the
 full control of your code.
 
 Just my 2 Eurocents
 
 Sincerely,
 
 Maxim Maletsky
 Founder, Chief Developer
 
 www.PHPBeginner.com   // where PHP Begins
 
 
 
  -Original Message-
  From: Nathan [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, April 25, 2002 7:15 PM
  To: PHP
  Subject: Re: [PHP] Parse Error - Help? (AGAIN)
 
  I'll second that one... always better to code with register_globals
=
 Off and E_ALL
  reporting level
  IMHO.
 
  # Nathan
 
  - Original Message -
  From: Philip Olson [EMAIL PROTECTED]
  To: Maxim Maletsky (PHPBeginner.com)
[EMAIL PROTECTED]
 
   To stop receiving the messages from undefined variables add this
at
 top
   of your files:
  
   error_reporting(55);
 
  Or better yet, keep as you're doing and develop with E_ALL
  and fix those E_NOTICE errors correctly! ;)
 
  Regards,
  Philip Olson
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



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




Re: [PHP] Parse Error - Help?

2002-04-24 Thread Tyler Longren

Copy and paste the parse error into your e-mail.  Also, try placing another
} at the end of the code.  If you're missing a closing bracket somewhere,
that will take care of it.

Tyler Longren
Captain Jack Communications
www.captainjack.com
[EMAIL PROTECTED]

- Original Message -
From: Jason Soza [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, April 24, 2002 10:20 PM
Subject: [PHP] Parse Error - Help?


 Can someone take a look at this code for me? I'm pretty new to
programming,
 but looking at it I think it should work. I'm not saying there aren't
plenty
 of errors, because I'm sure there are. I'm getting a parse error on the
last
 line, and I can't see any reason for it. All of my ifs and functions are
 closed as far as I see. I guess I'm just looking for an unbiased eye here,
 I've been staring at this for a couple hours now. If you have comments on
to
 how I could simplify this code, that'd be great too. Otherwise, I just
need
 it to get it working. Thanks in advance -

 Jason Soza
 

 ?php

 // general config

 $timestamp = date(mdY);
 $id = time();
 $upload_path = incoming/;  // path to your upload directory
 $extval_use = 1; // turns on/off extension validation

 // mail config

 $xmailer = [EMAIL PROTECTED];
 $xsender = [EMAIL PROTECTED];
 $from = [EMAIL PROTECTED];
 $to = [EMAIL PROTECTED];
 $subject = Form submission;
 $boundary = b.md5(uniqid(time()));

 // form config

 $name = $_POST[name];
 $email = $_POST[email];
 $location = $_POST[location];
 $color = $_POST[color];
 $year = $_POST[year];
 $misc = $_POST[misc];

 // extension config

 $extval = array(php, php3, asp, bat, exe, com, jsp, cfml,
 shtml, dtcl);
 $filesize_limit_use = 1; // turns on/off size check
 $filesize_limit = 2048; // file size limit (in kB)

 // messages
 $message[fileisbig] = File is bigger than upload limit ( .
 $filesize_limit . kB);
 $message[invext] = Files of this type are not allowed, sorry.;
 $message[incomplete] = Upload is incomplete.;
 $message[complete] = Upload succesfully completed.;
 $message[uploadbutton] = Upload;
 $message[uploadtxt] = File for upload: ;
 $message[fileexists] = File already exists;

 // Define functions

 function filesize_check ($filesize) {

   if($filesize_limit  $filesize) {
  echo pfont color='red'center
   . $message[fileisbig]./font/center/p;
  $rc = 1;
   }

 }

 function ext_valid ($filename) {

  $extget = substr( strrchr($filename, .), 1);

  $found = in_array($extget, $extval);

  if ( $found ) {
 echo pfont color='red'center
. $message[invext]./font/center/p;

 $rc = 2;
 }

 function file_upload ($filename) {

   if ( file_exists($upload_path.$timestamp.-.$id.-.$filename) ) {
  echo pfont color='red'center
 . $message[fileexists]./font/center/p;

   } else {
  if( move_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'],
$upload_path.$timestamp.-.$id.-.$filename) ) {
 echo pcenter . $message[complete]./center/p;
  } else {
 echo pfont color='red'center
. $message[incomplete]./font/center/p;
  }

   }
 }

 function filename_mod ($filename) {
 ereg_replace([^a-z0-9._], ,
 ereg_replace ( , _,
 ereg_replace(%20, _,
 strtolower($orig_name;
 }

 $rc = 0;

 if($filesize_limit_use=1) {
   $filesize1 = $HTTP_POST_FILES['userfile1']['name'] / 1024;
//filesize
 in kB
   $filesize2 = $HTTP_POST_FILES['userfile2']['name'] / 1024;
//filesize
 in kB
   $filesize3 = $HTTP_POST_FILES['userfile3']['name'] / 1024;
//filesize
 in kB
   $filesize4 = $HTTP_POST_FILES['userfile4']['name'] / 1024;
//filesize
 in kB
}


 if ( isset($HTTP_POST_VARS[upload]) ) {


 if ($HTTP_POST_FILES['userfile1']['name']) {
 $orig_name1 = $HTTP_POST_FILES['userfile1']['name'];
 $filename1 = filename_mod ($orig_name1);
 filesize_check ($filesize1);
 if ( $rc == 0 ) {
 if($extval_use=1) {
 ext_valid ($filename1);
 }
   }
 if ( $rc == 0 ) {
 file_upload ($filename1);
 }
 }

 if ($HTTP_POST_FILES['userfile2']['name']) {
 $orig_name2 = $HTTP_POST_FILES['userfile2']['name'];
 $filename2 = filename_mod ($orig_name2);
 filesize_check ($filesize2);
 if ( $rc == 0 ) {
 if($extval_use=1) {
 ext_valid ($filename2);
 }
   }
 if ( $rc == 0 ) {
 file_upload ($filename2);
 }
 }

 if ($HTTP_POST_FILES['userfile3']['name']) {
 $orig_name3 = $HTTP_POST_FILES['userfile3']['name'];
 $filename3 = filename_mod ($orig_name3);
 filesize_check ($filesize3);
 if ( $rc == 0 ) {
 if($extval_use=1) {
 ext_valid ($filename3);
 }
   }
 if ( $rc == 0 ) {
 file_upload ($filename3);
 }
 }

 if ($HTTP_POST_FILES['userfile4']['name']) {
 $orig_name4 = $HTTP_POST_FILES['userfile4']['name'];
 $filename4 = 

Re: [PHP] Parse Error - Help?

2002-04-24 Thread Jason Wong

On Thursday 25 April 2002 11:20, Jason Soza wrote:
 Can someone take a look at this code for me? I'm pretty new to programming,
 but looking at it I think it should work. I'm not saying there aren't
 plenty of errors, because I'm sure there are. I'm getting a parse error on
 the last line, and I can't see any reason for it. All of my ifs and
 functions are closed as far as I see. I guess I'm just looking for an
 unbiased eye here, I've been staring at this for a couple hours now. If you
 have comments on to how I could simplify this code, that'd be great too.
 Otherwise, I just need it to get it working. Thanks in advance -


 if ( isset($HTTP_POST_VARS[upload]) ) {


   if ($HTTP_POST_FILES['userfile1']['name']) {
   $orig_name1 = $HTTP_POST_FILES['userfile1']['name'];
   $filename1 = filename_mod ($orig_name1);
   filesize_check ($filesize1);
 if ( $rc == 0 ) {
   if($extval_use=1) {
   ext_valid ($filename1);
   } 
   }
   if ( $rc == 0 ) {
   file_upload ($filename1);
   } - HERE
   }

Could it be this extra closing brace?

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Semper Fi, dude.
*/

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




RE: [PHP] Parse Error - Help?

2002-04-24 Thread Jason Soza

Found it - just added another curly brace to the end of the code and it
worked, so I searched up from there and found:

function ext_valid ($filename) {

 $extget = substr( strrchr($filename, .), 1);

 $found = in_array($extget, $extval);

 if ( $found ) {
echo pfont color='red'center
   . $message[invext]./font/center/p;

$rc = 2;
}

This function should have another curly brace at the end. Aha! Thanks for
your help!

Jason

-Original Message-
From: Tyler Longren [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 24, 2002 7:22 PM
To: Jason Soza; [EMAIL PROTECTED]
Subject: Re: [PHP] Parse Error - Help?


Copy and paste the parse error into your e-mail.  Also, try placing another
} at the end of the code.  If you're missing a closing bracket somewhere,
that will take care of it.

Tyler Longren
Captain Jack Communications
www.captainjack.com
[EMAIL PROTECTED]


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




RE: [PHP] Parse Error - Help? (AGAIN)

2002-04-24 Thread Jason Soza

Yike, now I wish I hadn't found it:

[Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Wrong datatype for second
argument in call to in_array in beta_up.asp on line 61
[Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Undefined variable:
upload_path in beta_up.php on line 73
[Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Undefined variable:
timestamp in beta_up.php on line 73
[Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Undefined variable:  id in
beta_up.php on line 73
[Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Undefined variable:
HTTP_POST_FILES in beta_up.php on line 78
[Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Undefined variable:
upload_path in beta_up.php on line 79
[Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Undefined variable:
timestamp in beta_up.php on line 79
[Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Undefined variable:  id in
beta_up.php on line 79
[Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Undefined variable:
message in beta_up.php on line 83
[Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Undefined variable:
filename3 in beta_up.php on line 177
[Wed Apr 24 19:42:18 2002] [error] PHP Warning:  Undefined variable:
filename4 in beta_up.php on line 178

What more do I have to do to define variables? I name what each variable is
with normal conventions - what would cause the above error messages? I think
the one that's most disturbing is the in_array() warning, need that to work!

Again, any help would be greatly appreciated!

Jason

-Original Message-
From: Jason Soza [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 24, 2002 7:56 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Parse Error - Help?


Found it - just added another curly brace to the end of the code and it
worked, so I searched up from there and found:

function ext_valid ($filename) {

 $extget = substr( strrchr($filename, .), 1);

 $found = in_array($extget, $extval);

 if ( $found ) {
echo pfont color='red'center
   . $message[invext]./font/center/p;

$rc = 2;
}

This function should have another curly brace at the end. Aha! Thanks for
your help!

Jason

-Original Message-
From: Tyler Longren [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 24, 2002 7:22 PM
To: Jason Soza; [EMAIL PROTECTED]
Subject: Re: [PHP] Parse Error - Help?


Copy and paste the parse error into your e-mail.  Also, try placing another
} at the end of the code.  If you're missing a closing bracket somewhere,
that will take care of it.

Tyler Longren
Captain Jack Communications
www.captainjack.com
[EMAIL PROTECTED]


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




Re: [PHP] Parse error..help!

2001-05-18 Thread Rasmus Lerdorf

 Here is another error i keep on getting, this is suppose to send me an email
 each time someone enters in my website but i keep on gettong this error
 message:

 Parse error: parse error in
 /home/virtual/ppcu/home/httpd/html/php2/login.php on line 8
 I don't see anything wrong, please help.

 ?

 SetLogging(1);

 Function AccessHit
 (

That's not how you define a function.  Use:

  function AccessHit() {
  ...
  }

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Parse error..help!

2001-05-18 Thread Keith Ng

In reply to [EMAIL PROTECTED]:

 Return-Path: [EMAIL PROTECTED]
 Received: from toye.php.net (va.php.net [198.186.203.51])
 by cobalt1.intermedia.com.sg (8.10.2/8.10.2) with SMTP id f4IDicZ30638
 for [EMAIL PROTECTED]; Fri, 18 May 2001 21:44:39 +0800
 Received: (qmail 23365 invoked by uid 1013); 18 May 2001 13:47:20 -
 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 Precedence: bulk
 list-help: mailto:[EMAIL PROTECTED]
 list-unsubscribe: mailto:[EMAIL PROTECTED]
 list-post: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 Received: (qmail 23359 invoked from network); 18 May 2001 13:47:20 -
 Reply-To: [EMAIL PROTECTED]
 From: Taline Makssabo [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Date: Fri, 18 May 2001 09:49:35 -0400
 Message-ID: [EMAIL PROTECTED]
 MIME-Version: 1.0
 Content-Type: text/plain;
 charset=iso-8859-1
 Content-Transfer-Encoding: 7bit
 X-Priority: 3 (Normal)
 X-MSMail-Priority: Normal
 X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
 Importance: Normal
 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
 Subject: [PHP] Parse error..help!
 X-UIDL: #l6!fL$#!:Bj!n1f!!

 Here is another error i keep on getting, this is suppose to send me an email
 each time someone enters in my website but i keep on gettong this error
 message:



 Parse error: parse error in
 /home/virtual/ppcu/home/httpd/html/php2/login.php on line 8
 I don't see anything wrong, please help.



 ?

 SetLogging(1);

 Function AccessHit
 (

 $NL = (\n);


 $H = getLastHost();


 $R = getLastRef();

 $To = [EMAIL PROTECTED];


 $Sub = Page Accessed;


 $D = Date(D d M y h:ia,time());

 $Msg = $H + $NL + $R + $NL + $D;

 mail($To,$Sub,$Msg);
 );
 AccessHit();

?

$NL = (\n)?

It should be $NL = \n;


Regards,
Keith Ng
___
Co-founder
K-Designs Incorporated
[EMAIL PROTECTED]

http://www.k-designs.com.sg/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Parse error..help!

2001-05-18 Thread Keith Ng

In reply to [EMAIL PROTECTED]:

 Return-Path: [EMAIL PROTECTED]
 Received: from toye.php.net (va.php.net [198.186.203.51])
 by cobalt1.intermedia.com.sg (8.10.2/8.10.2) with SMTP id f4IDicZ30638
 for [EMAIL PROTECTED]; Fri, 18 May 2001 21:44:39 +0800
 Received: (qmail 23365 invoked by uid 1013); 18 May 2001 13:47:20 -
 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
 Precedence: bulk
 list-help: mailto:[EMAIL PROTECTED]
 list-unsubscribe: mailto:[EMAIL PROTECTED]
 list-post: mailto:[EMAIL PROTECTED]
 Delivered-To: mailing list [EMAIL PROTECTED]
 Received: (qmail 23359 invoked from network); 18 May 2001 13:47:20 -
 Reply-To: [EMAIL PROTECTED]
 From: Taline Makssabo [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Date: Fri, 18 May 2001 09:49:35 -0400
 Message-ID: [EMAIL PROTECTED]
 MIME-Version: 1.0
 Content-Type: text/plain;
 charset=iso-8859-1
 Content-Transfer-Encoding: 7bit
 X-Priority: 3 (Normal)
 X-MSMail-Priority: Normal
 X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
 Importance: Normal
 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
 Subject: [PHP] Parse error..help!
 X-UIDL: #l6!fL$#!:Bj!n1f!!

 Here is another error i keep on getting, this is suppose to send me an email
 each time someone enters in my website but i keep on gettong this error
 message:



 Parse error: parse error in
 /home/virtual/ppcu/home/httpd/html/php2/login.php on line 8
 I don't see anything wrong, please help.



 ?

 SetLogging(1);

 Function AccessHit
 (

 $NL = (\n);


 $H = getLastHost();


 $R = getLastRef();

 $To = [EMAIL PROTECTED];


 $Sub = Page Accessed;


 $D = Date(D d M y h:ia,time());

 $Msg = $H + $NL + $R + $NL + $D;

 mail($To,$Sub,$Msg);
 );
 AccessHit();

?

Right... so all in all the code should be:

---
?

SetLogging(1);

function AccessHit() {

$NL = \n;


$H = getLastHost();


$R = getLastRef();

$To = [EMAIL PROTECTED];


$Sub = Page Accessed;


$D = Date(D d M y h:ia,time());

$Msg = $H + $NL + $R + $NL + $D;

mail($To,$Sub,$Msg);

}
AccessHit();

?
---

Regards,
Keith Ng
___
Co-founder
K-Designs Incorporated
[EMAIL PROTECTED]

http://www.k-designs.com.sg/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Parse error..help!

2001-05-18 Thread infoz

It should be something like:

function AccessHit()
{
 ...
}



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Parse error..help!

2001-05-18 Thread elias

Were you a LISP programmer or something?



Taline Makssabo [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Here is another error i keep on getting, this is suppose to send me an
email
 each time someone enters in my website but i keep on gettong this error
 message:



 Parse error: parse error in
 /home/virtual/ppcu/home/httpd/html/php2/login.php on line 8
 I don't see anything wrong, please help.



 ?

 SetLogging(1);

 Function AccessHit
 (

 $NL = (\n);


 $H = getLastHost();


 $R = getLastRef();

 $To = [EMAIL PROTECTED];


 $Sub = Page Accessed;


 $D = Date(D d M y h:ia,time());

 $Msg = $H + $NL + $R + $NL + $D;

 mail($To,$Sub,$Msg);
 );
 AccessHit();

 ?




 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Parse error..help!

2001-05-18 Thread Greg K

Also take off the semicolon of the closing of the function }
Taline Makssabo [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Here is another error i keep on getting, this is suppose to send me an
email
 each time someone enters in my website but i keep on gettong this error
 message:



 Parse error: parse error in
 /home/virtual/ppcu/home/httpd/html/php2/login.php on line 8
 I don't see anything wrong, please help.



 ?

 SetLogging(1);

 Function AccessHit
 (

 $NL = (\n);


 $H = getLastHost();


 $R = getLastRef();

 $To = [EMAIL PROTECTED];


 $Sub = Page Accessed;


 $D = Date(D d M y h:ia,time());

 $Msg = $H + $NL + $R + $NL + $D;

 mail($To,$Sub,$Msg);
 );
 AccessHit();

 ?




 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Parse error help!

2001-05-18 Thread Sam Masiello


Perhaps you want something like this:

$Msg = $H.$NL.$R.$NL.$D;

HTH

Sam Masiello
Systems Analyst
Chek.Com
(716) 853-1362 x289
[EMAIL PROTECTED]

 -Original Message-
From:   Taline Makssabo [mailto:[EMAIL PROTECTED]] 
Sent:   Friday, May 18, 2001 11:18 AM
To: [EMAIL PROTECTED]
Subject:[PHP] Parse error help!

Thanks for all the help guys but one more minor issue, i am not receiving
the email that someone accessed my page...why??



?
Function AccessHit()
{

$NL = \n;


$H = getLastHost();


$R = getLastRef();

$To = [EMAIL PROTECTED];


$Sub = Page Accessed;


$D = Date(D d M y h:ia,time());

$Msg = $H + $NL + $R + $NL + $D;

mail($To,$Sub,$Msg);
}


?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]