Re: Re: [PHP] PHP Sessions Not Saving

2003-02-03 Thread nick
This is a system automated E-Mail reply.

If you email is a request for support then please visit the below URL and lodge 
your support request.
If you cannot access the below URL, then please email [EMAIL PROTECTED] for prompt 
support.
http://www.wildcomm.net/support.php

If this is not a support related E-Mail then disregard this E-Mail.

Regards.
Support Response
Wildthing Communications 
Mob: 0421 556847
PO Box 1841
SUNSHINE PLAZA
Maroochydore
QLD 4558
http://www.wildcomm.net
ICQ# 64851373





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




[PHP] site error

2003-08-04 Thread Nick
Site www.Lancoalition.com

On my site im receiving the following error:

Warning: Unknown(): open_basedir restriction in effect.
File(/home/lancoali/public_html/nuke/html/index.php) is not within the
allowed path(s):
(/home/*:/usr/lib/php:/usr/local/lib/php:/tmp:/usr/X11R6/bin) in Unknown on
line 0

Warning: Unknown(/home/lancoali/public_html/nuke/html/index.php): failed to
open stream: Operation not permitted in Unknown on line 0

Warning: (null)(): Failed opening
'/home/lancoali/public_html/nuke/html/index.php' for inclusion
(include_path='.:/usr/lib/php:/usr/local/lib/php') in Unknown on line 0


Can anyone explain why im getting this error, i made no changed before i got
this error.

--
Nick "[EMAIL PROTECTED]"



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



Re: Re[2]: [PHP] imagecolortransparent()

2002-07-23 Thread Nick

thanks it worked ^^
-Nick
"Tom Rogers" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> Tuesday, July 23, 2002, 5:16:43 AM, you wrote:
>
> N> "Tom Rogers" <[EMAIL PROTECTED]> wrote in message
> N> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >> Hello Nick,
> >>
> >> Monday, July 22, 2002, 8:47:39 PM, you wrote:
> >>
> >> N> i get php to allocate a colour then make it transparent using
> >> N> imagecolortransparent()
> >>
> >> N> instead of turning it transparent it becomes black.
> >>
> >> N> Is it something i'm doing wrong? can anyone help me?
> >>
> >> N> thanx in advance
> >>
> >> Post a bit of the code so we can see what you are doing
> >>
> >> --
> >> Tom
> >>
>
> N> $im = imagecreate($size, 21);
>
> N> $bgcolour =
> N>
imagecolorallocate($im,hexdec(substr($table[bg],0,2)),hexdec(substr($table[b
> N> g],2,2)),hexdec(substr($table[bg],4,2)));
> N> $fontcolour =
> N>
imagecolorallocate($im,hexdec(substr($table[fg],0,2)),hexdec(substr($table[f
> N> g],2,2)),hexdec(substr($table[fg],4,2)));
>
> N> if ($table[bg] == "no") {
> N>  $trans = imagecolortransparent ($im,$bgcolour);
> N> }
>
> probably what you need is:
>
> $im = imagecreate($size, 21);
> if ($table[bg] == "no") {
>$bgcolour = imagecolorallocate($im,1,1,1);
>$trans = imagecolortransparent ($im,$bgcolour);
> }
> else{
>  $bgcolour =
imagecolorallocate($im,hexdec(substr($table[bg],0,2)),hexdec(substr($table[b
g],2,2)),hexdec(substr($table[bg],4,2)));
> }
> $fontcolour =
imagecolorallocate($im,hexdec(substr($table[fg],0,2)),hexdec(substr($table[f
g],2,2)),hexdec(substr($table[fg],4,2)));
>
>
>
>
>
> --
> Best regards,
> Tom
>



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




[PHP] imagecolortransparent()

2002-07-22 Thread Nick

i get php to allocate a colour then make it transparent using
imagecolortransparent()

instead of turning it transparent it becomes black.

Is it something i'm doing wrong? can anyone help me?

thanx in advance



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




Re: [PHP] imagecolortransparent()

2002-07-22 Thread Nick


"Tom Rogers" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello Nick,
>
> Monday, July 22, 2002, 8:47:39 PM, you wrote:
>
> N> i get php to allocate a colour then make it transparent using
> N> imagecolortransparent()
>
> N> instead of turning it transparent it becomes black.
>
> N> Is it something i'm doing wrong? can anyone help me?
>
> N> thanx in advance
>
> Post a bit of the code so we can see what you are doing
>
> --
> Tom
>

$im = imagecreate($size, 21);

$bgcolour =
imagecolorallocate($im,hexdec(substr($table[bg],0,2)),hexdec(substr($table[b
g],2,2)),hexdec(substr($table[bg],4,2)));
$fontcolour =
imagecolorallocate($im,hexdec(substr($table[fg],0,2)),hexdec(substr($table[f
g],2,2)),hexdec(substr($table[fg],4,2)));

if ($table[bg] == "no") {
 $trans = imagecolortransparent ($im,$bgcolour);
}



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




[PHP] String delimeters, arg!

2001-05-01 Thread Nick

Hello PHP'ers

I am having a problem with string delimiters. For some reason no matter what I do I 
can not get them to process correctly!!
For example, 

";
?>

That outputs: 
yes no

What am I doing wrong?! Is there something I need to set in the php.ini file? I would 
like to be able to type \n instead of  repeatidly!

Also, when working with cookies, if I have a cookie that is set by, 

if (!isset($cookies)) {
//Set Cookies
$cookie_user = setcookie ("username", $row["user"], time()+86400, "/", "localhost");
$cookie_pass = setcookie ("password", $row["pass"], time()+86400, "/", "localhost");
$cookie_step = setcookie ("step", "1", time()+86400, "/", "localhost");
$cookies_set = setcookie ("cookies", "y", time()+86400, "/", "localhost");
}

Is there a way to unset the cookie? Perhaps by,
$cookie_set = setcookie ("cookies",""); 
?

Thanks for your time,

Nick



[PHP] XSLT variables in PHP

2001-05-17 Thread nick

I'm building an XSLT style sheet for a web site, and part of it 
revolves around the fact that sometimes a group of  will be 
highlighted and the rest of the time they will be a standard 
background colour.  In the example below, if the XML data that 
matches "primary", is equal to 1, than i want to print out a class of 
"highlight".  I have been trying to use variables and/or parameters.  
It never seems to see it.  I need the variable to be globally 
accessible.  And it needs to change at the XML/html conversion 
run time.  Pretty new to XSLT, so if anything has any ideas it would 
be great.  I am trying to seperate the display from the data, so i 
can't do any of the calculations in php, since a different style sheet 
may be doing something entirely different.   


$xslData.=<<














>>>


Nicholas Burke
Strategic Profits Inc.



-- 
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] bitwise comparison

2001-05-18 Thread nick

How can I store a large number, value over 8 billion for bitwise 
comparison?  I have a large set of switchs, getting up to 2 pow 34, and 
it goes outside the size of an int, can't set a type that will work.

Nicholas Burke
Strategic Profits Inc.


-- 
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] ../

2001-12-12 Thread Nick

Does anyone have any problems trying to use / and/or ../ in their paths?  Me
and a friend are both having problems on our site when we try it.  I'm using
PHP4 and he's using PHP3.  We both get "File not found" errors.  Anything we
could try?  Thanks...

-Nick


-- 
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] PHP & ssi

2001-12-21 Thread Nick

Is it possible to have a .php file parse SSI's?  I tried adding .php as a
SSI file but it overwrote the php type, and wouldn't display PHP.  And
vice-versa.  If not, i'd hafta write a php script that executes a program,
and take the output from that program and parse it, which I don't know how
to do.  If anyone can help on that, please do so, and if anyone knows how to
get SSI working with PHP, please let me know how.  Thanks.

-Nick


-- 
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] PHP & ssi

2001-12-21 Thread Nick

Well the include line I needed was this:
 Shane
> 
> On Friday 21 Dec 2001 5:45 pm, Nick wrote:
>> Is it possible to have a .php file parse SSI's?  I tried adding .php as a
>> SSI file but it overwrote the php type, and wouldn't display PHP.  And
>> vice-versa.  If not, i'd hafta write a php script that executes a program,
>> and take the output from that program and parse it, which I don't know how
>> to do.  If anyone can help on that, please do so, and if anyone knows how
>> to get SSI working with PHP, please let me know how.  Thanks.
>> 
>> -Nick
> 
> -- 
> 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]




[PHP] Can I detect 128 biit encryption with php

2001-04-09 Thread Nick

Hi

Is there a function in PHP that will tell me if the the users browser is
using 128 bit encryption or not.

Thanks

Nick Steele


-- 
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] How to change process permissions?

2001-06-22 Thread Nick

I couldn't find a group FAQ or anything on etiquette to I apologize if this
is the incorrect group or whatever.

I writing a web based admin panel for myself for my site. My PHP script
needs to be able to read, write, and move files around. The way I'm
currently getting it to work is by making a directory owned by "nobody" with
all permissions set so the script can write files there. Any file that is
created by the script also turns out to be owned by "nobody". This is ok,
except that don't want to have a directory owned by nobody which has all
permissions set, and I want to be able to overwrite files logged in as
myself without su'ing and chown'ing everything first. Is there a way like
there is in PERL to change the account the script runs as? Thanks!

Nick



-- 
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] php's future

2001-09-02 Thread nick

Hi all in the list :
I read an news that said jsp/asp.net is better than php..
 
They made a test that asp/php/jsp/asp.net using "for loops",
 
Jsp from 1 to 2 takes only 4 secs
Asp from 1 to 2000 (not 2) takes 72 secs
Php from 1 to 2000 (not 2) takes 68 secs
Asp.Net from 1 to 2 takes only 3.5~3.8 secs...
 
So is it time to learn jsp/asp+ instead of learning php ..???
I am so confused ~
I have been learning php for a while and now it said jsp/asp+ is better
than it.@@



RE: [PHP] php's future

2001-09-02 Thread nick

It's Chinese .

I translated it maybe u cannot understand bcoz my English is not
good 

First: jsp test for loop see below

 
 
<% 
int i=0; 
int j=0; 
int k=0; 
for(i=0;i<2;i++){ 
for(j=0;j<2;j++){ 

} 
} 
%> 
 
 

4 secs taken

Next : php test for loop see below (he didn't mention if it is php3
or php4)
 

84 secs taken ++"

Third : Asp for loop test 
<% 
response.write now 
response.write " 
" 
for i=0 to 2000 
for j=0 to 2000 
next 
next 
response.write now 
%>

64 secs taken

Last one : Asp+ for loop test

<% 
Dim intStart,intStop As DateTime 
Dim timeUse As TimeSpan 
dim Sum,i,j as int32 
intStart = DateTime.Now 
for i=1 to 2 
for j=1 to 2 
Sum=Sum + i 
next 
next 
intStop = DateTime.Now 
timeUse = intStop.Subtract(intStart) 
Response.Write (TimeSpan.ToString(timeUse)) 
%>

3.6 secs taken

if u can read Chinese u can go
http://www.webappcabaret.com/jsptw/doc/test-report.htm for more
infomation.

It's a website which teach jsp at all 


-Original Message-
From: Faisal Nasim [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 02, 2001 7:54 PM
To: nick
Subject: Re: [PHP] php's future 

Where did you see that?

Faisal

At 04:28 PM 9/2/2001, you wrote:
>Hi all in the list :
>I read an news that said jsp/asp.net is better than php..
>
>They made a test that asp/php/jsp/asp.net using "for loops",
>
>Jsp from 1 to 2 takes only 4 secs
>Asp from 1 to 2000 (not 2) takes 72 secs
>Php from 1 to 2000 (not 2) takes 68 secs
>Asp.Net from 1 to 2 takes only 3.5~3.8 secs...
>
>So is it time to learn jsp/asp+ instead of learning php ..???
>I am so confused ~
>I have been learning php for a while and now it said jsp/asp+ is better
>than it.@@




-- 
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] php's future

2001-09-02 Thread nick

Haha I tried its code and it only takes 1~2 secs to run it .

Wellgod damn lies

-Original Message-
From: nick [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 02, 2001 8:38 PM
To: 'Faisal Nasim'; [EMAIL PROTECTED]
Subject: RE: [PHP] php's future 

It's Chinese .

I translated it maybe u cannot understand bcoz my English is not
good 

First: jsp test for loop see below

 
 
<% 
int i=0; 
int j=0; 
int k=0; 
for(i=0;i<2;i++){ 
for(j=0;j<2;j++){ 

} 
} 
%> 
 
 

4 secs taken

Next : php test for loop see below (he didn't mention if it is php3
or php4)
 

84 secs taken ++"

Third : Asp for loop test 
<% 
response.write now 
response.write " 
" 
for i=0 to 2000 
for j=0 to 2000 
next 
next 
response.write now 
%>

64 secs taken

Last one : Asp+ for loop test

<% 
Dim intStart,intStop As DateTime 
Dim timeUse As TimeSpan 
dim Sum,i,j as int32 
intStart = DateTime.Now 
for i=1 to 2 
for j=1 to 2 
Sum=Sum + i 
next 
next 
intStop = DateTime.Now 
timeUse = intStop.Subtract(intStart) 
Response.Write (TimeSpan.ToString(timeUse)) 
%>

3.6 secs taken

if u can read Chinese u can go
http://www.webappcabaret.com/jsptw/doc/test-report.htm for more
infomation.

It's a website which teach jsp at all 


-Original Message-
From: Faisal Nasim [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 02, 2001 7:54 PM
To: nick
Subject: Re: [PHP] php's future 

Where did you see that?

Faisal

At 04:28 PM 9/2/2001, you wrote:
>Hi all in the list :
>I read an news that said jsp/asp.net is better than php..
>
>They made a test that asp/php/jsp/asp.net using "for loops",
>
>Jsp from 1 to 2 takes only 4 secs
>Asp from 1 to 2000 (not 2) takes 72 secs
>Php from 1 to 2000 (not 2) takes 68 secs
>Asp.Net from 1 to 2 takes only 3.5~3.8 secs...
>
>So is it time to learn jsp/asp+ instead of learning php ..???
>I am so confused ~
>I have been learning php for a while and now it said jsp/asp+ is better
>than it.@@




-- 
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]




[PHP] Mail System Error - Returned Mail

2004-07-27 Thread nick
The original message was included as attachment


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

[PHP] making links out of records? newbie

2005-03-15 Thread Nick
Hi there, i have a page called squad.php which queries a mysql table and 
outputs all the squad members from by football team. This is fine, 
however i would like to make each returned record into a hyperlink which 
when clicked on displays more details about that player.  I believe i 
need to use the $PHP_SELF command, how i do this though i do not know.  
Here is what i have so far:


// Performing SQL query
$query = 'SELECT * FROM tblusers WHERE squadnum <99';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
// Printing results in HTML
echo "\n";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {  
  echo "\t\n";
  foreach ($row as $col_value) {
  echo "\t\t$col_value\n";
  }
  echo "\t\n";
}
echo "\n";

?>
Any help much appreciated,  nick.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] making links out of records? newbie

2005-03-15 Thread Nick
Thanks, that seems to work fine.
Richard Lynch wrote:
Hi there, i have a page called squad.php which queries a mysql table and
outputs all the squad members from by football team. This is fine,
however i would like to make each returned record into a hyperlink which
when clicked on displays more details about that player.  I believe i
need to use the $PHP_SELF command, how i do this though i do not know.
Here is what i have so far:

// Performing SQL query
$query = 'SELECT * FROM tblusers WHERE squadnum <99';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
// Printing results in HTML
echo "\n";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
  echo "\t\n";
   

$id = $row['id'];
 

  foreach ($row as $col_value) {
   

echo "\t\t$col_value\n";
 

  }
  echo "\t\n";
}
echo "\n";
?>
Any help much appreciated,  nick.
--
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] how to write IF statement for login script

2005-03-23 Thread Nick
Hi,
I have a login script which has worked fine in the past, however i need 
to change the IF statement.  Basically all i want it to do is verify 
that $squadnum variable is inbetween 1-98 or is 99.  I'm not even 
entirely sure if i need to use the ereg function and i dont think the 
"1-98" bit is formatted correctly, any help would be much appreciated.

Heres the code i have so far:
if (ereg("1-98", $squadnum)) {  // users with id 1-98 should get sent to 
squad page
   header("Location: squad.php");
   }  else if(ereg("99", $squadnum)) {  // 99 is the id number of the 
site administrator
   header("Location: admin.php");
   }  else {
   header("Location: login.php");
   }

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


Re: [PHP] how to write IF statement for login script

2005-03-23 Thread Nick
Thanks, that seems to have worked.
M. Sokolewicz wrote:
Nick wrote:
Hi,
I have a login script which has worked fine in the past, however i 
need to change the IF statement.  Basically all i want it to do is 
verify that $squadnum variable is inbetween 1-98 or is 99.  I'm not 
even entirely sure if i need to use the ereg function and i dont 
think the "1-98" bit is formatted correctly, any help would be much 
appreciated.

Heres the code i have so far:
if (ereg("1-98", $squadnum)) {  // users with id 1-98 should get sent 
to squad page
   header("Location: squad.php");
   }  else if(ereg("99", $squadnum)) {  // 99 is the id number of the 
site administrator
   header("Location: admin.php");
   }  else {
   header("Location: login.php");
   }

Thanks, Nick
how about a non regular-expression solution?
if($squadnum > 0 && $squadnum < 99) {
header('Location: squad.php');
} elseif($squadnum == 99) {
header('Location: admin.php');
} else {
header('Location: login.php');
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] trying to unsubscribe

2005-05-12 Thread nick
i followed the instructions to unsubscribe because i am out of the country. 
did not work apparently.  can a mod help me please. 

nick

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



[PHP] function args declared by-reference, with default value?

2002-11-25 Thread Nick Eby
true or false:

when declaring a function, a given argument can be declared to pass by
reference, or can be declared to have a default value, but never both.

i.e., you can only write one of:
function foo(&$param)
function foo($param = "bar")

but never the equivalent of:
function foo(&$param = "bar")

is there a way to declare an argument with both pass-by-reference and
default-value properties?



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




[PHP] Re: mail() question!

2002-11-25 Thread Nick Eby
you can use the (optional) headers argument to mail() and add the From
header:

mail ($to, $subject, $body, "From: $from");

"Beauford.2002" <[EMAIL PROTECTED]> wrote in message
000f01c294e0$6ce1fcd0$6401a8c0@p1">news:000f01c294e0$6ce1fcd0$6401a8c0@p1...
> Hi,
>
> I have a form where a user enters an email address. The contents of the
form
> are then sent to myself, which works fine. The problem is that the from
> field says it is from nobody - how can I get it to say it is from the
email
> address the user inputted - or is this possible?
>
> TIA
>
>



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




[PHP] sorting files in directory

2002-11-27 Thread Nick Wilson
Hi all, 

I have several directories filled with files written like this:

*   02-09-19-filename.etc
*   02-10-02-anotherfile.whatever

How does php order these files if read from the directory and printed to
the screen?  -- I need them in date order, do I need to sort them
somehow?

Many thanks...

-- 
Nick Wilson //  www.tioka.com




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




Re: [PHP] sorting files in directory

2002-11-27 Thread Nick Wilson

* and then Justin French declared
> > How does php order these files if read from the directory and printed to
> > the screen?  -- I need them in date order, do I need to sort them
> > somehow?
> 
> There's an optional second parameter for asort() and rsort(), so check it
> out in the manual... it *may* be needed to get what you want.

Great, thanks everyone. Just wondered if it would have problems with
asort() and the dates in the filenames like:

*   02-11-23-whatever.php
*   02-12-03-whatever.php

Cheers...

-- 
Nick Wilson //  www.tioka.com




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




[PHP] max file size on uploading files

2002-11-27 Thread Nick Wilson
Hi all, 

I must be missunderstanding something here, I have this in an php 'upload
form':



So why won't it upload a 1.5MB file?

Many thanks

-- 
Nick Wilson //  www.tioka.com




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




Re: [PHP] max file size on uploading files

2002-11-27 Thread Nick Wilson

* and then Jason Wong declared
> On Thursday 28 November 2002 02:02, Nick Wilson wrote:
> > Hi all,
> >
> > I must be missunderstanding something here, I have this in an php 'upload
> > form':
> >
> > 
> >
> > So why won't it upload a 1.5MB file?
> 
> manual -> Handling File Uploads

Why don't you just not reply? -- It's the first place I went "I must be
missunderstanding something" --- Every time I post here you come along
with some rude unhelpfull comment.

Go and annoy someone else, I'm here to ask for help not rude unhelpful
comments (again, and again and again)

-- 
Nick Wilson //  www.tioka.com




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




Re: [PHP] max file size on uploading files

2002-11-27 Thread Nick Wilson

* and then Ernest E Vogelsinger declared
> I can just guess here... you've got 1 billion in max_file_size, maybe this
> is way too big for the browser's (integer?) math? Does it upload without
> max_file_size? Did you try setting max_file_size to 1572864 (which is
> exactly 1.5 MB)?

Nope, that doesn't do it

> Try the above hints and tell us about the outcome.

Well, I checked the php.ini and all the other things that could possibly
go wrong *before I originally posted* but have now done it again. No joy
there either ;-(

Next step, try the script on another machine I guess Thnaks for the
help Ernest...

-- 
Nick Wilson //  www.tioka.com




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




Re: [PHP] max file size on uploading files

2002-11-27 Thread Nick Wilson

* and then Nick Wilson declared
> Next step, try the script on another machine I guess Thnaks for the
> help Ernest...

Could it be an Apache 2.0 thing? -- just upgraded. THis is what I get:

Request entity too large!

The POST method does not allow the data transmitted, or the data volume exceeds the 
capacity limit.

If you think this is a server error, please contact the webmaster
Error 413

Thanks...

-- 
Nick Wilson //  www.tioka.com




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




Re: [PHP] max file size on uploading files

2002-11-27 Thread Nick Wilson

* and then Van Andel, Robert declared
> One problem may be your browser timing out before the end of the script.  Another 
>may be (although I'm not 100% sure) is that the file excedes the max memory set aside 
>by PHP.

Thanks Robert, that's not it though

-- 
Nick Wilson //  www.tioka.com




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




Re: [PHP] max file size on uploading files

2002-11-27 Thread Nick Wilson

* and then Ernest E Vogelsinger declared
> At 20:18 27.11.2002, Ernest E Vogelsinger spoke out and said:
> [snip]
> >Error 413 certainly denotes that the web server refuses to handle the
> >request. No idea how to configure this value but I'm sure it can be done
> >with Apache. I see a better chance of getting this answere on the apache
> >mailing list.
> [snip] 
> 
> I should check first and holler later.
> 
>  From the Apache docs (1.3.2):


Many thanks Ernest. It works fine on my hosts machine running 1.3 so
I'll downgrade my version as well, as rasmus has pointed out

Thanks for all your help ;-)

-- 
Nick Wilson //  www.tioka.com




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




[PHP] PHP Course - San Francisco, CA 12/16-12/18

2002-12-02 Thread Nick Cawthon
PHP Programming Bootcamp

DESCRIPTION: This hands-on PHP Programming course provides the knowledge
necessary to design and develop dynamic, database-driven web pages using PHP
version 4. PHP is a language written for the web, quick to learn, easy to
deploy and provides many advantages over other server-side scripting
languages. The course introduces the PHP framework and syntax, and covers in
depth the most important functions used to build dynamic data enriched web
applications. Students learn how to connect to any ODBC-compliant database,
and perform hands-on practice with a MySQL database to create
database-driven HTML forms and reports. Students will also learn how to
configure PHP and Apache Web Server. The course also introduces advanced
programming constructs, object oriented programming with PHP, and XML
parsing with PHP.


PREREQUISITES: Experience with a programming or scripting language and HTML.
DURATION: 3 Days
CONTACT: [EMAIL PROTECTED]
COST - $1295


Overview Of PHP

. Static vs. Dynamic Web Sites
. Dynamic Content from Databases
. Developing Dynamic Internet Applications
. Client-Side Scripting vs. Server-Side Scripting
. Overview of PHP Advantages and Capabilities
. Configuring PHP.INI

Conditional Constructs

. True and False Expressions
. Switch/Case Statement
. Timestamps

PHP Functions

. Introduction to Functions
. Declaring Functions
. Scope
. Passing Arguments to Functions
. Returning Values from a Function
. Using Include Files
. The Require Statement
. Recursion
. Dynamic Function Calls
. Predefined PHP Functions

Arrays in PHP

. What are Arrays?
. Usage of Arrays in PHP
. Indexing Arrays
. Initializing Arrays
. Adding and Removing from Arrays
. One-Dimensional Arrays
. Multi-Dimensional Arrays
. Array Functions

Working with Data Files in PHP

. Searching File Contents With Regular Expressions
. Changing and Editing File Contents
. Splitting and Joining Information Inside Files
. String Functions
. Regular Expression Functions
. Reading, Writing and Deleting Files
. Handling File Permissions
. File Locking
. Reading Directory Contents
. Creating and Deleting Directories

E-mail and PHP

. Using Mail Servers (SMTP and Send mail)
. Converting Messages to Readable Formats
. Sending E-mail
. Sending Attachments
. Sending Binary Attachments
. Sending HTML E-mail
. Validating an E-mail Address
. Automating E-mail Messaging

Basic Scripting and Looping Constructs

. PHP Scripting Fundamentals
. Print Statement
. Code Blocks
. Primitive Data Types
. Defining Constants and Variables
. Looping Constructs
. Exit & Break

Introduction to the Apache Web Server

. Configuration Files
. PHP Installation and Configuration
. WWW Sites within Apache
. Website Properties
. RPM Installation vs. Binary Installation

PHP Operators

. Logical Operators
. Relational Operators
. Bitwise Operators
. Other Operators

Working with Databases and Forms

. Configuring PHP For Database Support
. PHP's Database APIs
. PHP's SQL API
. MySQL vs. Access
. MySQL vs. SQL Server
. Database Drivers
. Database Driver Class Wrappers
. ODBC
. Simple SQL Queries via PHP
. Tracking Visitors with Session IDs
. Populating Forms
. Retrieving Data from Forms

Configuring and Using MySQL

. MySQL as a Client/Server Solution
. Introduction to MySQL Capabilities as a RDBMS
. Installing and Configuring MySQL
. Connecting to MySQL
. PHP Functions Specific to MySQL
. Executing SQL Calls
. Select
. Insert
. Fetch
. Update
. Delete
. Using PHP MyAdmin to configure MySQL

Using Cookies with PHP

. Purpose of Cookies
. Cookie Myths
. Setting Cookies
. Retrieving Cookies
. Expiring Cookies
. Deleting Cookies
. Storing Arrays in Cookies

Miscellaneous PHP Tasks

. Error Logging
. Session Management & Maintaining State
. How to Build a Shopping Cart
. Using Environmental Variables
. Changing Execution by Redirecting to Other URLs
. Embedding JavaScript with PHP
. Using HTTP and FTP Protocols to Pass Data
. Showing Different Content to Different Browsers
. Getting IP Addresses from Visitors



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




[PHP] Re: Show Folder Contents in Form

2002-12-02 Thread Nick Eby
you could first read the files and their modified-dates into an array; sort
the array; and finally build a select widget from the array...

function sortByTime($a, $b)
{
if ($a["time"] == $b["time"]) return 0;
return ($a["time"] < $b["time"]) ? -1 : 1;
}

while (false !== ($file = readdir("/some/directory/")))
{
if ($file != "." && $file != "..")
$files[] = array("file" => $file, "time" =>
filectime("/some/directory/".$file));
}

usort($files, "sortBytime");

echo "";
while (list(,$filearr) = each($files))
echo "".$filearr["file"]."
".$filearr["time"];

"Stephen" <[EMAIL PROTECTED]> wrote in message
000901c29a46$590a2320$0200a8c0@melchior">news:000901c29a46$590a2320$0200a8c0@melchior...
> Hello,
>
> Is it possible, and if so how, to get the filenames and last edited
> time/date, then display them in a select field in a form for a user to
> select? I'd need to show them in order of most recently edited to last
> edited. How can this be done if it can?
>
> Thanks,
> Stephen Craton
> http://www.melchior.us
>
> "Life is a gift from God. Wasting it is like destroying a gift you got
from
> the person you love most." -- http://www.melchior.us
>



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




[PHP] Re: invalid range

2002-12-02 Thread Nick Eby
looks like because you have a dash inside your character class; when inside
a character class the dash is a special character and you'd have to escape
it

eregi("^([a-zåäö_\.\- ]+)$", $value);

"Peter A" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
when I do this

eregi("^([a-zåäö_\.- ]+)$",$value);

I get this:

Warning: Invalid range end in
/home/zinekweb/public_html/corporate/_mcm_contacts_upload.php on line 42

Why?

I running Apache1.3 on my XP machine with PHP 4.2something.. but when I
upload to  a RedHat7.2 server with Apache.1.3 and PHP4.0something I get this
error.

Can anyone help me out here? Any clues?

   /peter a



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




[PHP] Medium to Large PHP Application Design

2003-01-09 Thread Nick Oostveen
As PHP becomes more accepted in the corporate world, it is only logical 
that larger and more complex applications are going to be developed using 
it.  While there is an abundance of information out there about making 
specific things work, there seems to be a shortage regarding the big picture.

As such, my question is this: What methods and techniques can be used to 
help design and build complex, medium to large PHP applications that are 
not only scalable, but maintainable and extensible?  I'm looking for online 
references, personal experience and opinion and even examples of open 
source code which you think demonstrate the above criteria on this one.  I 
think an extended discussion on this topic could be of great benefit to 
everyone.

Obviously separating application and business logic from interface code is 
a given, but what about other things? Are the object orientated facilities 
of PHP currently worth really trying to take advantage of? If so, what are 
you doing to take advantage of them? Are design concepts such as design 
patterns relevant at this level?  What frameworks, if any, currently exist 
to assist in rapid, structured development, and what specific benefits do 
they bring to the table?

These are just some of the questions that I'd like to see expanded upon, 
I'm sure there are others out there who can add more to the list.

Nick Oostveen


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



[PHP] Pre-built CMS - Anyone recommend one?

2003-01-12 Thread Nick Wilson
Hi all, 

I'm looking for a *free*, pre-built CMS with PHP/MySQL.

I've looked at ezpublish but I'm having trouble installing.

Criteria: 

*   Must have SE friendly urls (example.com/4/34/)
*   Must allow different 'sections' for articles
*   Must be easy to fix templates for the html/css

Anyone make a recommendation?

Many thanks...

-- 
Nick Wilson //  www.tioka.com




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




RE: [PHP] Alternate row colours - what is wrong with this code?

2003-01-17 Thread Clarkson, Nick

I think it's because you're setting the bgcolor="#bf" for the TD tag, so
it's overriding using the TR tag bgcolor. The maths is OK, so if you remove
the td bgcolor bit it *should* (standard disclaimer) work.

Nick

-Original Message-
From: Denis L. Menezes [mailto:[EMAIL PROTECTED]]
Sent: 17 January 2003 12:12
To: PHP general list
Subject: [PHP] Alternate row colours - what is wrong with this code?


Hello Guys,

I want alternating colours in the output table. Can someone tell me what is
wrong with this code? I get the data but no alternating colours.

Quote :

 ';
Print "" ;
 Print   "  $row[OrgName] ";
 print "   ";
 Print "" ;
 Print  $row[Country]; 
 print "   ";
 Print "" ;
 Print  $row[Date]; 
 print "   ";
 Print "" ;
 Print  $row[Number]; 
 print "   ";
 Print "" ;
 Print "";
Print"";
Print"";
 Print "";
Print "";}
   }
 ?>


Unquote.


Thanks
Denis


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




RE: [PHP] Alternate row colours - what is wrong with this code?

2003-01-17 Thread Clarkson, Nick

I've just tested this stripped down (some colours changed) version of your
code and I get alternating rows no problem. On another point, without the
 tags it won't work properly. I think your PHP works fine, it's your
HTML ;o)

Nick

";
for ($i = 0; $i<10;) {
print '';
print "TEST" ;
print " ";
}
print "";
?>





-Original Message-
From: Denis L. Menezes [mailto:[EMAIL PROTECTED]]
Sent: 17 January 2003 12:12
To: PHP general list
Subject: [PHP] Alternate row colours - what is wrong with this code?


Hello Guys,

I want alternating colours in the output table. Can someone tell me what is
wrong with this code? I get the data but no alternating colours.

Quote :

 ';
Print "" ;
 Print   "  $row[OrgName] ";
 print "   ";
 Print "" ;
 Print  $row[Country]; 
 print "   ";
 Print "" ;
 Print  $row[Date]; 
 print "   ";
 Print "" ;
 Print  $row[Number]; 
 print "   ";
 Print "" ;
 Print "";
Print"";
Print"";
 Print "";
Print "";}
   }
 ?>


Unquote.


Thanks
Denis


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




[PHP] Database abstraction class

2003-01-20 Thread Clarkson, Nick

Hi,

Can anyone give me any pointers for creating a database abstraction class ?
I know there are a few out there already, but I'm doing this purely as an OO
learning exercise. I'm only at the paper design right now and I've only got
this far;

Properties:

Persistent  - Persistent connection ? (Boolean)
User- Username (String)
Pass- Password (String)
Host- Database Server (String)
Port- Database Port (3306 default for MySQL
Query   - Query to run (String)
Result  - Query Result (String)
Error   - Error returned (if any)
NumRows - Num of rows returned from query (int)
NumCols - Num od columns returned from query (int)
RowsPerPage - Number of rows per page
PagingOn- Return results in page ? (Boolean)
CurrentPage - Current page number (int)

Methods:

Connect - Connect to db
Close   - Close connection
SelectDB- Select database
RunQuery- Execute query
OutputTable - Output query results in table
OutputPage  - Outputs page of query results (calls OutputTable)
FetchRow- Returns single row from query
CreateLink  - Creates HTML  tags for drill down queries


Are there any other properties/methods that would be useful ? Links/advice
welcome (read "needed")

Cheers,

Nick


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




RE: [PHP] Measuring Query Times

2003-01-22 Thread Clarkson, Nick

There's exactly the code you're looking for I think over on Evilwalrus -
http://www.evilwalrus.com/viewcode/632.php

Hope it helps,

Nick


-Original Message-
From: Peter Janett [mailto:[EMAIL PROTECTED]]
Sent: 22 January 2003 06:46
To: [EMAIL PROTECTED]
Subject: [PHP] Measuring Query Times


I'm trying to figure out if there is an easy way to measure how long my
queries in PHP/MySQL are taking to execute.

Any tips or code examples most appreciated.

Thanks,

Peter Janett

New Media One Web Services

New Upgrades Are Now Live!!!
Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1
Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25,
Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43

PostgreSQL coming soon!

http://www.newmediaone.net
[EMAIL PROTECTED]
(303)828-9882




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


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




RE: [PHP] HELP please quickly

2003-01-22 Thread Clarkson, Nick

I'm pretty new to PHP so I can't help you with the code per se, but how
about as an outline;

Open the first file and read values into an array.
Open the 2nd file and read in the first line.
Compare each value in the array to see if it occurs in the line from the 2nd
file you just read in.
If it occurs then write that value to the 3rd file
Repeat until the array ends

File functions are here -> http://www.php.net/manual/en/ref.filesystem.php -
the only one I can't see is the ability to delete a line in a file - at
least without creating another holding filevery messy that way
tho...I'll keep looking.

As an exercise to myself I'll try and recreate it using the 2 example files
belowdunno how long it'll take me tho ;o)

Good luck

Nick


-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: 22 January 2003 13:57
To: Didier McGillis
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] HELP please quickly


In that case, I don't know of any PHP classes to help you.
- Original Message - 
From: "Didier McGillis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 22, 2003 7:53 AM
Subject: Re: [PHP] HELP please quickly


No.  The numbers are coming from two text files.  The first text file is the

file that I need to compare against the second file, and if I find one match

in the second file, I need to move it to the third file.






>From: "Rick Emery" <[EMAIL PROTECTED]>
>Reply-To: "Rick Emery" <[EMAIL PROTECTED]>
>To: "Didier McGillis" <[EMAIL PROTECTED]>,<[EMAIL PROTECTED]>
>Subject: Re: [PHP] HELP please quickly
>Date: Wed, 22 Jan 2003 07:45:20 -0600
>
>Are the numbers coming from a mysql database? If so, mysql can handle this 
>chore.
>
>- Original Message -
>From: "Didier McGillis" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Wednesday, January 22, 2003 7:21 AM
>Subject: [PHP] HELP please quickly
>
>
>Here is a brief description of what I want to do.  I want to use PHP to 
>grab
>a list of numbers in one file.  Check it against a bigger file and strip 
>the
>ones that match out of the bigger file, into a "holding" file.
>
>
>so here is what it might look like.
>
>file1.txt
>456789
>456790
>456791
>456792
>456793
>456794
>
>
>file2.log
>some time stamp
>code=001;number=456784;name=blahblah;date=012403;
>some time stamp
>code=001;number=456785;name=blahblah;date=012403;
>some time stamp
>code=001;number=456786;name=blahblah;date=012303;
>some time stamp
>code=001;number=456789;name=blahblah;date=012503;
>some time stamp
>code=001;number=456789;name=blahblah;date=012503;
>some time stamp
>code=001;number=456789;name=blahblah;date=012503;
>some time stamp
>code=001;number=456789;name=blahblah;date=012503;
>some time stamp
>code=001;number=456789;name=blahblah;date=012503;
>some time stamp
>code=001;number=456790;name=blahblah;date=012603;
>some time stamp
>code=001;number=456791;name=blahblah;date=012703;
>
>notice there might be more then one of the same number, I only need one so 
>I
>need to ignore the rest, rip out the time stamp, which is a seperate line.
>
>file3.txt
>code=001;number=456789;name=blahblah;date=012503;
>code=001;number=456790;name=blahblah;date=012603;
>code=001;number=456791;name=blahblah;date=012703;
>
>can anyone help, any suggestions?
>
>
>
>
>
>_
>MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
>http://join.msn.com/?page=features/virus
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*   
http://join.msn.com/?page=features/junkmail




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


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




RE: [PHP] HELP please quickly

2003-01-22 Thread Clarkson, Nick

I managed this bit of code, but I doubt it does exactly what you want, but
it's a start. And just to add to it I couldn't get the preg_match to work -
so that needs sorting. I'm at work, so I'm afraid I can't spend any more
time right now on this. If anyone can help on the preg_match bit (it just
needs to compare/match 2 strings) then could you add to this ? I looked at
the preg_match function on the php site, but I couldn't make head nor tail
of it :o/

Good luck with it

Nick


 $line) {
//if (preg_match ("/$line/", "$buffer")) <- CAN'T GET THIS
TO WORK ;o(
{ fwrite ($results, $buffer); }
}
}
?>


-Original Message-
From: Didier McGillis [mailto:[EMAIL PROTECTED]]
Sent: 22 January 2003 14:33
To: [EMAIL PROTECTED]
Subject: RE: [PHP] HELP please quickly


Cool.  Thanks for the information.  I try and organize my thoughts like that

as well.  I dont really need to delete anything, mostly move and copy.

One problem I have run into is my second file seems to be too big.  In just 
doing a simple count the first file was fine, found my 470 lines.  The 
second file is 7.1MB and seems to fail telling me "Fatal error: Allowed 
memory size of 8388608 bytes exhausted (tried to allocate 81 bytes)"

So it seems to be on hurrdle at a time.




>From: "Clarkson, Nick" <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: RE: [PHP] HELP please quickly
>Date: Wed, 22 Jan 2003 14:15:32 -
>
>
>I'm pretty new to PHP so I can't help you with the code per se, but how
>about as an outline;
>
>Open the first file and read values into an array.
>Open the 2nd file and read in the first line.
>Compare each value in the array to see if it occurs in the line from the 
>2nd
>file you just read in.
>If it occurs then write that value to the 3rd file
>Repeat until the array ends
>
>File functions are here -> http://www.php.net/manual/en/ref.filesystem.php 
>-
>the only one I can't see is the ability to delete a line in a file - at
>least without creating another holding filevery messy that way
>tho...I'll keep looking.
>
>As an exercise to myself I'll try and recreate it using the 2 example files
>belowdunno how long it'll take me tho ;o)
>
>Good luck
>
>Nick
>
>
>-Original Message-
>From: Rick Emery [mailto:[EMAIL PROTECTED]]
>Sent: 22 January 2003 13:57
>To: Didier McGillis
>Cc: [EMAIL PROTECTED]
>Subject: Re: [PHP] HELP please quickly
>
>
>In that case, I don't know of any PHP classes to help you.
>- Original Message -
>From: "Didier McGillis" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Wednesday, January 22, 2003 7:53 AM
>Subject: Re: [PHP] HELP please quickly
>
>
>No.  The numbers are coming from two text files.  The first text file is 
>the
>
>file that I need to compare against the second file, and if I find one 
>match
>
>in the second file, I need to move it to the third file.
>
>
>
>
>
>
> >From: "Rick Emery" <[EMAIL PROTECTED]>
> >Reply-To: "Rick Emery" <[EMAIL PROTECTED]>
> >To: "Didier McGillis" 
><[EMAIL PROTECTED]>,<[EMAIL PROTECTED]>
> >Subject: Re: [PHP] HELP please quickly
> >Date: Wed, 22 Jan 2003 07:45:20 -0600
> >
> >Are the numbers coming from a mysql database? If so, mysql can handle 
>this
> >chore.
> >
> >- Original Message -
> >From: "Didier McGillis" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Wednesday, January 22, 2003 7:21 AM
> >Subject: [PHP] HELP please quickly
> >
> >
> >Here is a brief description of what I want to do.  I want to use PHP to
> >grab
> >a list of numbers in one file.  Check it against a bigger file and strip
> >the
> >ones that match out of the bigger file, into a "holding" file.
> >
> >
> >so here is what it might look like.
> >
> >file1.txt
> >456789
> >456790
> >456791
> >456792
> >456793
> >456794
> >
> >
> >file2.log
> >some time stamp
> >code=001;number=456784;name=blahblah;date=012403;
> >some time stamp
> >code=001;number=456785;name=blahblah;date=012403;
> >some time stamp
> >code=001;number=456786;name=blahblah;date=012303;
> >some time stamp
> >code=001;number=456789;name=blahblah;date=012503;
> >some time stamp
> >code=001;number=456789;name=blahblah;date=012503;
> >some time stamp
> >code=001;number=45678

RE: [PHP] A simple question please.

2003-01-22 Thread Clarkson, Nick


If the start of EVERY page is the same you could make your php include file
as follows;

";
echo "";
echo "";
?>

Obviously padding it out a bit ;o)

Then at the top of every page put;



Similarly you coud do a footer for every page.

You can basically put it where you like as long as the HTML makes sense.

Nick

Another example, from http://www.php.net/manual/en/function.include.php

 
 
  
  
 
 

...etc. 




-Original Message-
From: Denis L. Menezes [mailto:[EMAIL PROTECTED]]
Sent: 22 January 2003 15:21
To: PHP general list
Subject: [PHP] A simple question please.


Hello friends.

I need to add a part of html (the banner, top menus and the logo) in all
pages dynamically. I made this part of the html and converted same to php
code using "Print " command.

Now, how do I add this code in the other pages? Should I inclue "require" or
"include" command? if yes? should I include after the  tag itself?

Thanks
denis


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




RE: [PHP] Re: query caching & caching in general

2003-01-23 Thread Clarkson, Nick

I found this on Zend - SQL Query Caching -
http://www.zend.com/zend/tut/tutorial-staub2.php;

"The basics to caching is using the serialize() and unserialize() PHP
functions..."

I don't know if this will help.

Nick




-Original Message-
From: Peter Janett [mailto:[EMAIL PROTECTED]]
Sent: 23 January 2003 08:41
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: query caching & caching in general


Query caching is something that seems to exist in Cold Fusion, but not PHP.

What I'm referring to is that in Cold Fusion you can specify that query
results be cached in memory, and how long to cache those results.  So, if
you have a page that runs the same query each time it's loaded, and you
cache a query on that page, then the results of that query are in memory, so
the call to the database is not run, instead the results from memory are
used, which can represent a HUGE speed increase.

To be totally repetitive, I'm not talking about a database cacheing results
of a query, but PHP caching the results of the query, instead of querying
the database.

I don't think it's possible to do anything like this in PHP, because of the
multiple database support, different function calls for different databases,
etc.

I've looked around, and found some PHP code that saves results sets in tmp
files, but I'm guessing that having the results cached in memory would be
faster than in files.

I think maybe the file caching was part of a database abstraction layer.

HTH,

Peter Janett

New Media One Web Services

New Upgrades Are Now Live!!!
Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1
Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25,
Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43

PostgreSQL coming soon!

http://www.newmediaone.net
[EMAIL PROTECTED]
(303)828-9882


- Original Message -
From: "Jean-Christian Imbeault" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 23, 2003 1:20 AM
Subject: [PHP] Re: query caching & caching in general


> Justin French wrote:
> >
> > anyone got any links to decent tutorials on sql caching, and caching in
> > general?
>
> A few questions:
>
> At what level do you want the caching?
> Are you talking about stored procedures?
> Do you mean storing functions in the DB? (some DB's, like PostgreSQL can
> compile functions once and reuse the compiled function).
>
> Let me know where you want the caching to be and maybe I have a link or
two.
>
> Jc
>
>
> --
> 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


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




RE: [PHP] Disable pic copy/save?

2003-01-23 Thread Clarkson, Nick

This cannt be done in PHP. You would have to use something like Flash or
Java - which is a lot of effort. The best you can do is disable right click
using javascript, but that's easy to circumvent. Because everything's
displayed client side, then a user could go into their Temporary Internet
Files folder and find it in their anyway. Even using Flash or Java, if
someone was determined to grab the individual images, then screenshots and
an app to rebuild gifs would be easy to do. Unless of course they are full
blown Flash ads, which would be harder to 'rip'. Why would a user want to
save an advert anyway ? I don't believe I've ever saved an advert graphic -
in fact I quite often resort to banner blocking, because some sites in
particular go OTT on their use.

Nick


-Original Message-
From: Anthony Rodriguez [mailto:[EMAIL PROTECTED]]
Sent: 23 January 2003 09:52
To: [EMAIL PROTECTED]
Subject: [PHP] Disable pic copy/save?


Hi!

A client wants to test market two versions of an advertising but wants to 
disable the users' ability to copy/save the ads (right click, copy/save).

How can this be done in PHP?

Thanks!

Anthony F. Rodriguez
([EMAIL PROTECTED])




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


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




[PHP] Sessions & Security

2003-01-23 Thread Clarkson, Nick

Hi,

I am trying to find the best method for implementing sessions in PHP to
track/limit users. However, the more I read, the more I am concerned about
security. Can anyone give me a definitive answer as to the best method of
tracking users with security in mind ?

Thanks,

Nick


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




RE: [PHP] Sessions & Security

2003-01-23 Thread Clarkson, Nick

Thanks - I've only just joined the list so must have missed your previous
msgs. I'll give them a read later.

Thanks again.

Nick

-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED]]
Sent: 23 January 2003 15:28
To: Clarkson, Nick; [EMAIL PROTECTED]
Subject: Re: [PHP] Sessions & Security


--- "Clarkson, Nick" <[EMAIL PROTECTED]> wrote:
> I am trying to find the best method for implementing
> sessions in PHP to track/limit users. However, the
> more I read, the more I am concerned about security.
> Can anyone give me a definitive answer as to the best
> method of tracking users with security in mind?

I have spoken on this topic several times in the past. Here
are a few recent ones:

http://groups.google.com/groups?selm=20030115215804.74315.qmail%40web14307.m
ail.yahoo.com
http://groups.google.com/groups?selm=20030102155526.52596.qmail%40web14302.m
ail.yahoo.com
http://groups.google.com/groups?selm=3DC35A8C.6030208%40php.net
http://groups.google.com/groups?selm=3DBC8190.9080007%40shiflett.org
http://groups.google.com/groups?selm=3D7BBDD2.7090803%40php.net

Hopefully that will give you a good start.

Chris

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


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




[PHP] PHP error page not redirecting

2003-02-10 Thread Nick Holden
I'm having a dispute with an ISP (surprise) about the non-functioning of
a PHP error script.

Currently, the error script is at
http://www.touristguides.org.uk/error.php - a direct click on that link
will redirect you, using:
header("Location: http://www.touristguides.org.uk/index.php";);
And sure enough, you end up at /index.php

However, when I ask for /nosuchpage I get a blank window, and the
following source is output:

And that's all.

I've stripped down all the complicated stuff from the error page, and I
can't understand why it will redirect fine if it's called directly, but
not if it is functioning as an error page (the .htaccess has the
necessary ErrorDocument directives in it).

The ISP say "I believe the problem may lie in the fact a 404 status has
already been sent so it nullifies the 302 redirect status. I suggest
searching php.net for more details" - which, naturally, I have done,
without enlightenment.

But the script works nicely on another server, suggesting that it might
be something to do with the Apache configuration. I'm rapidly getting
out of my depth now, and would appreciate some guidance on where to turn
next. Thanks,

Nick


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




Re: [PHP] PHP error page not redirecting

2003-02-10 Thread Nick Holden
On Mon, 2003-02-10 at 11:22, Chris Hewitt wrote:
> Nick Holden wrote:
> 
> >I'm having a dispute with an ISP (surprise) about the non-functioning of
> >a PHP error script.
> >
> >Currently, the error script is at
> >http://www.touristguides.org.uk/error.php - a direct click on that link
> >will redirect you, using:
> >header("Location: http://www.touristguides.org.uk/index.php";);
> >And sure enough, you end up at /index.php
> >
> >However, when I ask for /nosuchpage I get a blank window, and the
> >following source is output:
> >
> >And that's all.
> >
> >I've stripped down all the complicated stuff from the error page, and I
> >can't understand why it will redirect fine if it's called directly, but
> >not if it is functioning as an error page (the .htaccess has the
> >necessary ErrorDocument directives in it).
> >
> >The ISP say "I believe the problem may lie in the fact a 404 status has
> >already been sent so it nullifies the 302 redirect status. I suggest
> >searching php.net for more details" - which, naturally, I have done,
> >without enlightenment.
> >
> >But the script works nicely on another server, suggesting that it might
> >be something to do with the Apache configuration. I'm rapidly getting
> >out of my depth now, and would appreciate some guidance on where to turn
> >next. Thanks,
> >
> >Nick
> >
> 
> I'm not an expert at this either, but you could test whether the 
> nosuchpage 404 is getting to your error.php by replacing the redirection 
> with some ordinary html that will display a message to you.
> 
> At least that way you will know whether its the location header that is 
> the problem or not.
> 

Hi Chris,

Thanks for putting some thought to this. I did try what you suggested,
and sure enough, the non-existent pages now direct to the plain html of
the error.php page. So I guess the problem is related to the header()
call, and not a problem getting to the error.php in the first place.

Still stuck, of course...

Nick


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




[PHP] Help with authentication 'design'

2003-02-18 Thread Clarkson, Nick

Hi,

I've searched the archives, bit it's not helping me much purely because it's
not specific PHP code I'm after, but rather help with a login system design.
So far I've got a PHP_AUTH based login which checks against a MySQL
database, and if the user's details are correct it updates the database with
their IP and login time, then creates sessions variables for their username
and security level (for admins, mods etc). However, the more I read, the
more I worry about security, so I want to try and get this as good as I can
possibly get it with security my main concern. What I hope to achieve is
some reusable code. All the tutorials and sample code I look at say don't
use this in a production environment because it's not secure. When I'm happy
with what I've got I'll make the code available, hopefully this will be a
joint effort and any credit will be given.
So far the steps I have are;

Set $auth to false
Are PHP_AUTH_USER and PHP_AUTH_PW set ?
Yes -> Connect to database
   check user/pw exists in database
   if they do then set $auth to true

Is $auth false ?
Yes -> Display login box with header(); 

No  -> update database with ip and time
   create sessions variables
   forward to next page

I'm after two things; ideas for a better (more comprehensive) design and
potential security holes. Are sessions a bad idea ? Should I store them in
my database ? Is the initial HTTP authentication a bad idea (because of
either security or browser compatability) and can I make the HTTP
authentication more secure ? Should I stick with a regular login form ? Is
checking for a username session variable on each following page enough ?

Hopefully this is relevant here. 

Thanks,

Nick







This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




RE: [PHP] Help with authentication 'design'

2003-02-18 Thread Clarkson, Nick

Oops, just remembered something else; are PHP_AUTH_USER and PHP_AUTH_PW
handled at the client side or sent in clear text back to the server for
processing ? Basically what I'm doing is once they are set is doing a select
from a database like so;

$result=mysql_query("SELECT * FROM users WHERE
username='".$_SERVER['PHP_AUTH_USER']."' AND
password='".md5($_SERVER['PHP_AUTH_PW'])."'", $dbconn) or die ('Unable to
execute query.');

Would this pass both variables in clear text back to the server ? If so
would it be better to do this;

$result=mysql_query("SELECT * FROM users WHERE
md5(username=)'".md5($_SERVER['PHP_AUTH_USER'])."' AND
password='".md5($_SERVER['PHP_AUTH_PW'])."'", $dbconn) or die ('Unable to
execute query.');

Would this then pass both variables after being hashed with md5 ? Am I
barking up the wrong tree ? Or just plain barking ;oD

Thanks,

Nick

> -Original Message-
> From: Clarkson, Nick 
> Sent: 18 February 2003 14:36
> To:   '[EMAIL PROTECTED]'
> Subject:  [PHP] Help with authentication 'design'
> 
> 
> Hi,
> 
> I've searched the archives, bit it's not helping me much purely because
> it's not specific PHP code I'm after, but rather help with a login system
> design. So far I've got a PHP_AUTH based login which checks against a
> MySQL database, and if the user's details are correct it updates the
> database with their IP and login time, then creates sessions variables for
> their username and security level (for admins, mods etc). However, the
> more I read, the more I worry about security, so I want to try and get
> this as good as I can possibly get it with security my main concern. What
> I hope to achieve is some reusable code. All the tutorials and sample code
> I look at say don't use this in a production environment because it's not
> secure. When I'm happy with what I've got I'll make the code available,
> hopefully this will be a joint effort and any credit will be given.
> So far the steps I have are;
> 
> Set $auth to false
> Are PHP_AUTH_USER and PHP_AUTH_PW set ?
>   Yes -> Connect to database
>  check user/pw exists in database
>  if they do then set $auth to true
>   
> Is $auth false ?
>   Yes -> Display login box with header(); 
> 
>   No  -> update database with ip and time
>  create sessions variables
>  forward to next page
> 
> I'm after two things; ideas for a better (more comprehensive) design and
> potential security holes. Are sessions a bad idea ? Should I store them in
> my database ? Is the initial HTTP authentication a bad idea (because of
> either security or browser compatability) and can I make the HTTP
> authentication more secure ? Should I stick with a regular login form ? Is
> checking for a username session variable on each following page enough ?
> 
> Hopefully this is relevant here. 
> 
> Thanks,
> 
> Nick
> 
> 
> 
> 
> 


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




RE: [PHP] Help with authentication 'design'

2003-02-18 Thread Clarkson, Nick

Hi,

Could you be more specific ? I thought md5 was a one-way hash, so you
couldn't get back to the original string, so was secure. Do you mean
anti-replay as in IPSEC anti-replay ? If so how do I build the equivalent in
PHP ? I know very little about hashing, encryption etc. so any info would be
appreciated.

Thanks,

Nick

-Original Message-
From: Peter Hicks [mailto:[EMAIL PROTECTED]]
Sent: 18 February 2003 14:43
To: Clarkson, Nick
Cc: '[EMAIL PROTECTED]'
Subject: RE: [PHP] Help with authentication 'design'


Nick,

md5 is a hashing function, not an encryption function.  You need anti-replay
if you want the password transfer to be secure


On Tue, 18 Feb 2003, Clarkson, Nick wrote:

> Would this pass both variables in clear text back to the server ? If so
> would it be better to do this;
>
> [cut]
>
> Would this then pass both variables after being hashed with md5 ? Am I
> barking up the wrong tree ? Or just plain barking ;oD


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




[PHP] Automatic .htaccess Authentication?

2003-02-27 Thread Nick Oostveen
I'm looking for a way to have php automatically log a user into an htaccess 
protected directory.

My problem is as follows.  I currently have a large number of php scripts 
which use a database authentication system.  Unfortunately, there are also 
a number of old CGI scripts which need to be protected by an .htaccess file.

What I'm looking for is a way to allow php to perform the .htaccess 
authentication in the background when the user first logs into the DB based 
authentication so that when they go to access the cgi scripts they are not 
prompted for another login.

Any Ideas?

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


[PHP] PHP/HTML Question

2003-07-17 Thread Nick Couchman
I have a quick question about PHP and HTML.  I have a page that is 
supposed to update the "status" of hosts by pinging each host and 
displaying the result.  I would like to get the page to the point that I 
can have something (either PHP or JavaScript or the like) ping every 10 
seconds or so and update the page (I have text boxes for the status) 
WITHOUT reloading it.  Does anyone know if this is possible with PHP? 
Or does anyone know of another way I could do it?  JavaScript (at least 
any of it that I've seen) doesn't have a function to run a command on 
the server (which makes sense, since it is mainly client-side), and I 
don't know about CGI.

Thanks,
Nick
--
You can't make a difference until you are willing to be different!
--
Nick Couchman
SEAKR Engineering, Inc.
6221 South Racine Circle
Centennial, CO 80111
Direct: (303) 784-7724
Main: (303) 790-8499
Fax: (303) 790-8720


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


Re: [PHP] PHP/HTML Question

2003-07-17 Thread Nick Couchman
Ray Hunter wrote:

I have a quick question about PHP and HTML.  I have a page that is 
supposed to update the "status" of hosts by pinging each host and 
displaying the result.  I would like to get the page to the point that I 
can have something (either PHP or JavaScript or the like) ping every 10 
seconds or so and update the page (I have text boxes for the status) 
WITHOUT reloading it.  Does anyone know if this is possible with PHP? 
Or does anyone know of another way I could do it?  JavaScript (at least 
any of it that I've seen) doesn't have a function to run a command on 
the server (which makes sense, since it is mainly client-side), and I 
don't know about CGI.
   

You will need to do a reload of the page so that you can get information
from the server to the client via the web. Now you can also write a
server-client application that allows the server and client to talk via
connects (sockets) however, this is a very complex subject and might be
a huge overkill for what u are trying to accomplish.
Using javascript to reload the page every 10 minutes might be what you
are looking for.
--
BigDog
 

Thanks, that's all I needed to know.  It sounds like from what Jay 
Blanchard said you need a reload with sockets, anyway, and yes, that 
would probably be overkill.

Thanks,
Nick
--
You can't make a difference until you are willing to be different!
--
Nick Couchman
SEAKR Engineering, Inc.
6221 South Racine Circle
Centennial, CO 80111
Direct: (303) 784-7724
Main: (303) 790-8499
Fax: (303) 790-8720


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


Re: [PHP] open source content management systems?

2003-07-29 Thread Nick Talbott
On Tuesday 29 Jul 2003 1:39 am, you wrote:
> hi all
>
> does anyone have any recommendations for good open source content
> management systems for

Having been through exactly this exercise recently, here is our shortlist:

PHP-based

 eZ-publish - http://ez.no
 Typo3 - http://typo3.com
 Aegir - http://www.aegir-cms.org (based on Midgard)

Non-PHP-based

 Bricolage - http://bricolage.cc
 Cofax - http://www.cofax.org
 OpenCMS - http://www.opencms.org

Our choice?  Typo3.  (But if we had better developed Java skills inhouse I 
may well have gone for OpenCMS)  Happy to discuss this off-list if you wish.

Regards

- Nick

-- 
Nick Talbott, Powys County Council (UK)
IT Policy and Strategy Manager/Rheolwr Polisi a Chynllunio TGCh


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



Re: [PHP] Best PHP CMS

2003-08-05 Thread Nick Talbott
On Tuesday 05 Aug 2003 2:51 pm, you wrote:
> I'm just looking for some opinions.  I've been going though sourceforge
> looking at different CMS systems.  There are a lot of really good CMS

Have a look at Typo3  - http://typo3.com

Will do all you want, but it's a big package and may be too sophisticated 
(and hence maybe not worth the learning curve) for your requirements.  If you 
either need a large setup with many content authors, or are likely to use it 
for a number of sites it's well worth the effort.

Ask me off-list if you have any specific questions.

- Nick


-- 
Nick Talbott, Powys County Council (UK)
IT Policy and Strategy Manager/Rheolwr Polisi a Chynllunio TGCh

email:  [EMAIL PROTECTED]
fax:01597 824781
web:www.powys.gov.uk and www.powysweb.co.uk


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



[PHP] nl2br() Function for Paragraphs?

2003-06-11 Thread Nick Wilson
Hello everyone, 

Has anyone written a function that does what nl2br() does but wraps text
in a 's instead? I'm a bit of a clean html type and nl2br() just
leaves me wishing there was a better way...

I'm afraid my regex is dreadfull so I just hoped someone might have
already done it and be willing to share. ;-)

Many thanks...

-- 
Nick WIlson



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



Re: [PHP] nl2br() Function for Paragraphs?

2003-06-11 Thread Nick Wilson

* and then John S. Huggins declared
> >-Has anyone written a function that does what nl2br() does but wraps text
> >-in a 's instead? I'm a bit of a clean html type and nl2br() just
> >-leaves me wishing there was a better way...
> 
> Several examples appear in the user comments section of:
> 
> http://us2.php.net/manual/en/function.nl2br.php

Bad, bad Wilson!
I never really think to look there, thanks very much I'll check it out
right now!

-- 
Nick WIlson



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



Re: [PHP] Parse error - new set of eyes?

2002-07-25 Thread Nick Oostveen

Ok, I noticed a couple things.

One: There's no } ending your elseif statement.

Two (and the big one): Why all the opening brackets before your isset() 
functions? I'm not sure if you're trying to do some nested logic in there, 
but if so it will be much more readable if you use nested if statements 
instead of a single huge statement.  If you quickly count you'll see that 
you've got 8 opening brackets and only 5 closing ones.  That's where your 
problem lies.

At 02:40 PM 7/25/2002 -0600, you wrote:
>I am getting a parse error on line 14, I am trying to make sure session vars
>are being set before rendering the page.  This is lines 12,13,14 & 15.  Any
>help is appreciated.
>Jas
>
>if ((!$u_name) || (!$p_word)){
>  header("Location: index.php");
>  session_destroy();
>  exit; }
>/* Check for missing session vars */
>elseif ((!isset($HTTP_SESSION_VARS['clk']) ||
>(!isset($HTTP_SESSION_VARS['holy_cow']) ||
>(!isset($HTTP_SESSION_VARS['ipaddy']) || (!isset($HTTP_SESSION_VARS['a'])) {
>  /* Begin logging of client info to database table since session vars are
>not present */
>  require '/path/to/connection/class/db.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] calling user-defined php functions from tag

2002-07-26 Thread Nick Oostveen

Check out http://www.faqts.com/knowledge_base/view.phtml/aid/277/fid/40

Essentially you'll want to use this this combined with get variables hard 
coded into your url.  For example:

function 1
function 2

At 11:13 PM 7/26/2002 -0400, Bob Lockie wrote:
>--Original Message Text---
>From: Michael
>Date: Fri, 26 Jul 2002 21:09:13 -0500 (EST)
>
>
>Hi, everyone.
>
>There MUST be some creative way to call a user-defined PHP function from
>an  tag. Does anyone have any suggestions?
>
>For example:
>
>==
>"> Click here to start "function joe()".
>==
>
>So, if the user clicks on the link, he'll see:  "The result of this
>function is: 20"
>
>Any ideas? Any help would be VERY much appreciated. Thanks!
>
>-- Michael
>
>
>It is not possible to do it in one step.
>The web server parses ALL the PHP code, generates HTML, sends it to the 
>browser.


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




Re: [PHP] Oracle 8i SQL Problem..

2002-07-28 Thread Nick Oostveen

I could be wrong on this but I believe that Oracle 8i uses a proprietary 
join syntax.  This support has been added in the latest version of Oracle, 
but with 8i I believe you're out of luck using the left join keywords.

Check out 
http://certcities.com/certs/oracle/columns/story.asp?EditorialsID=106 for 
more info on this.

At 10:26 AM 7/28/2002 -0500, Frank S. Kicenko wrote:
>Hi,
>This really isn't a PHP issue..sorry.
>
>I'm having a nightmare with Oracle 8i (pos!). I'm writing common SQL
>which works for MSSQL 2K and seems correct for Oracle... but keeps
>giving me a Error.. ORA-00933 SQL command not properly ended on the
>following query...
>
>SELECT grp.grpdescrip, grp.grp, grp.createcust, grp.auth1, grp.auth2,
>usergrp.userid, users.userdescrip
> FROM grp
> LEFT JOIN usergrp
> ON grp.grp=usergrp.grp
> LEFT JOIN users
> ON usergrp.userid=users.userid
> ORDER BY grp.grp
>
>The error keeps pointing at the first "LEFT JOIN". Anybody know why?
>
>--
>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] extracting variables from files

2002-07-31 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi everyone, 

I break out in a cold sweat just thinking about regex, so I thought I'd
ask you if there was an easier way to do this:

I want to look through all of the files in a directory and extract a
certain variable from each.

This is to create a dynamic menu of the directory: The files are php
scripts that assign $title (among others) to Smarty templates.

I need to get $title from each file

I had a look through the docs and didn't see anything obvious, which is
why I'm here :-)

Many thanks...
- -- 
Nick Wilson // www.tioka.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE9SEtnHpvrrTa6L5oRAuVyAJ4j4jfC4nKKni3S6V5xsmZH2xhPDQCdF7wA
Y0vShZPQ1n5qZE48LIhCVyA=
=DLPZ
-END PGP SIGNATURE-

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




Re: [PHP] I need some help: PHP portal site/creating email accounts through form submission

2002-07-31 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Kevin Myrick declared
> I also want to do a signup form for his site so when
> people join the "community" forum, they will
> automatically be given an email username and password
> for his site. 
> 
> Any help would be very greatful.

I think you'll need to start from the beggining and post specific
problems. That's a bit vague to get a decent answer Also, we don't
even know how the system works: Does he have the ability to create
unlimited emails? The permissions to do that? etc etc

- -- 
Nick Wilson // www.tioka.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE9SExIHpvrrTa6L5oRAvbUAJ9RrBB3Y8l2/YaRRp1sM//Ytw6PgACdEWHs
e4HrmAsobSyYYiWXDacMq78=
=Fjao
-END PGP SIGNATURE-

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




Re: [PHP] I need some help: PHP portal site/creating email accounts through form submission

2002-07-31 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Kevin Myrick declared
> So my specific problem is this: How do I create a new
> user account on a *NIX system to have permissions to
> send and receive email, for a web based email system.

I think you'd need to take a look at the exec() function but there are
better qualified people here to answer that kind of question... anyone?

> BTW, I don't declare. I demand. ;)

hehe, right!
- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE9SFlPHpvrrTa6L5oRApFxAKCIq0inSFizDKLdxiZzx+3CImb++QCfafuC
fZ7mSekTqM90J2Qfj0Oh0TA=
=3rrA
-END PGP SIGNATURE-

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




Re: [PHP] Why Protect PHP coding?

2002-08-02 Thread Nick Oostveen

Check out the Zend Encoder at http://www.zend.com to generate encoded php 
files.  It is, however, a bit pricey.

At 12:47 AM 8/2/2002 -0400, php @ banana wrote:
>Just out of curiosity when and why?
>
> >Is there any method to encrypt PHP files.
> >
> >Nyon
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
>--__-__-__
>eat pasta
>type fasta
>
>
>--
>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] re:Using PHP to reboot the linux server

2002-08-02 Thread Nick Oostveen

Does the user apache is running as have access to reboot the server?

At 07:18 PM 8/2/2002 +, you wrote:
>I am using the below command in the php page to reboot the linux server. 
>But nothing happens . Where am i wrong or do i have to give a path or 
>nething . Please help.
>
>
>$output = shell_exec(`reboot`);
>echo $output;
>
>
>
>_
>Join the world's largest e-mail service with MSN Hotmail. 
>http://www.hotmail.com
>
>
>--
>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] Install

2002-08-03 Thread Nick Niehoff

I have followed the instructions to install php4 on
both apache 1.3.x and 2.0.x, both fail.  I am running
RedHat 7.2, Apache 2.0.39.  I am trying to install
php4.2.2.  When I type 'make install' at the command
it goes through its little thing and then says:
./.libs/libphp4.a(zend_execute.lo): In function
`safe_free_zval_ptr':
/root/php-4.2.2/Zend/zend_execute.h:59: undefined
reference to `ts_resource_ex'
collect2: ld returned 1 exit status
make[1]: *** [php] Error 1
make[1]: Leaving directory `/root/php-4.2.2'
make: *** [install-recursive] Error 1

Can anyone help?
Nick Niehoff

__
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

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




[PHP] starting Apache

2002-08-03 Thread Nick Niehoff

I finally got php 4.2.2 installed with Apache 2.0.39
on RedHat 7.2.  However when I restart the httpd
service, I get the following error:

Starting httpd: Syntax error on line 230 of
/www/conf/httpd.conf:
Cannot load /www/modules/libphp4.so into server:
/www/modules/libphp4.so: undefined symbol:
ts_resource_ex

Can Anyone Help?
Nick

__
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

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




Re: [PHP] PHP warning with 4.2

2002-08-08 Thread Nick Oostveen

You should be able to fix this by changing the function DECLARATION for the 
argument in question to take the variable by reference instead of by value 
(which is the default).

So it should be something like:

OCIFetchInto ( $var1, &$rvar2, $var3  )

What you are currently doing is specifying at call-time that "I want you to 
accept this variable by reference, even if you are expecting it to be 
passed by value".  This can be very dangerous from a data corruption point 
of view, which is likely why it is being deprecated.

At 11:13 AM 8/8/2002 -0700, PHP List wrote:
>Hi, after upgrading to 4.2, I seem to be getting this warning:
>
>PHP Warning:  Call-time pass-by-reference has been deprecated - argument 
>passed by value;  If you would like to pass it by reference, modify the 
>declaration of [runtime function name]().  If you would like to enable 
>call-time pass-by-reference, you can set allow_call_time_pass_reference to 
>true in your INI file.  However, future versions may not support this any 
>longer.
>
>on this line:
>OCIFetchInto ( $GLOBALS["oracle_statement"], &$row, OCI_NUM + 
>OCI_RETURN_NULLS  )
>
>if I can't use &$row anymore, what do I do? The warning says that "future 
>versions may not support this", so will this function be fixed? Or will 
>this function be dissappearing?
>
>Thanks for any help.


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




Re: [PHP] Persistant Connections

2002-08-14 Thread Nick Oostveen

Persistent connections are typically a good thing to use on high traffic 
sites as they offer better performance than opening and closing connections 
for each database request. The reason for this is the overhead used in 
opening a database connection is actually quite high.

While keeping them open when they are no longer needed may seem 
counter-intuitive, the connection isn't being saved for a particular user 
or page, instead it remains open and will automatically be used by any page 
requiring database connectivity on your site.  If there are no free 
connections when a page request comes in, a new one is open.  Conversely if 
a connection has not been utilized for a specific period of time (usually a 
couple minutes) it will be closed.

At 02:46 PM 8/14/2002 +0100, John Wards wrote:
>I am running a website which generates around 100,000 pageviews a day and I
>am wondering if I stop using persistent conections to the database and use
>normal open and close conections this would reduce the load onto my server?
>
>Most conections are either made through my "main" file or the phorum message
>board system.
>
>Thanks in advance
>John Wards
>
>
>
>--
>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] PHP - class question

2002-08-14 Thread Nick Oostveen

If you are just trying to access a classes functions without creating an 
instance of it you're probably looking to use the scope resolution operator 
::.  For this to work all you have to do is ensure that the definition for 
the class you wish to use is included into the file containing the class 
you are trying to call the functions from.

You would then call the functions as follows:

ClassName::FunctionName();

At 02:43 PM 8/14/2002 -0400, you wrote:
>Hello,  To begin.. i'm new to the list...
>
>I'm trying to learn good practices in OOP based PHP.  I'm actually a bit new
>to OOP in general, but I've done quite a bit of reading and playing around
>with it in the past couple of months.
>
>What I'm trying to figure out is the proper way to call a class from a
>class.  I dont mean by extending the class, but actaully just getting the
>functions...
>
>For instance...
>
>I'm trying to connect to a Database (database class) from my gen_XML class.
>Do I include the database class in the gen_XML constructor?  Do I set a
>gen_XML variable as a database object (i.e. $this->mydb)?
>
>I hope my question makes some sense...
>
>Your help is appreciated...
>
>Mark Armendariz
>
>
>
>--
>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] stripslahes() | Common pitfalls?

2002-09-17 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi all, 

I'm using cookies to pre fill a form and, I can't work out why I can't
get the stripslashes() function to work?

Are there any common pitfalls you can think of, I've tried just about
everything...
- -- 
Nick Wilson //  www.tioka.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE9h0AHHpvrrTa6L5oRAul4AKCqT9chEyTRVhuW3hK5vAlP/kaF/wCgrRxg
vBIkxWV9akJqQUDiKEmyzdI=
=Tir9
-END PGP SIGNATURE-

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




Re: [PHP] stripslahes() | Common pitfalls?

2002-09-17 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then John Holmes declared
> Show some code. What's the actual value of the cookie before you
> stripslashes() it?

Well, that got me on the right track ;-)
Now I do this: setcookie('val', stripslashes($_POST['val']); and all is
cool!

Thanks very mucn...
- -- 
Nick Wilson //  www.tioka.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD4DBQE9h0y8HpvrrTa6L5oRAhd6AJY4UEp63qtfp25j/ZghCNT7ffCPAKCmdyML
iGLvRSAh7RSiHSuL60rdTw==
=YIVc
-END PGP SIGNATURE-

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




Re: [PHP] new PHP chat room (with Flash interface)

2002-09-17 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Darren Gates declared
> here's a chat room that I made in PHP/MySQL with a Flash 5 front-end. All
> the other PHP chat rooms that I've found have an annoying "click" every few
> seconds when the webpage is refreshed.
> 
> http://www.tufat.com/chat/

Well I just get some dodgy html code showing up on your demo pages...

- -- 
Nick Wilson //  www.tioka.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE9h2VcHpvrrTa6L5oRAlF4AJ0bh2uoBHIXFgYJgnD5BVwjdRrnlwCglXxQ
qtS4MmCBNkcCUc+ESs8/13E=
=wZOc
-END PGP SIGNATURE-

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




[PHP] Calling class functions using string variables?

2002-09-22 Thread Nick Richardson

Hi,

Anyone know if it's possible to call a class function using 2 string
variables WITHOUT instantiating the class?

i.e.:

$clName = "myClass";
$fuName = "myFunc";

$clName::$fuName();

I have tried several different combinations of eval and {} and just
about everything else I can think of… and they all give parse errors
when the class name is a string var. (i.e. myClass::$fuName() works fine
(as expected) but $clName::myFunc() does not).  Everytime it doesn't
work, it just gives a simple parse error.

Any suggested are much appreciated!

Thanks in advance!

//Nick Richardson
// [EMAIL PROTECTED]


---
Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.386 / Virus Database: 218 - Release Date: 9/9/2002
 



RE: [PHP] Calling class functions using string variables?

2002-09-22 Thread Nick Richardson

Nevermind, I have finally figured it out... I was missing a ; in the
eval statement.

For anyone who wanted to know, there's 2 ways...
1) the long way
$clName = "myClass";
$fuName = "myFunc";

$t = new $clName;
$t->$fuName();
unset($t);

2) the short way
$cl = "myClass";
$fu = "myFunc";

eval("$cl::$fu();");

-Original Message-
From: Nick Richardson [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 22, 2002 12:50 PM
To: 'PHP General'
Subject: [PHP] Calling class functions using string variables?


Hi,

Anyone know if it's possible to call a class function using 2 string
variables WITHOUT instantiating the class?

i.e.:

$clName = "myClass";
$fuName = "myFunc";

$clName::$fuName();

I have tried several different combinations of eval and {} and just
about everything else I can think of… and they all give parse errors
when the class name is a string var. (i.e. myClass::$fuName() works fine
(as expected) but $clName::myFunc() does not).  Everytime it doesn't
work, it just gives a simple parse error.

Any suggested are much appreciated!

Thanks in advance!

//Nick Richardson
// [EMAIL PROTECTED]


---
Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.386 / Virus Database: 218 - Release Date: 9/9/2002
 

---
Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.386 / Virus Database: 218 - Release Date: 9/9/2002
 


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




[PHP] mysql_num_rows error

2002-09-22 Thread Nick Varner

I am new to php and that the folowing error: Warning: mysql_num_rows():
supplied argument is not a valid MySQL result resource in
/home/tbonestu/public_html/smallimages.php

i dont know what i am doing wrong here is the code:

 @ $db = mysql_pconnect(connect info);

 mysql_select_db("images");
 $query = "select * from images where type =".$type."";
 $result = mysql_query($query);
 $num_results = mysql_num_rows($result);





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




[PHP] Inheritance and a class function: on what class was it called?

2002-10-02 Thread Nick Eby

Assume you've got some class that has one or more classes inherited from it.
The parent class has a function that is normally called using the ::
operator (a class function).  Assume also that the class function is never
called from an object function.  Is it possible to find if the class
function was called on the parent class, or on the child class?

example:
Class A has a function foo(), callable by A::foo(). Class B extends A. If
outside code makes the call B::foo(), can you tell from within foo() that
the function was called on B and not A?

I think this is impossible but I want to confirm that suspicion.  It's
important that the call B::foo() isn't made from inside any object function,
so that there's no context for the $this variable; the get_class() function
isn't applicable.



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




Re: [PHP] Inheritance and a class function: on what class was it called?

2002-10-02 Thread Nick Eby

not quite... the case I'm interested in is this, given your example:

print C::foo();

which would print nothing, unfortunately, since when the function is called
using the :: operator there is no $this variable.  basically what I'm
looking for is a replacement for get_class($this) when the function is
called using ::

thanks

/nick

"Debbie Dyer" <[EMAIL PROTECTED]> wrote in message
054c01c26a3f$34f6d230$de093c3e@homepc">news:054c01c26a3f$34f6d230$de093c3e@homepc...
> I think I know what you mean. You could get it to return the name of the
> class.
>
> eg.
>
> class A {
> function foo () {
>   return get_class($this);
> }
> }
> class B extends A {
> }
> class C extends A {
> }
>
>   $a = new A();
>   $b = new B();
>   $c = new C();
>   print $a->foo();
>   print $b->foo();
>   print $c->foo();
>
> Is this what you mean?
>
> Debbie
>
> - Original Message -
> From: "Nick Eby" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, October 02, 2002 6:29 PM
> Subject: [PHP] Inheritance and a class function: on what class was it
> called?
>
>
> > Assume you've got some class that has one or more classes inherited from
> it.
> > The parent class has a function that is normally called using the ::
> > operator (a class function).  Assume also that the class function is
never
> > called from an object function.  Is it possible to find if the class
> > function was called on the parent class, or on the child class?
> >
> > example:
> > Class A has a function foo(), callable by A::foo(). Class B extends A.
If
> > outside code makes the call B::foo(), can you tell from within foo()
that
> > the function was called on B and not A?
> >
> > I think this is impossible but I want to confirm that suspicion.  It's
> > important that the call B::foo() isn't made from inside any object
> function,
> > so that there's no context for the $this variable; the get_class()
> function
> > isn't applicable.
> >
> >
> >
> > --
> > 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] Inheritance and a class function: on what class was it called?

2002-10-02 Thread Nick Eby

when you call a function with ->, you must call it on an object ($c->foo(),
for example).  the function is termed an "object function" when used that
way.  php has an operator :: that enables that same function to be called
without a specific object; in this case, I'm referring to it as a "class"
function.  another term for this is usually "static" function.  any function
of a class can be called in both ways.  the only catch is that, when called
as a class function, the function can't in turn call any functions on $this
or a fatal error will result.

sorry this is so confusing, I probably should've used the term "static" from
the beginning.

/nick

- Original Message -
From: "Debbie Dyer" <[EMAIL PROTECTED]>
To: "Nick Eby" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, October 02, 2002 11:33 AM
Subject: Re: [PHP] Inheritance and a class function: on what class was it
called?


> I dont understand what you are saying then or what you are trying to do.
>
> How can you call C::foo() outside of a class? You access class functions
> externally with ->
>
> Debbie
>
> - Original Message -
> From: "Nick Eby" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, October 02, 2002 7:24 PM
> Subject: Re: [PHP] Inheritance and a class function: on what class was it
> called?
>
>
> > not quite... the case I'm interested in is this, given your example:
> >
> > print C::foo();
> >
> > which would print nothing, unfortunately, since when the function is
> called
> > using the :: operator there is no $this variable.  basically what I'm
> > looking for is a replacement for get_class($this) when the function is
> > called using ::
> >
> > thanks
> >
> > /nick
> >
> > "Debbie Dyer" <[EMAIL PROTECTED]> wrote in message
> > 054c01c26a3f$34f6d230$de093c3e@homepc">news:054c01c26a3f$34f6d230$de093c3e@homepc...
> > > I think I know what you mean. You could get it to return the name of
the
> > > class.
> > >
> > > eg.
> > >
> > > class A {
> > > function foo () {
> > >   return get_class($this);
> > > }
> > > }
> > > class B extends A {
> > > }
> > > class C extends A {
> > > }
> > >
> > >   $a = new A();
> > >   $b = new B();
> > >   $c = new C();
> > >   print $a->foo();
> > >   print $b->foo();
> > >   print $c->foo();
> > >
> > > Is this what you mean?
> > >
> > > Debbie
> > >
> > > - Original Message -
> > > From: "Nick Eby" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Wednesday, October 02, 2002 6:29 PM
> > > Subject: [PHP] Inheritance and a class function: on what class was it
> > > called?
> > >
> > >
> > > > Assume you've got some class that has one or more classes inherited
> from
> > > it.
> > > > The parent class has a function that is normally called using the ::
> > > > operator (a class function).  Assume also that the class function is
> > never
> > > > called from an object function.  Is it possible to find if the class
> > > > function was called on the parent class, or on the child class?
> > > >
> > > > example:
> > > > Class A has a function foo(), callable by A::foo(). Class B extends
A.
> > If
> > > > outside code makes the call B::foo(), can you tell from within foo()
> > that
> > > > the function was called on B and not A?
> > > >
> > > > I think this is impossible but I want to confirm that suspicion.
It's
> > > > important that the call B::foo() isn't made from inside any object
> > > function,
> > > > so that there's no context for the $this variable; the get_class()
> > > function
> > > > isn't applicable.
> > > >
> > > >
> > > >
> > > > --
> > > > 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] Inheritance and a class function: on what class was it called?

2002-10-02 Thread Nick Eby

PHP allows static method calls...  But back to my original question...
inside a method that has been called statically, can I determine for what
class the method was called?  Again, obviously the question is only
applicable if there is some inheritance involved, and the child class does
not declare the method in question.  Below is my original example spelled
out in code... the call to get_class is not valid since there won't be a
$this variable in the context of the static method...  Can I replace it with
something that will cause it to echo "B"?

Class A {
function staticFunc() { echo get_class($this); }
}

Class B extends A {}

B::staticFunc();

thanks again
/nick

- Original Message -
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: "Debbie Dyer" <[EMAIL PROTECTED]>
Cc: "Nick Eby" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, October 02, 2002 3:08 PM
Subject: Re: [PHP] Inheritance and a class function: on what class was it
called?


> > The mistake is mine not yours. I know about the :: operator I use it all
the
> > time (but within classes parent::function() etc) - but I never realised
> > until now that PHP will let you use any class before instantiation (and
> > nearly all my PHP work uses classes). I have never even attempted to try
it
> > because in all other languages I know trying to use an ordinary class
before
> > instantiation will just result in a null pointer error or the equivalent
of
> > one.
> >
> > PHP OOP is different I know, one big example is that there is no
provision
> > for data encapsulation - one of the main objectives of OOP, neither can
you
> > differentiate between types of classes/methods (which is probably what
is
> > causing the confusion).
> >
> > Now it seems it is even more different than I thought. All I can say is
> > mmhh...
>
> Most OO languages allow static method calls.  C++, Java, Python, Ruby,
> etc.  PHP may have some OO differences, but this is not one of them.
>
> -Rasmus


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




Re: [PHP] Inheritance and a class function: on what class was it called?

2002-10-02 Thread Nick Eby

which is what I suspected... thanks for confirming.  and yes, the call is
disconnected from any class _instance_, but not from any class.  as you said
before, PHP has some OO differences from java, etc, and this is one of
them... if you had static members, then methods called statically would have
to know on what class they were called.  anyway thanks again

/nick

- Original Message -
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: "Nick Eby" <[EMAIL PROTECTED]>
Cc: "Debbie Dyer" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Wednesday, October 02, 2002 3:28 PM
Subject: Re: [PHP] Inheritance and a class function: on what class was it
called?


> Since static method calls are completely disconnected from any class
> instance asking which class the method call is from is rather meaningless,
> and no, I don't think there is any way to get that.
>
> -Rasmus
>
> On Wed, 2 Oct 2002, Nick Eby wrote:
>
> > PHP allows static method calls...  But back to my original question...
> > inside a method that has been called statically, can I determine for
what
> > class the method was called?  Again, obviously the question is only
> > applicable if there is some inheritance involved, and the child class
does
> > not declare the method in question.  Below is my original example
spelled
> > out in code... the call to get_class is not valid since there won't be a
> > $this variable in the context of the static method...  Can I replace it
with
> > something that will cause it to echo "B"?
> >
> > Class A {
> > function staticFunc() { echo get_class($this); }
> > }
> >
> > Class B extends A {}
> >
> > B::staticFunc();
> >
> > thanks again
> > /nick
> >


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




[PHP] Re: elseifs and ereg

2002-10-04 Thread Nick Eby

check the manual page for ereg... you'll find that it takes 2 parameters
minimum, and the return value is not what your code expects it to be.
http://www.php.net/ereg

"Bryan Koschmann - Gkt" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Okay, I think I'm just being stupid here. Can someone please tell me why
> this is wrong? Yeah I know it looks lame, but I'm just testing something.
>
> This always returns "no matches"
>
> Thanks,
>
> Bryan
>
> 
> $now = strtotime("now");
> $out = "never set";
> if ($now == ereg("[2200-2230]"))
> $out = "special";
> elseif ($now == ereg("[0600-1159]"))
> $out = "morning";
> elseif ($now == ereg("[1200-1659]"))
> $out = "afternoon";
> elseif ($now == ereg("[1700-1959]"))
> $out = "evening";
> elseif ($now == ereg("[2000-]"))
> $out = "night";
> elseif ($now == ereg("[0001-0559]"))
> $out = "too late";
> else
> $out = "no matches";
>
> print(date("Hi", $now));
> print "\n$out\n";
>
>
> ?>
>
>



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




[PHP] Re: ASP Option Explicit equivalent in PHP

2002-10-09 Thread Nick Eby

There's 2 ways to get that: use the php.ini setting ERROR_REPORTING, or the
function error_reporting().  to see undeclared variable use, call
error_reporting(E_NOTICE) at the top of your script.

http://www.php.net/manual/en/function.error-reporting.php

/nick

"R . Z ." <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> I'm on a roll with the ASP questions these days, since I picked up the
> Chiliasp.
>
> Here's one:
>
> ASP has the function Option Explicit build in, it yells when you use
> variables without prior declaration, couldn't find anything like that in
> PHP documentation.
> Thanks in advance.
>
> R>



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




[PHP] Re: ASP Option Explicit equivalent in PHP

2002-10-09 Thread Nick Eby

wait, I take that back... I meant "to see uninitialized variable use", since
there's really no such thing as "declaring" a variable in PHP unless it's a
class member.

"Nick Eby" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> There's 2 ways to get that: use the php.ini setting ERROR_REPORTING, or
the
> function error_reporting().  to see undeclared variable use, call
> error_reporting(E_NOTICE) at the top of your script.
>
> http://www.php.net/manual/en/function.error-reporting.php
>
> /nick
>
> "R . Z ." <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]...
> > I'm on a roll with the ASP questions these days, since I picked up the
> > Chiliasp.
> >
> > Here's one:
> >
> > ASP has the function Option Explicit build in, it yells when you use
> > variables without prior declaration, couldn't find anything like that in
> > PHP documentation.
> > Thanks in advance.
> >
> > R>
>
>



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




Re: [PHP] Re: two submit buttons redirecting to two scripts

2002-10-14 Thread Nick Eby

> here is the error message,
> Warning: Cannot add header information - headers already sent by
> (output started at /home3/www/antriksh/resources/action2.php:5) in
> /home3/www/antriksh/resources/action2.php on line 13
>
> any help?
>

that warning is probably generated because you're using the header()
function to perform the redirect.  you can't send a header if you already
echoed some output to the screen, which you apparently do on line 5 of your
php script (see the "output started at .../action2.php:5" message telling
you what line first sent output).

either get rid of all output before line 13, or use a different method to
perform the redirect.  otherwise it looks ok.  good luck

/nick



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




[PHP] Re: upload directory

2002-10-14 Thread Nick Eby

"Jennifer Swofford" <[EMAIL PROTECTED]> wrote:
>Is there an easy way to upload an entire directory?  Rather than selecting
the 19 files in a directory, to just select the directory, and have all its
contents go with it?  (Or even a not-such-an easy way?)


Since uploading a file to your webserver requires the file data be sent as
part of the request; and since the html file-upload widget only accepts one
file at a time... there's no broad-stroke solution to that problem.
Compounded by the fact that you can't read your client's hard drive.  imho,
your options are few... a) a single page with many file-upload widgets, or
b) many pages each with one or a few file-upload widgets.



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




[PHP] PHP Shopping Carts

2002-10-15 Thread Nick Oostveen

I'm currently looking for a basic, php based shopping cart solution which 
is flexible (preferably using a template system of some sort), customizable 
and will allow me to get up and running in a minimum amount of time.

I know that there are literally dozens of free or cheap (less than $200) 
products out there and would appreciate hearing your experiences and 
recommendations so that I can filter out the good from the bad.

Thanks,

Nick Oostveen


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




[PHP] Re: Understanding the =& operator...

2002-10-25 Thread Nick Eby

"Chris Boget" <[EMAIL PROTECTED]> wrote in message
news:023501c27c62$23b74dd0$8c01a8c0@;ENTROPY...
> Ok, let me see if I have this right:
>
> When you do:
>
> $var = new myClass();
>
> $var instantiates and holds a copy of myClass.

No.  The "new" operator makes a new object which is an instance of class
"myClass".

> But when you do:
>
> $var =& new myClass();
>
> $var instantiates and references that instantiation?

No, this is no different than your first example.  Maybe this is even a
syntax error, I'm not positive about that though.

>
> If so, then I'm curious - if you do:
>
> $var2 =& new myClass();
>
> and you modify the member variables in $var2, will the
> member variables of $var be modified as well?  Or does
> $var2 reference a seperate instantiation?

They are separate instances, because the "new" operator made a brand new
object each time it was called.  To make them reference the same object,
you'd instantiate $var1 and then do
$var2 =& $var1;




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




[PHP] oracle: updating clob causes error 600

2002-10-27 Thread Nick Eby
I'm running oracle 8.1.7 w/ php 4.2.  I use the oci8 functions to update
clob columns, and maybe 1 out of every 15 or 20 times, updating a clob
column causes the mysterious "ora-600, internal error code".  Anybody out
there experienced this (and hopefully resolved it) who can shed some light?
thanks

/nick



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




Re: [PHP] oracle: updating clob causes error 600

2002-10-28 Thread Nick Eby

"Maxim Maletsky" <[EMAIL PROTECTED]> wrote in message
news:20021028122405.4F05.MAXIM@;php.net...
> What's the Oracle version?

8.1.7



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




[PHP] Re: POST-ing or GET-ing an array

2002-10-29 Thread Nick Eby
Hi,

I disagree that serialize/unserialize is the way to go, unless you're
absolutely completely sure that there will only be a relatively small number
of things in the array.  As somebody mentioned briefly, the get request is
limited to a certain number of bytes, and the string representing your
serialized array could easily get too large to send on a get request.

imho the best option is to use the session, which somebody already mentioned
but didn't really elaborate...
$_SESSION['my_array'] = $my_array;

and on next_page (or any other page), you'd just use $_SESSION['my_array']
where you need.  Another option would be to send the request as a post, and
serialize the array into a hidden variable in your form; that way you won't
have to worry (as much) about size constraints.  (a post request is also
limited in size, but it's so large that you probably would never approach
the limit.)

/nick



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




[PHP] Yahoo moves to PHP

2002-10-30 Thread Nick Wilson
Forgive me if you guys have seen this. Just read it on
www.webmasterworld.com

Yahoo moves to PHP 
http://public.yahoo.com/~radwin/talks/yahoo-phpcon2002.htm
-- 
Nick Wilson //  www.tioka.com




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




[PHP] Re: CSS pulls me back in

2002-10-30 Thread Nick Eby
is Constants.inc in the same directory as Stylesheet.php?


"Liam Gibbs" <[EMAIL PROTECTED]> wrote in message
news:D64360C926B9F34F8B35F78D07B8E7A2716E23@;postman.dfait-maeci.gc.ca...
> Still having trouble with CSSs. Now it's a different error. Below is my
CSS
> code. For some reason, I can't get the CSS to access my Constants.inc file
> to grab my constants. Any ideas? The line by which I get my CSS is:
> print("   TYPE = \"TEXT/CSS\">\n");
>
>  require("Constants.inc");



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




[PHP] Re: Secure PHP Form

2002-10-30 Thread Nick Eby
be wary of IE on a macintosh, i seem to remember that IE5 on a mac has the
same nuts and bolts as IE4 on windows.  can anyone back me up on that?

"Pushpinder Singh Garcha" <[EMAIL PROTECTED]> wrote in message
news:9787EE5E-EC3E-11D6-A12B-003065DBDE68@;masterstream.com...
> hi all
>
> I am using a php form to collect credit card information from clients
> and so have hosted the page on a secure server i.e. https
> After filing out the form ...the browser displays a "confirmation page".
>
> I am using IE 5.2 on MAC OS Jaguar when I point IE to the secure
> site and submit the form I get this error
>
> "Security Failure Data Decryption Failure"
>
> When I used Mozilla browser...things worked fine and I got no such error
> Please help me
>
> thanks
> Pushpinder
>



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




Re: [PHP] Getting Newest

2002-11-06 Thread Nick Eby
you could make a union of all the records, and order by newest date first:

(select id, date, name, text from table1) union
(select id, date, name, text from table2) union
(select id, date, name, text from table3) order by date desc

then select the first record
/nick



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




[PHP] POP3 Email

2002-11-07 Thread Nick Hird
I have seen a few things where PHP can get IMAP email, but can PHP get POP3 email as 
well? I want to write a PHP application to get my POP3 email from my server. Can I do 
it with PHP? Or no?

Thanks for your time.


[PHP] wanted: array_diff for more than values

2002-11-08 Thread Nick Eby
example:
$arr1 = array("color" => "red", "flavor" => "cherry");
$arr2 = array("color" => "cherry", "flavor" => "red");
print_r(array_diff($arr1, $arr2));

those 2 arrays are different, but array_diff doesn't know it since it
doesn't compare values at particular keys, just values in general.  i want a
function that knows that those 2 arrays are different; that the values for
both color and flavor changed, and gives me back an array that looks exactly
like $arr2.  although it would take about five minutes to write such a
function, i'm wondering, does one already exist and i just can't find it in
the manual?  thanks
/nick



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




  1   2   3   4   5   6   7   8   >