[PHP] weird fopen problem

2002-01-10 Thread Jon Farmer

I am getting a  the follwing error:

Warning: fopen(/home/jon/pgpfiles/sgsdgsdg,w) - Permission denied in
/home/ethiorg/public_html/test.php on line 2

Warning: Supplied argument is not a valid File-Handle resource in
/home/ethiorg/public_html/test.php on line 3

Warning: Supplied argument is not a valid File-Handle resource in
/home/ethiorg/public_html/test.php on line 4

from the following script:

?
$file = fopen(/home/jon/pgpfiles/sgsdgsdg,w);
fputs($file, this is a test\n);
fclose($file);
?

the directory /home/jon/pgpfiles has mode 777 and is owned by nobody and
group is nobody. Apache runs under user nobody.

Any ideas?



--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969 Mob 07763 620378
PGP Key available, send email with subject: Send PGP Key



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

2002-01-10 Thread DrouetL

Hi everybody,

First of all, Excuse me for my english but I'm french.
I would like to know if somebody already used the com functions of PHP to
retrieve data from Reuters terminal using IDNDDE.

I'm a newbie in PHP, so i would appreciate if you could detailed the
answers

Regards

Laurent Drouet


-- 
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] array_shift and php 4.0.4

2002-01-10 Thread [EMAIL PROTECTED]


Strange, are you sure it's 4.0.4 ??

The manual for array_shift() says it's supported from 4.0.0 .

Maybe try the alias array_pop() ?

otherwise there'll be other ways to strip the first part of the directory,
for example using regexp, try something like:

?
ereg(^[^/]/(.*)$, dirname($PHP_SELF), $regs);
$c = explode(/, $regs[1]);
?


On Wed, 09 Jan 2002 22:00:49 -0500, Gerard Samuel wrote:

Hey all.  Im putting together a script and Im having a couple people 
test it out.

Here is a bit of code...

$c = explode ('/', dirname($PHP_SELF));
array_shift($c);

It runs fine on my box, php 4.0.6, apache 1.3.22.

On a box with php 4.0.4pl1, apache 1.3.20 it spits an error.
Fatal error: Call to unsupported or undefined function array_shift() in 
file.php on line 15

Where/Is there anything wrong with 4.0.4??



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






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




RE: [PHP] weird fopen problem

2002-01-10 Thread Chris Grigor

I copied you script and ran it no probelm. 

are you sure that apache is running as nobody? 

run 
ps -aux | grep httpd

mine is like this  
apache6320  0.0  5.8 49120 7248 ?S10:54   0:00
/usr/sbin/httpd -

but yours might say 
nobody6320  0.0  5.8 49120 7248 ?S10:54   0:00
/usr/sbin/httpd -

Can you run the script as root? if not do you get the same errors?




-Original Message-
From: Jon Farmer [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 10, 2002 11:08 AM
To: PHP General Mailing List
Subject: [PHP] weird fopen problem


I am getting a  the follwing error:

Warning: fopen(/home/jon/pgpfiles/sgsdgsdg,w) - Permission denied in
/home/ethiorg/public_html/test.php on line 2

Warning: Supplied argument is not a valid File-Handle resource in
/home/ethiorg/public_html/test.php on line 3

Warning: Supplied argument is not a valid File-Handle resource in
/home/ethiorg/public_html/test.php on line 4

from the following script:

?
$file = fopen(/home/jon/pgpfiles/sgsdgsdg,w);
fputs($file, this is a test\n);
fclose($file);
?

the directory /home/jon/pgpfiles has mode 777 and is owned by nobody and
group is nobody. Apache runs under user nobody.

Any ideas?



--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969 Mob 07763 620378
PGP Key available, send email with subject: Send PGP Key



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

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




Re: [PHP] weird fopen problem

2002-01-10 Thread Jimmy

Hi Jon,

 Warning: fopen(/home/jon/pgpfiles/sgsdgsdg,w) - Permission denied in
 /home/ethiorg/public_html/test.php on line 2
 the directory /home/jon/pgpfiles has mode 777 and is owned by nobody and
 group is nobody. Apache runs under user nobody.

looks like you try to open a file outside the allowed direcory tree.
check your open_basedir setting in php.ini config file.

--
Jimmy

Politics SUCKS !!


-- 
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] A Problem With Loops

2002-01-10 Thread Ash Young

Hi,

I am having a problem with any type of loop, for, foreach, while. I have a
PHP script that loops through an array that contains the contents of a text
file and processes the data it recieves.

My problem is that the loop will only manage about 18 iterations before
processing dies. I know that PHP scripts on my web host have a max 60sec
execution time but it is not getting anywhere near that time.

Any one have any ideas what I'm doing wrong?



Cheers,

Ash Young


-- 
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] weird fopen problem

2002-01-10 Thread Jon Farmer

 Hi Jon,

  Warning: fopen(/home/jon/pgpfiles/sgsdgsdg,w) - Permission denied in
  /home/ethiorg/public_html/test.php on line 2
  the directory /home/jon/pgpfiles has mode 777 and is owned by nobody and
  group is nobody. Apache runs under user nobody.

 looks like you try to open a file outside the allowed direcory tree.
 check your open_basedir setting in php.ini config file.

Nope it was the /home/jon did not have execute permission for the httpd
user. Fixed now. Thanks to all that responded.

Regards

Jon

--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969 Mob 07763 620378
PGP Key available, send email with subject: Send PGP Key




-- 
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] Cannot load: iconv_module_entry

2002-01-10 Thread Brian Williams

Hi All,

When I try to run apache, I get this error message:

Cannot load /usr/local/libexec/apache/libphp4.so into server:
/usr/local/libexec/apache/libphp4.so:  Undefined symbol 'iconv_module_entry'

Any idea what I need to fix?

Thanks,
Brian




-- 
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] (To Rasmus and/or Developers) PHP as CGI env variables

2002-01-10 Thread fabrizio

Hi,
I'm trying to let Webmin execute a script where I can use php as scripting 
language... (It will be good to work with a language as php in a remote administration 
server, as root!)

Now the STRANGE problem:

When I execute a test.cgi program from Webmin, it's executed as root, as it was from 
command line... that's good. The problem is that Webmin execute well _every_ program I 
tried , EXCEPT php !

It seems that php needs some env variables to work well, and these variables aren't 
provided from the Webmin program, so to solve the problem I've to first understand WHY 
php does not work...

Here are some tests:

1) Executing a php that produce some output, or create a file works only when called 
from a login shell, not in Webmin
2) Executing a script that invoke at with the previous script doesn't work as 
well... from atq the scheduled processes are the same, but the one invoked from a 
login shell works, the invoked from Webmin not at all...

... what to do ?!?

thanx very much,
prakash





Re: [PHP] A Problem With Loops

2002-01-10 Thread S. Murali Krishna


Show the loop code. 


On Thu, 10 Jan 2002, Ash Young wrote:

 Hi,
 
 I am having a problem with any type of loop, for, foreach, while. I have a
 PHP script that loops through an array that contains the contents of a text
 file and processes the data it recieves.
 
 My problem is that the loop will only manage about 18 iterations before
 processing dies. I know that PHP scripts on my web host have a max 60sec
 execution time but it is not getting anywhere near that time.
 
 Any one have any ideas what I'm doing wrong?
 
 
 
 Cheers,
 
 Ash Young
 
 
 -- 
 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]
 

S.Murali Krishna
[EMAIL PROTECTED]  
= 
We grow slow trying to be great

   - E. Stanley Jones
-


-- 
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] A Problem With Loops

2002-01-10 Thread Ash Young

Hi,

Sorry about not showing the code, there is a lot of it. Now this script
works in my pc, running IIS5 but not on my web host.

If you remove various parts of the main if statments then it manages more
than 20. Depending which if statement is removed, changes how many
iterations it will last for. However it will iterate the the correct amount
if it never chooses a if statement. That make sense?

The posted below, sorry there is quite a lot of it in the for loop :)

Cheers,

Ash Young





for($n=3;$ncount($fcontents);$n++) {
/*

*
* FIRST CHECK TO EVALUATE WHAT THE LINE IS.

*
*/
  $pos[MODECHANGE] = strpos($fcontents[$n],**);
  $pos[NOTICE] = strpos($fcontents[$n],-);
  $pos[MESSAGE] = strpos($fcontents[$n],);
  $pos[ACTION] = strpos($fcontents[$n],* );
  $pos[SESSION] = strpos($fcontents[$n],Session);
  $pos[DONTKNOW] = 999;
  if(!is_integer($pos[MODECHANGE]))  $pos[MODECHANGE]=1000;
  if(!is_integer($pos[NOTICE]))  $pos[NOTICE]=1000;
  if(!is_integer($pos[MESSAGE]))  $pos[MESSAGE]=1000;
  if(!is_integer($pos[ACTION]))  $pos[ACTION]=1000;
  if(!is_integer($pos[SESSION]))  $pos[SESSION]=1000;
  asort($pos);reset($pos);
  $key = key($pos);
  if($key==MESSAGE) $mode = MESSAGE;
  elseif($key==MODECHANGE) $mode = MODECHANGE;
  elseif($key==ACTION) $mode = ACTION;
  elseif($key==SESSION) $mode = SESSION;
  elseif($key==NOTICE) $mode = NOTICE;
  elseif($key==DONTKNOW) $mode = DONTKNOW;
/*

*
* NOW EXECUTE THE CODE FOR OUR PARTICULAR ACTION

*
*/

  if($mode==MESSAGE) {
/*

*
* MESSSAGE CODE
* GET NICKNAME, THEN CHECK TO SEE IF EXISTS IN NICK ARRAY IF NOT ADD,
CREATING
* A NEW NICKNAME OBJECT WITH IT.
* ELSE INCREMENT ADD THE LINENO TO THE OBJECT FOR RANDOM LINE PROCESSING

*
*/
$currentnick =
substr($fcontents[$n],$pos[MESSAGE]+1,strpos($fcontents[$n],) -
$pos[MESSAGE]-1);
// See if it exists already in our nicklist array
if (!isset($nicklist)) {
  $nicklist[$currentnick] = new NickName($currentnick,$n,0,0);
}
elseif (@array_key_exists($currentnick, $nicklist)) {
  $nicklist[$currentnick]-addLine($n);
}
else {
  $nicklist[$currentnick] = new NickName($currentnick,$n,0,0);
}
/*

*
* NOW CREATE TIME OF DAY ARRAY

*
*/
$currenthr = substr($fcontents[$n],1,2);
if(is_numeric($currenthr))
  $timeofday[$currenthr]++;
  }
  elseif($mode==MODECHANGE) {
/*

*
* CHANGE MODE CODE
*
* FIRST SEE IF TOPIC LINE

*
*/
$lstart = $pos[MODECHANGE]+4;
if (substr($fcontents[$n],$lstart,5)==Topic) {
/*

*
* DEAL WITH TOPIC ON JOIN, ADD TO TOPIC ARRAY, THEN WITH TOPIC CHANGE

*
*/
  $prevtopics[] =
substr($fcontents[$n],$lstart+10,strlen($fcontents[$n])-$lstart-13);
}
elseif(strpos($fcontents[$n],changes topic)  NULL) {
  $temppos = strpos($fcontents[$n],changes topic)+18;
  $prevtopics[] =
substr($fcontents[$n],$temppos,strlen($fcontents[$n])-$temppos-2);
}
  }
  elseif($mode==ACTION) {
/*

*
* ACTION CODE
* GET NICKNAME, THEN CHECK TO SEE IF EXISTS IN NICK ARRAY IF NOT ADD,
CREATING
* A NEW NICKNAME OBJECT WITH IT.
* ELSE INCREMENT ADD THE LINENO TO THE OBJECT FOR RANDOM LINE PROCESSING

*
*/
$currentnick =
substr($fcontents[$n],$pos[ACTION]+2,strpos(substr_replace($fcontents[$n],
,0,$pos[ACTION]+2), ));
// See if it exists already in our nicklist array
if (!isset($nicklist)) {
  $nicklist[$currentnick] = new NickName($currentnick,0,0,$n);
}
elseif (@array_key_exists($currentnick, $nicklist)) {
  $nicklist[$currentnick]-addAction($n);
}
else {
  $nicklist[$currentnick] = new NickName($currentnick,0,0,$n);
}
  }
  elseif($mode==NOTICE) {
/*

*
* NOTICE CODE
* CHECK IF NOTICE IS ACTUALLY WHOIS. IF SO SKIP THE WHOIS AND CONTINUE
PROCESSING

*
*/
 

Re: [PHP] array_shift and php 4.0.4

2002-01-10 Thread Jason Wong

On Thursday 10 January 2002 17:38, [EMAIL PROTECTED] wrote:
 Strange, are you sure it's 4.0.4 ??

 The manual for array_shift() says it's supported from 4.0.0 .

 Maybe try the alias array_pop() ?

array_pop() and array_shift are *different* :)

array_pop() takes an element off the END of the array.
array_shift() takes an element off the START of the array.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Never pay a compliment as if expecting a receipt.
*/

-- 
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] Test if picture exists then load.

2002-01-10 Thread Dean Householder

I'm not sure what function I need to use, but I want to test if a picture exists in a 
directory and if it does to display it but if not display another graphic that says 
'No Graphic Available'.  

Would that be fopen()?  or something else?  I'm still new to PHP so any feedback would 
be very appreciated.

Dean



Re: [PHP] array_shift and php 4.0.4

2002-01-10 Thread Gerard Samuel

Yeah its 4.0.4.  I figure it strange also since array_shift was there 
since 4.0.0.
array_pop(), isn't that for the last element.  I want to take out the 
first element, thus array_shift.
Ill try the regexp and see how it goes...
Ill report back
Thanks

[EMAIL PROTECTED] wrote:

 Strange, are you sure it's 4.0.4 ??
 
 The manual for array_shift() says it's supported from 4.0.0 .
 
 Maybe try the alias array_pop() ?
 
 otherwise there'll be other ways to strip the first part of the directory,
 for example using regexp, try something like:
 
 ?
   ereg(^[^/]/(.*)$, dirname($PHP_SELF), $regs);
   $c = explode(/, $regs[1]);
 ?
 
 
 On Wed, 09 Jan 2002 22:00:49 -0500, Gerard Samuel wrote:
 
 
Hey all.  Im putting together a script and Im having a couple people 
test it out.

Here is a bit of code...

$c = explode ('/', dirname($PHP_SELF));
array_shift($c);

It runs fine on my box, php 4.0.6, apache 1.3.22.

On a box with php 4.0.4pl1, apache 1.3.20 it spits an error.
Fatal error: Call to unsupported or undefined function array_shift() in 
file.php on line 15

Where/Is there anything wrong with 4.0.4??



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



 
 
 
 



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




Re: [PHP] Test if picture exists then load.

2002-01-10 Thread Jason Wong

On Thursday 10 January 2002 18:19, Dean Householder wrote:
 I'm not sure what function I need to use, but I want to test if a picture
 exists in a directory and if it does to display it but if not display
 another graphic that says 'No Graphic Available'.

 Would that be fopen()?  or something else?  I'm still new to PHP so any
 feedback would be very appreciated.

Use file_exists() to check whether a file exists.

To check whether is is a valid image file you could use getimagesize().

hth
-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Military justice is to justice what military music is to music.
-- Groucho Marx
*/

-- 
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] DDE PHP (follow up)

2002-01-10 Thread DrouetL

If I want to access Reuters using VBA I can do :


 Sub Request ()
  Rem Initiate a conversation with the IDN Server
  ChannelNumber = DDEInitiate(REUTER, IDN)
  Rem Issue a request and place value in cell A1 of the active
sheet
  ActiveSheet.Cells(1, 1).Formula = DDERequest(ChannelNumber,
IBM,LAST)
  Rem Terminate the conversation with the IDN Server
  DDETerminate (ChannelNumber)
 End Sub

How can it be done in PHP ?

Laurent Drouet

---
Hi everybody,

First of all, Excuse me for my english but I'm french.
I would like to know if somebody already used the com functions of PHP to
retrieve data from Reuters terminal using IDNDDE.

I'm a newbie in PHP, so i would appreciate if you could detailed the
answers

Regards

Laurent Drouet



-- 
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] array_shift and php 4.0.4

2002-01-10 Thread [EMAIL PROTECTED]



You are right, I should've known (used it before) ..

Ofcourse you could do an array_reverse() before and after,
don't know about the performance impact of that however.

bvr.

array_pop() and array_shift are *different* :)

array_pop() takes an element off the END of the array.
array_shift() takes an element off the START of the array.




-- 
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] array_shift and php 4.0.4

2002-01-10 Thread Gerard Samuel

Thats my biggest concern now, performance with whatever alternatives 
that can be dreamed up...
Anyway, its 6 in the morning, time for sleep.  Maybe Ill dream up 
something else

[EMAIL PROTECTED] wrote:

 
 You are right, I should've known (used it before) ..
 
 Ofcourse you could do an array_reverse() before and after,
 don't know about the performance impact of that however.
 
 bvr.
 
 
array_pop() and array_shift are *different* :)

array_pop() takes an element off the END of the array.
array_shift() takes an element off the START of the array.

 
 
 
 



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

2002-01-10 Thread sebbe

Hi,

I just installed IIS 5.0 and PHP 4.1.1 on Win 2000, and I'm wondering what happened to 
the HTTP_X_FORWARDED_FOR? I doesn't seem to exist on my system. Is it just a variable 
that needs to be changed, or has it been removed from PHP? Thanks.

  Sebbe


Get your own free email account from
http://www.popmail.com


-- 
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] array_shift and php 4.0.4

2002-01-10 Thread Jason Wong

On Thursday 10 January 2002 18:54, [EMAIL PROTECTED] wrote:
 You are right, I should've known (used it before) ..

 Ofcourse you could do an array_reverse() before and after,

LOL !!

 don't know about the performance impact of that however.


 array_pop() and array_shift are *different* :)


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
When the blind lead the blind they will both fall over the cliff.
-- Chinese proverb
*/

-- 
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] array_shift and php 4.0.4

2002-01-10 Thread [EMAIL PROTECTED]


Actually, my 'don't know' was more like 'does anyone know?' .

But I figured I could find that out for myself.

Wrote a small script that creates an array (numeric indexed range) of
10,000 elements.

Then it calls array_reverse() on it 100 times.

This took a little more than 3 secs. on a P3, which is relatively slow IMO.

Ofcourse two calls won't really hurt if you have a fast server.

A larger array of 100,000 elements took more then 30 secs. (hit the timelimit) ..

So the speed is clearly affected by the size of the array, *maybe* even by the size of 
the elements ..

Here's the code I used to test:

?php

   set_time_limit(3600);

   $arr = range(1, 1);


   start_clock();

   for ($i = 0; $i  100; $i++)
   {
  array_reverse($arr);
   }

   echo(get_clock() . \n);


   // timer functions

   function start_clock()
   {
  global $start;

  $start = microtime();
   }

   function get_clock()
   {
  global $start;

  $stop = microtime();

  $start = split( , $start);
  $stop = split( , $stop);

  $start = (float)$start[0] + $start[1];
  $stop = (float)$stop[0] + $stop[1];

  $time = $stop - $start;

  $htime = (int)($time / 3600);
  $time -= ($htime * 3600);

  $mtime = (int)($time / 60);
  $time -= ($mtime * 60);

  $stime = ((int)($time * 100) / 100);

  $stime = ereg_replace(\., s, $stime);

  if ($htime)
  {
 $clock = $htime . H;
  }

  if ($mtime)
  {
 $clock .= $mtime . m;
  }

  return $clock . $stime . h;
   }
?


On Thu, 10 Jan 2002 05:54:49 -0500, Gerard Samuel wrote:

Thats my biggest concern now, performance with whatever alternatives 
that can be dreamed up...
Anyway, its 6 in the morning, time for sleep.  Maybe Ill dream up 
something else

[EMAIL PROTECTED] wrote:

 
 You are right, I should've known (used it before) ..
 
 Ofcourse you could do an array_reverse() before and after,
 don't know about the performance impact of that however.
 
 bvr.
 
 
array_pop() and array_shift are *different* :)

array_pop() takes an element off the END of the array.
array_shift() takes an element off the START of the array.




-- 
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] (To Rasmus and/or Developers) PHP as CGI env variables

2002-01-10 Thread fabrizio

Thank you for your prompt reply...

The problems seem to be some env variables (maybe I'm wrong) when
executing PHP as CGI...
I better explain with 2 samples:

file aaa.cgi

#!/bin/bash
echo Content-type: text/plain
echo
echo aaa
touch /home/test.txt

file bbb.cgi

#!/usr/local/bin/php -q
?php
echo Content-type: text/plain\n\n;
echo aaa\n;
$fd = fopen(/home/test.txt,w);
fclose($fd);
?

Now, the 2 programs are quite the same... (if test.txt does not exist...)
But, the 2 programs behave the same way only if you execute them _from
command line_.
If you execute them from the Webmin interface (very good for remote
administration, that lets execute programs with user root), they behave
differently:
aaa.cgi is the same, displays aaa on the remote web-browser, and creates
(well, if text.txt doesn't exist) a local file.
bbb.cgi does nothing, sends no http headers, no aaa, and does not create the
file...

It seems that PHP needs some env variables, and without them, it suddenly
stops without parsing the file... am I right ?!?

I've also tried to escape from this problem (until understood and solved)
with a third program:

file ccc.cgi

#!/bin/bash
/usr/bin/at -f /path/bbb.cgi now+1minute
touch /home/test2.txt

If I call ccc.cgi from Webmin and then from command line, the 2 executions
are scheduled properly, and look really the same (root user,same
program,...) but the task scheduled from Webmin is not executed properly...
the php seems to stop with no output.

Also with a file like this:

file ddd.cgi

#!/bin/bash
/path/bbb.cgi 21  test3.txt

show that php really has no output on stdout or stderr (test3.txt is
created, but 0 bytes long when invoked from Webmin!)

So, the BIG problem is: if Webmin can execute all programs, running them as
root, WHY doesn't work well with php scripts ?!?
I think that the PHP need something, and not having it it suddenly stops...
but what ?!?

Are there some developer that can help ?!?

(Writing Webmin modules in perl is not good, if you work mainly with php,
and webmin can be the best remote administration utility...)

thanks to all,
waiting for some news...
prakash



 Ok, this is not really clear to me. Does it do anything? perharps give an
error ??
 Did you try writing all output to a file, so you can actually see the
error ??

 for example:

 ls  21  /tmp/out

 will write 'ls' his stdout AND stderr to /tmp/out

 Maybe, do you need to include the full path to your php binary ??


 Hi,
 I'm trying to let Webmin execute a script where I can use php as
scripting language... (It will be good to work with a language as php in a
remote administration server, as root!)
 
 Now the STRANGE problem:
 
 When I execute a test.cgi program from Webmin, it's executed as root, as
it was from command line... that's good. The problem is that Webmin execute
well _every_ program I tried , EXCEPT php !
 
 It seems that php needs some env variables to work well, and these
variables aren't provided from the Webmin program, so to solve the problem
I've to first understand WHY php does not work...
 
 Here are some tests:
 
 1) Executing a php that produce some output, or create a file works only
when called from a login shell, not in Webmin
 2) Executing a script that invoke at with the previous script doesn't
work as well... from atq the scheduled processes are the same, but the one
invoked from a login shell works, the invoked from Webmin not at all...
 
 ... what to do ?!?
 
 thanx very much,
 prakash
 
 
 





-- 
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] global/local var in a function

2002-01-10 Thread Alex Elderson

Hi,

I have a little problem with a function. It calls him self and the var i is
lost! after the call!

can anybody help me?

(it's javascript)


function change_check_all(tree_item) {
a = document.all[tree_item + _check];
b = document.all[tree_item + _count];
for(i=0;ib.value;i++) {
  if (a.value==off) {
change_check_to(tree_item + _ + i, 0);
  } else {
change_check_to(tree_item + _ + i, 1);
  }
  change_check_all(tree_item + _ + i, i);
}
}



-- 
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] global/local var in a function

2002-01-10 Thread Niklas Lampén

This is because it creates a new thread, atleast I think it so. Use
global variables to prevent this from happening:

i = 0;

function change_check_all(tree_item) {
a = document.all[tree_item + _check];
b = document.all[tree_item + _count];
// changed the line below
for(i = $GLOBALS[i];ib.value;i++) { 
  if (a.value==off) {
change_check_to(tree_item + _ + i, 0);
  } else {
change_check_to(tree_item + _ + i, 1);
  }
  change_check_all(tree_item + _ + i, i);
}
}


Niklas


-Original Message-
From: Alex Elderson [mailto:[EMAIL PROTECTED]] 
Sent: 10. tammikuuta 2002 13:44
To: [EMAIL PROTECTED]
Subject: [PHP] global/local var in a function


Hi,

I have a little problem with a function. It calls him self and the var i
is lost! after the call!

can anybody help me?

(it's javascript)


function change_check_all(tree_item) {
a = document.all[tree_item + _check];
b = document.all[tree_item + _count];
for(i=0;ib.value;i++) {
  if (a.value==off) {
change_check_to(tree_item + _ + i, 0);
  } else {
change_check_to(tree_item + _ + i, 1);
  }
  change_check_all(tree_item + _ + i, i);
}
}



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

2002-01-10 Thread Sabrina Janderka

Hi!

I'm a PHP newcomer with session troubles, perhaps somebody would help me?
I've WIN 98, Apache 1.3.22. as localhost,  PHP 4.0.6 and  the FoxServ.

Everthing works fine but session_start (); gives me always an error:
Warning:  open(/tmp\sess_628ded31c4a8b6f2ebb579e6eb4ec29a, O_RDWR) failed: m (2) in 
c:\foxserv\www\sess.howto1.php on line 2

Following the manual instructions I changed the session.save_path in = 
C:\Windows\Temp\;
The script is running fine on other pc, and I've got the same error with tutorial 
session scripts, so I think it must
be a conf. problem. I changed the session instructions in my php.ini a million of 
time, without result. 
Have I to change also the session.cookie_path = / ?
This is the session-part of the php.ini:

[Session]
; Handler used to store/retrieve data.
session.save_handler = files

; Argument passed to save_handler.  In the case of files, this is the path
; where data files are stored.
session.save_path = C:\Windows\Temp\;

; Whether to use cookies.
session.use_cookies = 1


; Name of the session (used as cookie name).
session.name = PHPSESSID

; Initialize session on request startup.
session.auto_start = 1

; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0

; The path for which the cookie is valid.
session.cookie_path = /

; The domain for which the cookie is valid.
session.cookie_domain =

; Handler used to serialize data.  php is the standard serializer of PHP.
session.serialize_handler = php

; Percentual probability that the 'garbage collection' process is started
; on every session initialization.
session.gc_probability = 1

; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 1440

; Check HTTP Referer to invalidate externally stored URLs containing ids.
session.referer_check =

; How many bytes to read from the file.
session.entropy_length = 0

; Specified here to create the session id.
session.entropy_file =

;session.entropy_length = 16

;session.entropy_file = /dev/urandom

; Set to {nocache,private,public} to determine HTTP caching aspects.
session.cache_limiter = nocache

; Document expires after n minutes.
session.cache_expire = 180

; use transient sid support if enabled by compiling with --enable-trans-sid.
session.use_trans_sid = 1

url_rewriter.tags = a=href,area=href,frame=src,input=src,form=fakeentry
register_globals = On

Thanks a lot for yr help
Sabrina



RE: [PHP] serial array vs. hash....

2002-01-10 Thread Ford, Mike [LSS]

 -Original Message-
 From: Eric McKeown [mailto:[EMAIL PROTECTED]]
 Sent: 09 January 2002 05:53
 
   I
 could store the list in a conventional serial array...
 
 $valid[0] = Valid One;
 $valid[1] = Valid Two;
 $valid[2] = Valid Three;
 .
 and so on, and then use a for loop to iterate through the contents of
 the array each time that I need to check to see if I have a valid
 value.

Well, for a kick-off I'd use the built-in in_array() function rather than writing a 
for loop.

  On the other hand, I could create a hash that looks like...
 
 $valid[Valid One] = some value;
 $valid[Valid Two] = some other value;
 
 and so on, and then simply check to see if the entry exists in the
 associative array in order to determine whether it is valid.  
 I suspect
 that the latter method would be much more efficient 

My suspicions would be the same as yours (but I haven't tested it).  If your some 
value, some other value, etc. are actually values that you are going to use, then 
this is clearly the right solution.  If you're just looking the values up, I might 
tend to the plain array solution simply for readability/understandability -- 
especially if the difference between in_array() and an associative lookup is small.

(BTW -- and pardon me if you already know this, but it's not clear from your query! -- 
if you do use the associative array method as a pure lookup, there's no need to assign 
different values for each index -- indeed, I'd probably go for something like this:

  $valid[Valid One] = TRUE;
  $valid[Valid Two] = TRUE;

as being the most obvious representation of your intentions!)

Cheers!

Mike

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

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




[PHP] Re: [PHP-DB] Re: [PHP] need help looping through each record with a query -stumped

2002-01-10 Thread DL Neil

Brian,

 first off, Martin your suggestion looks great but I don't think its SQL
 syntax is supported by MySQL. It's a good start though - gives me something
 to work with :)

=until it is tried, you won't know! From an SQL point of view it looks ok. In fairness 
to Martin, from the
'further information' given since it may not do everything you want...

 Unfortunately, since this database is ancient and far from
 normalized/optimized, neither table uses unique id's. So looking at the
 scores table the fields are Username, Month, and Score.
 Another big dud is the fact that the Month field is varchar, not a date
 field. So this makes it difficult to sort, as Mehmet suggested.
 And this also makes it difficult to write a function to automate the 3
 consecutive month aspect that's required. That's why I had to code to look
 for specific months - this month (January) counting back 3 (December,
 November, October). Students have until the end of the month to take the
 monthly test - so they can maintain certification if they have passed Dec.,
 Nov., and Oct.'s tests. Or, if they have taken and passed January's test,
 they can be certified if they've also passed December and November. Make
 sense? 4 months total: if the first 3 are passed and/or last 3 are passed
 the student is certified.
...

=regardless of the age of the database, the data appears to be normalised (to the 
description given) however it
is definitely NOT optimised. You will notice that each of the contributors has been 
attempting to work in MySQL,
but you still have the other option - that of tidying up and debugging your torturous 
PHP code! The PHP effort
can be used to attempt to 'recover' from the poor database structure, but as you have 
observed, at some cost -
particularly if you ask yourself how you are going to get things to work in 
February... The problem with
persisting in this is that you have a weak database structure AND you have some hairy 
(hard to understand) PHP
code as a work-around (and may God bless all who sail in her)!

=like the others, my recommendations consist of revisiting your business rules and 
then 'optimising' the
database/data structure - best to fix the problem at its source!

=the idea that the NAME of each month should be used for processing is causing major 
problems. The name of the
month is a LABEL, ie is very useful at the tops of reports, letters, newspapers, etc. 
It is NOT a tool for
calculations. If you'd like to take a look at the archives of the PHP discussion list, 
you'll find my
contribution on this topic dated a few days ago entitled: counting with dates 
(help!) talking about the three
primary date formats and their uses.

=So if I sit a test this month (January), and the last month of last year (December), 
and the second-last month
of 2000 (November) [and with blinding arrogance, let me assume that I would pass each 
with flying colors (cough,
cough)], and further assume that I haven't sat any other tests [much more my speed!]; 
the current logic
(apparently) credits me with a certification!? [thank you] Now before anyone following 
this labrythine logic
starts to laugh, let me say that there are good reasons/procedures that might be in 
place to prevent such a
stupidity happening - but they will almost certainly also make the process of keeping 
historical records more
difficult.

=how does the system keep track of people who do not sit a test during a particular 
month?

=and the other way around: if I sit the test today and fail [please no jeers, I'm very 
sensitive] do the rules
allow/is it possible for me to 'resit' during January. Thus is it possible for me to 
sit (and pass) single tests
in Nov and Dec, but sit two tests in Jan - one a 'fail' and one a 'pass'. If so, are 
you looking at my last
three tests with a view to certification, or are you looking at my last three passes 
(during the pertinent three
months)?

=further: can we assume that a record will be entered into the scores table regardless 
of whether the person
passed or failed? (I have assumed so)

=while on this theme, how is the system to react if tests are not held during a 
particular month, eg the
certification center is closed for summer/Christmas vacation, or out of respect for 
September 11?

=another question about 'rules': the problem description indicates that it is possible 
for a person to have sat
January's test already/early in the month, but it is also possible that (s)he has not. 
Are the tests held on a
particular date for all candidates, or does the system allow each candidate to pick 
his/her own test date?
(which also implies that the January date for all candidates will either be the same, 
or is potentially very
different) - this may make it easier/harder to define an SQL query.

=finally, if I have understood correctly, certification is calculated by three 'month' 
units, not 90-days. Thus
the rule is not three passes in the last 90 days, but is in fact (today) something 
like the last 100 

Re: [PHP] HTTP_X_FORWARDED_FOR?

2002-01-10 Thread Henning Sprang


Hy,


[EMAIL PROTECTED] wrote:

 Hi,
 
 I just installed IIS 5.0 and PHP 4.1.1 on Win 2000, and I'm wondering what happened 
to the HTTP_X_FORWARDED_FOR? I doesn't seem to exist on my system. Is it just a 
variable that needs to be changed, or has it been removed from PHP? Thanks.



This has something to do with the way you access the machine - 
x-forwarder-for contains the private ip address of your client machine 
when calling the php pages through a proxy.
It has nothing to do with your php or server side configuration.

henning




-- 
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] Getting data from DB

2002-01-10 Thread Dani

Hi!

I'm trying to make a webpage which can be edited online. My problem is
the text that I need to be edited will contain of title and sub title
(here is an example of the layout)

Room for Rent

(picture of the room) bala bala 
.
.


-- 
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] sorry - please ignore Getting data from DB

2002-01-10 Thread Dani

sorry I accidently send my message before I finished typing.




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

2002-01-10 Thread Attila Strauss


hi

try something like

$_SERVER[HTTP_X_FORWARDED_FOR]

best regards
attila



 Hy,


 [EMAIL PROTECTED] wrote:

  Hi,
 
  I just installed IIS 5.0 and PHP 4.1.1 on Win 2000, and I'm wondering
what happened to the HTTP_X_FORWARDED_FOR? I doesn't seem to exist on my
system. Is it just a variable that needs to be changed, or has it been
removed from PHP? Thanks.



 This has something to do with the way you access the machine -
 x-forwarder-for contains the private ip address of your client machine
 when calling the php pages through a proxy.
 It has nothing to do with your php or server side configuration.

 henning




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



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




RE: [PHP] quick question

2002-01-10 Thread Ford, Mike [LSS]

 -Original Message-
 From: Erik Price [mailto:[EMAIL PROTECTED]]
 Sent: 09 January 2002 19:22
 
 I'm trying to write my code in accordance with the PHP 4.1.0 security 
 advisory -- that is, I want to use the $_GET and $_POST arrays when 
 grabbing variables passed with GET and POST forms.  But how should I 
 construct the variables for a switch statement?  I'm left confused, 
 since these aren't written with the $ prefix as most 
 variables are...

Err -- yes, they are!

 Should it be:
   case _POST['insert']
 
 or should it be:
   case $_POST['select']

What's wrong with:

case $_POST['insert']

But, if you insist on the quotes, it needs to be:

case {$_POST['insert']}

to ensure that the array index gets processed properly.

Cheers!

Mike

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

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




RE: [PHP] Array Creation

2002-01-10 Thread Ford, Mike [LSS]

 -Original Message-
 From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]]
 Sent: 09 January 2002 20:56
 
  while (!feof ($fp)) {
  $line = fgets($fp, 4096);
$data = explode(,, str_replace(\, , $line));  //using
  str_replace to get rid of quote marks
 //following line to see if data is correct
  echo $data[0]. .$data[1].br;
 
 $theArray[$data[0]]=$data[1];
 
 
  }
  fclose($fp);
 
 You should make sure you don't accidentally delete some 
 double quotes inside
 the strings - maybe
 explode(,,substr($line,1,strlen($line)-2));
 would be a better option.

explode(,, substr($line, 1, -2));

would be even better!

Cheers!

Mike

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

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




[PHP] Help - sending variable(s)

2002-01-10 Thread Dani

Hi!

Could someone please help...
How do I send variable(s) over the url and I want to send it to the the
same page (not opening a new page)

Thank you very much for reviewing my email.
Dani





-- 
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 Conference] presentation slides

2002-01-10 Thread Björn Schotte

Hi all,

you can find the PowerPoint-/StarOffice-/PHPPres-/whatever-
slides of nearly all sessions from the International PHP
Conference 2001 at

   http://www.phpconference.de/2001/slides_en.php
   
or at the end of each session description in each track.

-- 
PHP trainings from experts in Germany.

More information?  mailto:[EMAIL PROTECTED]

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




Re: [PHP] Help - sending variable(s)

2002-01-10 Thread Jason Wong

On Friday 11 January 2002 00:21, Dani wrote:
 Hi!

 Could someone please help...
 How do I send variable(s) over the url and I want to send it to the the
 same page (not opening a new page)

 Thank you very much for reviewing my email.
 Dani


http://www.mywebsite.com/mypage.php?myvariable1=value1myvariable2=value2



In php:

 echo $PHP_SELF?myvariable1=$myvariable1myvariable2=$myvariable2;


hth
-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
If Jesus came back today, and saw what was going on in his name, he'd never 
stop throwing up.
-- Max Von Sydow's character in Hannah and Her Sisters
*/

-- 
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] Help - sending variable(s)

2002-01-10 Thread Dani

Hi Jason!

thanks for your email.

I have tried

http://www.mywebsite.com/mypage.php?myvariable1=value1myvariable2=value2

and adding this into my form

form = form1 method = post action =?php echo
$PHP_SELF?myvariable1=$myvariable1myvariable2=$myvariable2; ? 

input type = text  name=myvariable1 value=

but I still get some error like this  The specified CGI application
misbehaved by not returning a complete set of HTTP headers. The headers it did
return are:

How do I do this?

Thanks



Re: [PHP] Help - sending variable(s)

2002-01-10 Thread Jason Wong

On Friday 11 January 2002 00:50, Dani wrote:
 Hi Jason!

 thanks for your email.

 I have tried

 http://www.mywebsite.com/mypage.php?myvariable1=value1myvariable2=value2

 and adding this into my form

 form = form1 method = post action =?php echo
 $PHP_SELF?myvariable1=$myvariable1myvariable2=$myvariable2; ? 

 input type = text  name=myvariable1 value=

 but I still get some error like this  The specified CGI application
 misbehaved by not returning a complete set of HTTP headers. The headers it
 did return are:


I'm confused at what you're trying to do here. In your original post you 
wanted to pass variables using the URL. But now you're combining it with a 
form!

If you're using a form then:

 form = form1 method = post
   input type = text  name=myvariable1 value=? echo $myvariable1 ?
 /form

would suffice.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Evil is that which one believes of others.  It is a sin to believe evil
of others, but it is seldom a mistake.
-- H.L. Mencken
*/

-- 
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] Getting data from DB

2002-01-10 Thread Rick Emery

Dani, you need to aska a specific question for us to help you.

-Original Message-
From: Dani [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 10, 2002 10:01 AM
To: PHP LIST
Subject: [PHP] Getting data from DB


Hi!

I'm trying to make a webpage which can be edited online. My problem is
the text that I need to be edited will contain of title and sub title
(here is an example of the layout)

Room for Rent

(picture of the room) bala bala 
.
.


-- 
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] MORE QUESTION - Editing Database

2002-01-10 Thread Dani

Hi again!

I'm trying to develop a website where the user can edit the article
online. What is the best way to do this?

is it better using database or fopen() functions?

in mycase because the text (article ) is containing some pre formated
text, which one is the best way to do it?

Thank you!



-- 
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] Help - sending variable(s)

2002-01-10 Thread Miles Thompson


Go to http://www.thickbook.com and look at Julie Meloni's tutorials, 
particularly the one for custom error messages as she very nicely works it 
up over  about 3 iterations of the same simple script which includes a form 
which calls its own script (PHP_SELF).

Miles Thompson

At 11:50 PM 1/10/2002 +0700, Dani wrote:
Hi Jason!

thanks for your email.

I have tried

http://www.mywebsite.com/mypage.php?myvariable1=value1myvariable2=value2

and adding this into my form

form = form1 method = post action =?php echo
$PHP_SELF?myvariable1=$myvariable1myvariable2=$myvariable2; ? 

input type = text  name=myvariable1 value=

but I still get some error like this  The specified CGI application
misbehaved by not returning a complete set of HTTP headers. The headers it did
return are:

How do I do this?

Thanks


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




AW: [PHP] MORE QUESTION - Editing Database

2002-01-10 Thread Marcel Besancon

Hi Dani,

i do prefer using a database. I think it is the most dynamic way
for creating and (important !!!) managing a website. Preformatted text
isn't a problem with a database. 

Bye, Marcel

 -UrsprĂĽngliche Nachricht-
 Von: Dani [mailto:[EMAIL PROTECTED]]
 Gesendet: Donnerstag, 10. Januar 2002 18:37
 An: PHP LIST
 Betreff: [PHP] MORE QUESTION - Editing Database
 Wichtigkeit: Hoch
 
 Hi again!
 
 I'm trying to develop a website where the user can edit the article
 online. What is the best way to do this?
 
 is it better using database or fopen() functions?
 
 in mycase because the text (article ) is containing some pre formated
 text, which one is the best way to do it?
 
 Thank you!
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
[EMAIL PROTECTED]


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




Re: [PHP] Help - sending variable(s)

2002-01-10 Thread Jason Wong

On Friday 11 January 2002 01:11, Dani wrote:

First of all, please keep the discussion on the list :)

 actually I'm trying to put a value from user input and then send the
 variable and the value to the same page so that I can call other php
 script.

 Does this make any sense?

If I understand you correctly, yes :)

   form = form1 method = post
 input type = text  name=myvariable1 value=? echo $myvariable1
  ? /form
 
  would suffice.

Using this would do what you want. Extending it:


 form = form1 method = post
  input type=text name=myvar1 value=? echo $myvar1 ?
 /form

? echo The value you entered is $myvar1; ?


hth
-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
OKAY!!  Turn on the sound ONLY for TRYNEL CARPETING, FULLY-EQUIPPED
R.V.'S and FLOATATION SYSTEMS!!
*/

-- 
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] RE: PHP vs. ASP

2002-01-10 Thread Brinkman, Theodore

Typically, when people talk about 'native' database access, they're
referring to accessing the database using the database's native interface,
not that the language directly supports the database.  (i.e.: not limiting
everything to the lowest common denominator).  The advantage you get from
native access is speed.  The disadvantage you get is having to change code
to access a different database.

It's similar to you speaking to a foreigner in their native tongue, versus
using an interpreter who knows a language you all know, but isn't native to
any of you.  Communication will happen faster if you and the foreigner don't
have to talk to somebody else to talk to each other, and it will happen even
faster if one of you is speaking the other's language.


On the graphic creation topic, the difference between the gd DLLs (which
come with PHP) and the equivalent DLLs for ASP (which don't come with ASP),
is that the PHP DLLs are 'first party' (provided by the same group which
provides the language), while the ASP DLLs are 'third party' (provided by a
different group than that which provides the language).  Also note the fact
that you don't HAVE to compile PHP's gd support as a DLL.  It's completely
possible to compile PHP in such a way that it contains the php-provided gd
interface code instead of creating a seperate library.  (Don't really know
why you'd want to always have the gd code active and taking up memory if you
don't want to use it, but that's a different story.)

- Theo

-Original Message-
From: Michael Kimsal [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 09, 2002 12:10 PM
To: Philip Hallstrom
Cc: Robert Klinkenberg; [EMAIL PROTECTED]
Subject: Re: PHP vs. ASP


Philip Hallstrom wrote:

 I don't want to start a war, but last time I looked PHP had native support
 for every database I'd ever heard of including Oracle, SQLServer, etc...
 
 Just don't want the guy doing the report that php is database limited...
 


Native support can mean different things, I think.  Native to the
language?  

Not really - there are wrapper functions which can be compiled in which 
wrap around third party libraries to give PHP access to those libraries.

The windows port comes with many DLLs, but that's just it - they are 
DLLs.  If I use a DLL to create a graphic in ASP, everyone points out 
that you have to use all these third party modules whereas PHP can do 
it 'natively', which is at best an unfair comparison.

If PHP had 'native' support for SQLServer, I wouldn't have to go fetch 
and compile the freetds library to get SQLServer connections to work 
under Linux.

Michael Kimsal
http://www.tapinternet.com/php/
PHP Training Courses
734-480-9961





-- 
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] Re: PHP vs. ASP

2002-01-10 Thread John Meyer

Just a couple of thoughts here:

1.  Now() outputs the date, so ASP does have that.
2.  I hate the concept of saying that one of these products is superior to
the other.  Why not just lay out the technical points of both, and let the
reader decide.  I'm okay with somebody choosing ASP (or PHP) as long as they
are basing it on the facts and there particular needs; what I don't like are
advocates (read a**holes) turning this into a heated debate devoid of any
facts or basis in reality. BTW, I use both and have used both.  I'm more
concerned with results, not egos.



John Meyer
Q:  What do you do if your linux server crashes.
A:  First, find a candle...*G*
 Original Message Follows
 From: Mike Eheler [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: PHP vs. ASP
 Date: Wed, 09 Jan 2002 10:57:27 -0800

 Well being a former ASP programmer and a current PHP programmer I think
 I can help you there.

 The key point is ease of use. PHP provides far more functionality than
 ASP (try finding a function to print out the date in ASP.. yeah, I
 thought so), while at the same time giving you access to low-level areas
 of the language so that you can really make it do whatever you want.

 Oh yeah, and it's OpenSource. Make it do what you want, and if that
 doesn't suit your fancy, then change it :)

 ASP costs  -- the server (be it Windows or Unix-based) is gonna cost
 ya, any extensions to do more advanced things (such as creating images
 on the fly) is gonna cost ya.. cost cost cost.

 With ASP I was constantly running into roadblocks because of the way it
 works. Let's take form submission.. or beyond that.. uploading FILES.
 You can do it the long, hard way (write your own MIME handler and parse
 the incoming binary data), or the easy way (shell out $$$ to pay for a
 professional activex com object to do the job for you).

 And if that wasn't enough. ASP is just plain slower.

 Well, that's my 2 cents. There's plenty of more points that could be
 said, but I think this should give you some good arguments to start with.

 Mike

 Jake wrote:

 Hello there, I need some help.
 
 I have to do a technical report(about 2200 words) comparing PHP to ASP.
I
 have already decided to make PHP the winner becasue it is superior.  But
I
 am kinda stumped on what areas to compare the two.
 
 If you could help me out in suggesting some possible areas of comparison.
 Keeping in mind that I need about the same amount of info on both PHP and
 ASP.  Also if you could point me in the right direction by including some
 web links that deal with the topic.
 
 Thank You,
 Jake
 
 
 


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


 _
 Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp.


 --
 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] Query Optimizing on sum() function

2002-01-10 Thread Nomor Satu Bajingan

Hello Friends,
I've some performance problem, when I do sum() functions on my tables it 
took 5-7 minutes to return the results.. here is my story:
I've table with 2461566 rows here is my table structure:
mysql describe imp_log;
+--+--+--+-+-++
| Field| Type | Null | Key | Default | Extra 
  |
+--+--+--+-+-++
| sno  | bigint(10)   |  | PRI | NULL| 
auto_increment |
| advt_id  | varchar(20)  |  | | |   
  |
| timestamp| datetime |  | MUL | -00-00 00:00:00 |   
  |
| hostname | varchar(120) |  | | |   
  |
| remoteip | varchar(15)  |  | | |   
  |
| username | varchar(20)  |  | MUL | |   
  |
| camp_id  | varchar(8)   |  | MUL | |   
  |
| browser_os   | varchar(100) |  | | |   
  |
| impressions  | int(11)  |  | | 0   |   
  |
| cookiestring | varchar(128) |  | MUL | |   
  |
| status   | char(1)  |  | | N   |   
  |
+--+--+--+-+-++
the problem is I want to sum the impressions from advt_id number 17 (this 
advt_id has 855517 records on imp_log table).. I want to sum the 
impressions..here is my query:
select sum(impressions) impr from imp_log where camp_id='17';
but it took 5 minutes for me to do the query... but if I use 
count(impressions) it only tooks under 10 sec
mysql select count(impressions) from imp_log;
++
| count(impressions) |
++
|2461566 |
++
1 row in set (0.06 sec)
How to optimize the query ? the strange things is MySQL only uses a little 
of cpu time when I did sum() functions...Can I force MySQL to use all the 
cpu time ?

I uses Linux Mandrake 7.0 with MySQL 4.0.0 alpha-max-log
here is the MySQL variables...
mysql show variables;
+-+---+
| Variable_name   | Value
 
 
  |
+-+---+
| back_log| 50   
 
 
  |
| basedir | /
 
 
  |
| bdb_cache_size  | 8388600  
 
 
  |
| bdb_log_buffer_size | 32768
 
 
  |
| bdb_home| /var/lib/mysql/  
 
 
  |
| bdb_max_lock| 1
 
 
  |
| bdb_logdir  |  
 
 
  |
| bdb_shared_data | OFF  
 
  

RE: [PHP] PHPLib

2002-01-10 Thread Johnson, Kirk



 Hey guys,
 Has anyone used this before?? If so, is it a pain in the a$$? 
 I read the
 documentation.. and sounds like you would need to re-code your
 authentication system, sessions blah blah to work with it? or 
 am i going waay of target here??
 
 All i wanna do is, customize my html... i dont wanna recode 
 my sessions code

PHPLib is a collection of classes. You can use some parts of it without
using all of it. I don't know what it offers in the way of tools to
customize HTML. PHP's native sessions are easier to work with than PHPLib's
sessions, IMHO, so yes, stay away from the session management. You'll just
have to see if there is anything there useful to you, then figure out if
that piece can be broken out separately.

Kirk

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

2002-01-10 Thread Erik Price

I thought that $_GET[] and $_POST[] could be used in place of regular 
variables... that is,

$sql = SELECT * FROM tablename WHERE 
tablename.column=$_GET['criteria_integer'];

but unfortunately, this isn't working.


On Thursday, January 10, 2002, at 08:18  AM, Ford, Mike [LSS] wrote:

 -Original Message-
 From: Erik Price [mailto:[EMAIL PROTECTED]]
 Sent: 09 January 2002 19:22

 I'm trying to write my code in accordance with the PHP 4.1.0 security
 advisory -- that is, I want to use the $_GET and $_POST arrays when
 grabbing variables passed with GET and POST forms.  But how should I
 construct the variables for a switch statement?  I'm left confused,
 since these aren't written with the $ prefix as most
 variables are...

 Err -- yes, they are!

 Should it be:
  case _POST['insert']

 or should it be:
  case $_POST['select']

 What's wrong with:

 case $_POST['insert']

 But, if you insist on the quotes, it needs to be:

 case {$_POST['insert']}

 to ensure that the array index gets processed properly.

 Cheers!

 Mike

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



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




Re: [PHP] quick question

2002-01-10 Thread Erik Price

I thought that $_GET[] and $_POST[] could be used in place of regular 
variables... that is,

$sql = SELECT * FROM tablename WHERE 
tablename.column=$_GET['criteria_integer'];

but unfortunately, this isn't working.  It resulted in the following 
error message in the browser:

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or 
`T_NUM_STRING' in /home/eprice/public_html/people3.php on line 150

Yes, line 150 is exactly where I have this.
It does seem to work if I do this:

$criteria_integer = $_GET['criteria_integer'];
$sql = SELECT * FROM tablename WHERE 
tablename.column=$criteria_integer;

But I thought that the $_GET variable could be used in the same way that 
I historically used the simple variable name $criteria_integer .

Can anyone shed some light on how these predefined variables work in 
this instance?


Erik



On Thursday, January 10, 2002, at 08:18  AM, Ford, Mike [LSS] wrote:

 -Original Message-
 From: Erik Price [mailto:[EMAIL PROTECTED]]
 Sent: 09 January 2002 19:22

 I'm trying to write my code in accordance with the PHP 4.1.0 security
 advisory -- that is, I want to use the $_GET and $_POST arrays when
 grabbing variables passed with GET and POST forms.  But how should I
 construct the variables for a switch statement?  I'm left confused,
 since these aren't written with the $ prefix as most
 variables are...

 Err -- yes, they are!

 Should it be:
  case _POST['insert']

 or should it be:
  case $_POST['select']

 What's wrong with:

 case $_POST['insert']

 But, if you insist on the quotes, it needs to be:

 case {$_POST['insert']}

 to ensure that the array index gets processed properly.

 Cheers!

 Mike

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



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




Re: [PHP] quick question

2002-01-10 Thread Miles Thompson


Yes, but $sql is passed to the database, which has no understanding of 
$_GET. Will it take PHP that much longer to  make this assignment:
$criteria_integer = $_GET['criteria_integer'];

With the benefit that the SQL is much easier to read
$sql = SELECT * FROM tablename WHERE tablename.column='$criteria_integer' ;

Or maybe you need another layer of quotes, but I'd vote for clarity.

Miles Thompson

At 10:44 AM 1/10/2002 -0500, Erik Price wrote:
I thought that $_GET[] and $_POST[] could be used in place of regular 
variables... that is,

$sql = SELECT * FROM tablename WHERE 
tablename.column=$_GET['criteria_integer'];

but unfortunately, this isn't working.


On Thursday, January 10, 2002, at 08:18  AM, Ford, Mike [LSS] wrote:

-Original Message-
From: Erik Price [mailto:[EMAIL PROTECTED]]
Sent: 09 January 2002 19:22

I'm trying to write my code in accordance with the PHP 4.1.0 security
advisory -- that is, I want to use the $_GET and $_POST arrays when
grabbing variables passed with GET and POST forms.  But how should I
construct the variables for a switch statement?  I'm left confused,
since these aren't written with the $ prefix as most
variables are...

Err -- yes, they are!

Should it be:
 case _POST['insert']

or should it be:
 case $_POST['select']

What's wrong with:

 case $_POST['insert']

But, if you insist on the quotes, it needs to be:

 case {$_POST['insert']}

to ensure that the array index gets processed properly.

Cheers!

Mike

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


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


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




Re: [PHP] Test if picture exists then load.

2002-01-10 Thread Jimmy

 Would that be fopen()?  or something else?  I'm still new to PHP so any
 feedback would be very appreciated.

 Use file_exists() to check whether a file exists.

file_exists() function is quite slow.
in your case, better do fopen() to check if the file exist,
because you gonna do fopen() anyway if the file exist.
if fopen() return error, then you can assume the file does not exist.
dont forget to add @ in front of the function name, to surpress err
msg.

if ($f = @fopen($image)) {
  // file exist, read the content, then echo to browser
}
else {
  // file does not exist, open default image
}

--
Jimmy

Bigamy is having one spouse too many.  Monogamy is the same.



-- 
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] Pop3 and php

2002-01-10 Thread php

Is it possible to create a new pop account and a new alias on a server
with php ?

How ?

Ilic.



--
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] Finding PHP Developers for Remote Project

2002-01-10 Thread Richard Spangenberg

I may need some help on a project I am working on.
Does anyone know of a good source of PHP developers where I can advertise my
needs?

Rick



-- 
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] echo diferent coluns from left join

2002-01-10 Thread Rodrigo Peres

Dear List,

I have this sql command that grabs a result of 3 tables. What i want is if
there's a way to do a while printing the site and url and after it's finish
begin, printing site_2 and url_2.

SELECT celebridades.*, links_relacionados.Nome_Link as
site,links_relacionados.Url_link as url, fanclubes.Nome as
site_2,fanclubes.Site as url_2

 FROM celebridades LEFT JOIN links_relacionados ON
links_relacionados.CelebID=celebridades.CelebID LEFT JOIN fanclubes ON
fanclubes.CelebID=celebridades.CelebID WHERE celebridades.CelebID='$celebID'

Thank's in advance

Rodrigo Peres


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

2002-01-10 Thread Arve Bersvendsen

As a small, personal, enjoy-myself-project I'd like to run a 
perpetual-running socket server. Problem is; I also want it to be 
self-modifying so I can insert, remove and change functions as the 
server is running.

The problem is; under normal circumstances, PHP won't let the script 
redeclare functions. Is there any way to circumvent this.

Yes: I know this is probably better solved in other languages, but I 
want this done in PHP.

-- 
Arve URL:http://www.bersvendsen.com/

Newsere mot X-No-Archive
URL:http://www.ibiblio.org/Dave/Dr-Fun/df9601/df960124.jpg

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

2002-01-10 Thread sebbe

Okay, thanks. 'Cause I mean, the REMOTE_ADDR is still there. So you mean that the 
HTTP_X_FORWARDED_FOR isn't working while I'm working localhost?

   Sebbe


 
 Hy,
 
 
 [EMAIL PROTECTED] wrote:
 
  Hi,
  
  I just installed IIS 5.0 and PHP 4.1.1 on Win 2000, and I'm wondering what 
happened to the HTTP_X_FORWARDED_FOR? I doesn't seem to exist on my system. Is it 
just a variable that needs to be changed, or has it been removed from PHP? Thanks.
 
 
 
 This has something to do with the way you access the machine - 
 x-forwarder-for contains the private ip address of your client machine 
 when calling the php pages through a proxy.
 It has nothing to do with your php or server side configuration.
 
 henning
 
 
 
 
 -- 
 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]
 
 
 



Get your own free email account from
http://www.popmail.com


-- 
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] Finding PHP Developers for Remote Project

2002-01-10 Thread Miles Thompson

Here.

Grin - Miles Thompson

At 11:48 AM 1/10/2002 -0500, Richard Spangenberg wrote:
I may need some help on a project I am working on.
Does anyone know of a good source of PHP developers where I can advertise my
needs?

Rick



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


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




Re: [PHP] quick question

2002-01-10 Thread Ed Swartz

Erik,

Although, I've not proved this I think the PHP parser gets confused when
it sees a complex variable reference, $_GET[ 'criteria_integer' ]
embedded within double quotes. I've run into similar error messages so
I've been breaking out the variable from the double quotes as follows:

$sql = SELECT * FROM tablename WHERE
tablename.column= . $_GET['criteria_integer'];


or:


$A = $_GET['criteria_integer'];

$sql = SELECT * FROM tablename WHERE
tablename.column=$A;


Erik Price wrote:
 
 I thought that $_GET[] and $_POST[] could be used in place of regular
 variables... that is,
 
 $sql = SELECT * FROM tablename WHERE
 tablename.column=$_GET['criteria_integer'];
 
 but unfortunately, this isn't working.  It resulted in the following
 error message in the browser:
 
 Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
 `T_NUM_STRING' in /home/eprice/public_html/people3.php on line 150
 
 Yes, line 150 is exactly where I have this.
 It does seem to work if I do this:
 
 $criteria_integer = $_GET['criteria_integer'];
 $sql = SELECT * FROM tablename WHERE
 tablename.column=$criteria_integer;
 
 But I thought that the $_GET variable could be used in the same way that
 I historically used the simple variable name $criteria_integer .
 
 Can anyone shed some light on how these predefined variables work in
 this instance?
 
 Erik
 
 On Thursday, January 10, 2002, at 08:18  AM, Ford, Mike [LSS] wrote:
 
  -Original Message-
  From: Erik Price [mailto:[EMAIL PROTECTED]]
  Sent: 09 January 2002 19:22
 
  I'm trying to write my code in accordance with the PHP 4.1.0 security
  advisory -- that is, I want to use the $_GET and $_POST arrays when
  grabbing variables passed with GET and POST forms.  But how should I
  construct the variables for a switch statement?  I'm left confused,
  since these aren't written with the $ prefix as most
  variables are...
 
  Err -- yes, they are!
 
  Should it be:
   case _POST['insert']
 
  or should it be:
   case $_POST['select']
 
  What's wrong with:
 
  case $_POST['insert']
 
  But, if you insist on the quotes, it needs to be:
 
  case {$_POST['insert']}
 
  to ensure that the array index gets processed properly.
 
  Cheers!
 
  Mike
 
  -
  Mike Ford,  Electronic Information Services Adviser,
  Learning Support Services, Learning  Information Services,
  JG125, James Graham Building, Leeds Metropolitan University,
  Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
  Email: [EMAIL PROTECTED]
  Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
Do you need a Web-based Content Publishing System ?
Call me for more details.


Ed Swartz

ColdFusion and PHP Development

978.772.0888
http://www.sandypondconsulting.com

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

2002-01-10 Thread sebbe

Yeah, I've tried that and the $HTTP_SERVER_VARS but I keep getting this error:

PHP Warning: Undefined index: HTTP_X_FORWARDED_FOR in C:\Web\byenighte\phpinfo.php on 
line 2

I'm using the recommended php.ini, by the way.

   Sebbe


 
 hi
 
 try something like
 
 $_SERVER[HTTP_X_FORWARDED_FOR]
 
 best regards
 attila
 
 
 
  Hy,
 
 
  [EMAIL PROTECTED] wrote:
 
   Hi,
  
   I just installed IIS 5.0 and PHP 4.1.1 on Win 2000, and I'm wondering
 what happened to the HTTP_X_FORWARDED_FOR? I doesn't seem to exist on my
 system. Is it just a variable that needs to be changed, or has it been
 removed from PHP? Thanks.
 
 
 
  This has something to do with the way you access the machine -
  x-forwarder-for contains the private ip address of your client machine
  when calling the php pages through a proxy.
  It has nothing to do with your php or server side configuration.
 
  henning
 
 
 
 
  --
  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]
 
 
 



Get your own free email account from
http://www.popmail.com


-- 
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] Finding PHP Developers for Remote Project

2002-01-10 Thread Jon Haworth

 Does anyone know of a good source of PHP developers where I can advertise
my
 needs?

mailto:[EMAIL PROTECTED] :-)

While advertising isn't very welcome, we often see emails along the lines of
I have a project involving foo and bar, and I need someone who understands
xyzzy to work on it. Please e-mail me offlist with details of your rates and
experience.

Cheers
Jon

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

2002-01-10 Thread Jon Haworth

 Okay, thanks. 'Cause I mean, the REMOTE_ADDR is still there. So you
 mean that the HTTP_X_FORWARDED_FOR isn't working while I'm working
localhost?

REMOTE_ADDR contains the IP of the computer that requested your page.

If it was a proxy doing the request, you'll have the proxy's IP in this
variable, and the IP of the computer that requested the page from the proxy
will be in HTTP_X_FORWARDED_FOR.

This means the best way to grab an IP is with a a function like this:

?php
function getIP () {
  if (getenv(HTTP_X_FORWARDED_FOR)) {

$ip = getenv(HTTP_X_FORWARDED_FOR); 
  } else { 
$ip = getenv(REMOTE_ADDR); 
  }
  return $ip;
}   
?

I'm unsure what happens with multiple proxies, and I'd be interested to know
- do you get an array of HTTP_X_FORWARDED_FORs? Do you just get the first or
the last?

Cheers
Jon

-- 
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] echo diferent coluns from left join

2002-01-10 Thread Miles Thompson


If I understand you correctly, use Javascript to open a second browser 
window for url_2.

Miles Thompson

At 02:49 PM 1/10/2002 -0200, Rodrigo Peres wrote:
Dear List,

I have this sql command that grabs a result of 3 tables. What i want is if
there's a way to do a while printing the site and url and after it's finish
begin, printing site_2 and url_2.

SELECT celebridades.*, links_relacionados.Nome_Link as
site,links_relacionados.Url_link as url, fanclubes.Nome as
site_2,fanclubes.Site as url_2

  FROM celebridades LEFT JOIN links_relacionados ON
links_relacionados.CelebID=celebridades.CelebID LEFT JOIN fanclubes ON
fanclubes.CelebID=celebridades.CelebID WHERE celebridades.CelebID='$celebID'

Thank's in advance

Rodrigo Peres


--
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] Possible bug: Using h and H with unpack()

2002-01-10 Thread Darren Gamble

Good day,

I can not seem to get the h or H options to work at all with unpack().

I'm pretty sure that I have this right, although the documentation for this
function is bit sparse.

The code:


  print The data has been encoded (.strlen($varbind). bytes in size).;

  print Hex: PRE ;
  $hex_unpacked = unpack( H* , $varbind );
  for ( $i=1 ; $i = sizeof($hex_unpacked) ; $i++) {
print $hex_unpacked[$i] . |;
  }
  print \n. sizeof($hex_unpacked) .  elements unpacked.\n;
  print /PRE\n;


prints out:


The data has been encoded (20 bytes in size).Hex: 
 |
1 elements unpacked.


.. for the sample binary string.  If I use C* instead of H* (to print
out characters instead of hex strings) then I get the expected result:


The data has been encoded (20 bytes in size).Hex: 
 6|49|0|2|52|0|0|0|0|48|57|6|49|0|2|52|0|0|0|0|
20 elements unpacked.


Now, I can work around this problem by combining sprintf with the C*
format to format the characters into hex strings.  But, if this is a bug
then it should be addressed.

Alternatively, if unpack() isn't supposed to support all of the options of
pack() (such as H and h) then the documentation should state which
options it can support.

Is this a bug, or have I just missed something?


Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948

-- 
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] echo diferent coluns from left join

2002-01-10 Thread Rodrigo Peres

Sorry, Ithink that I not explain right. I nedd to create a list, something
like:

url site br
url site br
url_2 site_2 br
url_2 site_2 br

When the values returned by url and site finished them proceed to url_2 and
site_2 values.

Thank's

Rodrigo





on 1/10/02 3:16 PM, Miles Thompson at [EMAIL PROTECTED] wrote:

 
 If I understand you correctly, use Javascript to open a second browser
 window for url_2.
 
 Miles Thompson
 
 At 02:49 PM 1/10/2002 -0200, Rodrigo Peres wrote:
 Dear List,
 
 I have this sql command that grabs a result of 3 tables. What i want is if
 there's a way to do a while printing the site and url and after it's finish
 begin, printing site_2 and url_2.
 
 SELECT celebridades.*, links_relacionados.Nome_Link as
 site,links_relacionados.Url_link as url, fanclubes.Nome as
 site_2,fanclubes.Site as url_2
 
 FROM celebridades LEFT JOIN links_relacionados ON
 links_relacionados.CelebID=celebridades.CelebID LEFT JOIN fanclubes ON
 fanclubes.CelebID=celebridades.CelebID WHERE celebridades.CelebID='$celebID'
 
 Thank's in advance
 
 Rodrigo Peres
 
 
 --
 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] Re: Finding PHP Developers for Remote Project

2002-01-10 Thread Michael Kimsal

Richard Spangenberg wrote:

 I may need some help on a project I am working on.
 Does anyone know of a good source of PHP developers where I can advertise my
 needs?
 
 Rick
 
 


We've got a list at Yahoo! Groups

http://groups.yahoo.com/group/phpjobs/

for this sort of thing - though it's been very quiet... :)

There are a number of people there who were/are specifically looking for
fulltime or contract work.

Additionally, if you're willing to accept 'remote' developers, you can 
give me a call direct (toll-free) at 1-866-745-3660.  We run our local 
PHP user group and there are always a number of people who are looking
for contract work.  Depending on your needs I could recommend one or 
more of them.

Good luck!

Michael Kimsal
http://www.tapinternet.com/php/
PHP Training Courses
734-480-9961


-- 
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] Re: SetHandler PHP (parsing pages through a php script)

2002-01-10 Thread C J Michaels

Thanks to the help of Philip Hallstrom we discovered a solution to my
problem.  I'm posting it for posterity.

Apache seems to be able to use the mime type for SetHandler, so...

SetHandler application/x-httpd-php

...works perfectly.

Thanks,
--Chris


C J Michaels wrote in message [EMAIL PROTECTED]...
Server version: Apache/1.3.22 (Unix) + mod_php/4.1.1

Hello,

Short Question:
What is php's apache handler, i.e. for use with the SetHandler statement?

Longer Version:
I would like to parse every URI that is requested on a certain VirtualHost,
through a specific PHP script.  I have _almost_ figgured out a way to do it
but I've run into one snag.  Below is the config I am using.

I am using Action to assign a handler to a specific php script and then
using SetHandler in the VHost to use that script.

If I use a script that is not in a directory that falls under the one I
specified SetHandler in it works fine.  If the script falls under the
same
dir that has the SetHandler specified, I get sucked into a loop.  I'll
eventually get an error to the effect of:

Forbidden:
/path-to/script.php/path-to/script.php/path-to/script.php/path-to/script.ph
p
/path-to/script.php/path-to/script.php/URL-REQUESTED

The kicker here being, is that I want EVERY url on the server to be
processed by the .php script I specify, so everything on that server (even
the script) falls under the SetHandler directive.

I cannot seem to find a way to disable the SetHandler but I can specify a
new one.  Problem is, I have no clue what to use for the SetHandler
statement that would force it to be processed by php.

Any assistance would be greatly appreciated.  I'm open to alternate
solutions to my root problem.

--Chris

=
VirtualHost *:80
ServerName myserver.mydomain.org
DocumentRoot /usr/local/www/myserver
Action php-parse /path-to/script.php

Directory /usr/local/www/myserver
 SetHandler php-parse
 allow from all
 order allow,deny
/Directory
/VirtualHost
==





-- 
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] Re: weird fopen problem

2002-01-10 Thread Martin Wickman

Jon Farmer wrote:

 I am getting a  the follwing error:
 
 Warning: fopen(/home/jon/pgpfiles/sgsdgsdg,w) - Permission denied in
 /home/ethiorg/public_html/test.php on line 2
 the directory /home/jon/pgpfiles has mode 777 and is owned by nobody and
 group is nobody. Apache runs under user nobody.

Sure, but if /home/jon/pgpfiles/sgsdgsdg exists, it may have other 
permission which does not allow nobody to write to 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] echo diferent coluns from left join

2002-01-10 Thread Miles Thompson


Two ways actually ...

You could execute two separate SQL statements, and process them one after 
another.
or
You could process your result set, echo()'ing or print()'ing the first 
elements of the result set, then go back to the beginning and do the second 
set, something like this ...

for ($i = 1; $i = 2; $i++)
{
while( $row = mysql_fetch_array($result)  )
   {
  echo $row[ $i  ] .  br;
   }
mysql_data_seek( $result, 0 );
}

Better double check the index of the $row array as I may be returning the 
field name here, maybe it should be $row[ $i+1], but I think you get the idea.

Miles Thompson

At 04:08 PM 1/10/2002 -0200, Rodrigo Peres wrote:
Sorry, Ithink that I not explain right. I nedd to create a list, something
like:

url site br
url site br
url_2 site_2 br
url_2 site_2 br

When the values returned by url and site finished them proceed to url_2 and
site_2 values.

Thank's

Rodrigo





on 1/10/02 3:16 PM, Miles Thompson at [EMAIL PROTECTED] wrote:

 
  If I understand you correctly, use Javascript to open a second browser
  window for url_2.
 
  Miles Thompson
 
  At 02:49 PM 1/10/2002 -0200, Rodrigo Peres wrote:
  Dear List,
 
  I have this sql command that grabs a result of 3 tables. What i want is if
  there's a way to do a while printing the site and url and after it's 
 finish
  begin, printing site_2 and url_2.
 
  SELECT celebridades.*, links_relacionados.Nome_Link as
  site,links_relacionados.Url_link as url, fanclubes.Nome as
  site_2,fanclubes.Site as url_2
 
  FROM celebridades LEFT JOIN links_relacionados ON
  links_relacionados.CelebID=celebridades.CelebID LEFT JOIN fanclubes ON
  fanclubes.CelebID=celebridades.CelebID WHERE 
 celebridades.CelebID='$celebID'
 
  Thank's in advance
 
  Rodrigo Peres
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

--


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




Re: RE: [PHP] HTTP_X_FORWARDED_FOR?

2002-01-10 Thread sebbe

  Okay, thanks. 'Cause I mean, the REMOTE_ADDR is still there. So you
  mean that the HTTP_X_FORWARDED_FOR isn't working while I'm working
 localhost?
 
 REMOTE_ADDR contains the IP of the computer that requested your page.
 
 If it was a proxy doing the request, you'll have the proxy's IP in this
 variable, and the IP of the computer that requested the page from the proxy
 will be in HTTP_X_FORWARDED_FOR.
 

Thanks, never really knew that.

 This means the best way to grab an IP is with a a function like this:
 
 ?php
 function getIP () {
   if (getenv(HTTP_X_FORWARDED_FOR)) {
 
 $ip = getenv(HTTP_X_FORWARDED_FOR); 
   } else { 
 $ip = getenv(REMOTE_ADDR); 
   }
   return $ip;
 } 
 ?
 

Yeah, that's what I do. ;)

 I'm unsure what happens with multiple proxies, and I'd be interested to know
 - do you get an array of HTTP_X_FORWARDED_FORs? Do you just get the first or
 the last?

Have no idea...

 
 Cheers
 Jon
 
 



Get your own free email account from
http://www.popmail.com


-- 
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] Case insensitive str_replace

2002-01-10 Thread Valentin V. Petruchek

Hello list.

Need you help.

My aim is to str_replace ($word,b$word/b,$str). But: i want
str_replace not to differ uppers and lowers:

Rector = bRec/btor

after str_replace ('rec',brec/b,Rector) in other words.

It seemes to me ereg can help, but i'm still not good at it. Help please

Valentin Petruchek (aki Zliy Pes)
http://zliypes.com.ua
mailto:[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] Re: [PHP-DB] Re: [PHP] need help looping through each record witha query -stumped

2002-01-10 Thread Brian Tully

dn - 

thanks SO much for your detailed reply. :)

yes there are tons of problems :(  the last 3 consecutive Months issue is
tricky enough - but the fact that the database is set up all wrong for this
type of query is the real problem.

unfortunately changing the structure and field formats then changes a LOT of
other scripts that interact with with this table. So i need to figure out
which is less time consuming - change the database or change the handful of
scripts that use this part of the database.

But as far as the loop I was trying to accomplish - any idea why it was not
processed through completion.?

I need to loop through each user's score and process each one. I can't
figure out how to do this one user at a time, i.e.:

snip

while (list(Username, $Month, $Score) = mysql_fetch_row($result2)) {

/snip

this will just return every record in the database and doesn't allow me to
loop through each Username.

so how would I do this?

is this where i might use FOR or FOREACH?

brian


on 1/10/02 7:23 AM, DL Neil at [EMAIL PROTECTED] wrote:

 Brian,
 ...
 
 =regardless of the age of the database, the data appears to be normalised (to
 the description given) however it
 is definitely NOT optimised. You will notice that each of the contributors has
 been attempting to work in MySQL,
 but you still have the other option - that of tidying up and debugging your
 torturous PHP code! The PHP effort
 can be used to attempt to 'recover' from the poor database structure, but as
 you have observed, at some cost -
 particularly if you ask yourself how you are going to get things to work in
 February... The problem with
 persisting in this is that you have a weak database structure AND you have
 some hairy (hard to understand) PHP
 code as a work-around (and may God bless all who sail in her)!
 
 =like the others, my recommendations consist of revisiting your business rules
 and then 'optimising' the
 database/data structure - best to fix the problem at its source!
 
 =the idea that the NAME of each month should be used for processing is causing
 major problems. The name of the
 month is a LABEL, ie is very useful at the tops of reports, letters,
 newspapers, etc. It is NOT a tool for
 calculations. If you'd like to take a look at the archives of the PHP
 discussion list, you'll find my
 contribution on this topic dated a few days ago entitled: counting with dates
 (help!) talking about the three
 primary date formats and their uses.
 
 =So if I sit a test this month (January), and the last month of last year
 (December), and the second-last month
 of 2000 (November) [and with blinding arrogance, let me assume that I would
 pass each with flying colors (cough,
 cough)], and further assume that I haven't sat any other tests [much more my
 speed!]; the current logic
 (apparently) credits me with a certification!? [thank you] Now before anyone
 following this labrythine logic
 starts to laugh, let me say that there are good reasons/procedures that might
 be in place to prevent such a
 stupidity happening - but they will almost certainly also make the process of
 keeping historical records more
 difficult.
 
 =how does the system keep track of people who do not sit a test during a
 particular month?
 
 =and the other way around: if I sit the test today and fail [please no jeers,
 I'm very sensitive] do the rules
 allow/is it possible for me to 'resit' during January. Thus is it possible for
 me to sit (and pass) single tests
 in Nov and Dec, but sit two tests in Jan - one a 'fail' and one a 'pass'. If
 so, are you looking at my last
 three tests with a view to certification, or are you looking at my last three
 passes (during the pertinent three
 months)?
 
 =further: can we assume that a record will be entered into the scores table
 regardless of whether the person
 passed or failed? (I have assumed so)
 
 =while on this theme, how is the system to react if tests are not held during
 a particular month, eg the
 certification center is closed for summer/Christmas vacation, or out of
 respect for September 11?
 
 =another question about 'rules': the problem description indicates that it is
 possible for a person to have sat
 January's test already/early in the month, but it is also possible that (s)he
 has not. Are the tests held on a
 particular date for all candidates, or does the system allow each candidate to
 pick his/her own test date?
 (which also implies that the January date for all candidates will either be
 the same, or is potentially very
 different) - this may make it easier/harder to define an SQL query.
 
 =finally, if I have understood correctly, certification is calculated by three
 'month' units, not 90-days. Thus
 the rule is not three passes in the last 90 days, but is in fact (today)
 something like the last 100 days, ie
 any time in November, not only since 10Nov2001. Correct?
 
 =all of these questions will have a major impact on how the system can be
 implemented.
 
 =Implementation comes 

[PHP] headers showing up in browser

2002-01-10 Thread Mark

I've got this problem that won't go away.

The headers are showing up at the top of the page when I run php in
cgi mode. any ideas?

thanks,
- Mark


--
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] Q: Array

2002-01-10 Thread Ivo Stoykov

Hi group:

I've following question:

How could I determine whether I have in the array's key integers *and*
strings or integers only?

i.e.
$a = new array('one', 'two', 'three'); // this has only integers (am I
wrong?)
$b = new array('one' = 'bla', 'two' = 'blabla', 'three' = 'blablabla');
// integers  strings

latter could be seen using while(list($k, $v) = each($b)) {...}
Result will be
0 (the key) = 'bla' (the value)
one (the key of the *same* element) = 'bla' (the *same* value)

I hope the question is clear enough and I'll highly appreciate your
comments. Thank you

Ivo



-- 
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] Newbie - PHP MySQL

2002-01-10 Thread Ben Clumeck

When using MySQL to Authenticate users for a specific directory (i.e.
www.mysite.com/user) how would it know to go to that directory (/user).
How would it know to not let someone access a file directory in that
directory (i.e. www.mysite.com/user/page2.php)?  If I am using MySQL to
query a row in a table can how would it know to only let a specific user(s)
have access to the information?

Any help you can give me would be greatly appreciated.

Thanks,

Ben


-- 
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 and Images stored in mysql

2002-01-10 Thread Rodrigo Peres

How can I echo an image from other location than the mysql using this kind
of script?? since I'm using php to output the image from database, there's a
way to change it to a ftp link for example if image doesn't exists??

this is my script:

?
$sql = SELECT Imagem_data,Imagem_type FROM imagens WHERE
CelebID='$celebID';
$query = new Query($conexao);
$query-executa($sql);
$resultado = $query-dados();
mysql_close();

$imagem_banco = $resultado['Imagem_data'];
$type = $resultado['Imagem_type'];
if($imagem_banco != ) {
HEADER(Content-type: $type);
echo($imagem_banco);
}
}
?

and I call it from my page with img src=lib_image.php?celebID='1'.

Thank's

Rodrigo


on 1/9/02 9:16 PM, Bogdan Stancescu at [EMAIL PROTECTED] wrote:

 My way around this is using two fallback stages: for one you test
 mysql_num_rows() after performing the query. If that's 0, use a default image
 placed in the database beforehand. If that also returns a null
 mysql_num_rows()
 then echo an image (probably the same default) from a known location in the
 filesystem.
 
 HTH
 
 Bogdan
 
 Rodrigo Peres wrote:
 
 Hi list,
 
 I have some images stored in a blob in mysql. I've made this code to output
 them to html, but the problem is if there's no image at a given id the page
 tooks a long time to load and display the broken image, there's a way to
 avoid this, I mean, there's a way to print a message or another image if
 there's none in mysql ???
 

-- 



-- 
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] headers showing up in browser

2002-01-10 Thread mike cullerton

#!/usr/local/bin/php -q

on 1/10/02 12:16 PM, Mark at [EMAIL PROTECTED] wrote:

 I've got this problem that won't go away.
 
 The headers are showing up at the top of the page when I run php in
 cgi mode. any ideas?


 -- mike cullerton 



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

2002-01-10 Thread Gerard Samuel

If != is the opposite of ==
What is the opposite of === ??

Thanks...


-- 
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] headers showing up in browser

2002-01-10 Thread Rick Emery

what does your code look like?

-Original Message-
From: Mark [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 10, 2002 1:17 PM
To: PHP
Subject: [PHP] headers showing up in browser


I've got this problem that won't go away.

The headers are showing up at the top of the page when I run php in 
cgi mode. any ideas?

thanks,
- Mark


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

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




RE: [PHP] Operators

2002-01-10 Thread Johnson, Kirk



 If != is the opposite of ==
 What is the opposite of === ??

I believe that is !==

Kirk

-- 
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] Re: Operators

2002-01-10 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Gerard Samuel) wrote:

 If != is the opposite of ==
 What is the opposite of === ??

!($something===$somethingelse)

-- 
CC

-- 
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] headers showing up in browser

2002-01-10 Thread Mark

On Thu, 10 Jan 2002 12:53:33 -0700, mike cullerton wrote:
#!/usr/local/bin/php -q

I don't think you understood what I meant. I want the headers to get
sent, but they're showing up in the browser as part of the page
content.

I had this working before on a different machine where everything to
do with apache and php were exactly the same so I don't understand
why I'm suddenly having this problem.

thanks,
- Mark

on 1/10/02 12:16 PM, Mark at [EMAIL PROTECTED] wrote:

 I've got this problem that won't go away.

 The headers are showing up at the top of the page when I run php
in
 cgi mode. any ideas?


 -- mike cullerton







--
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] headers showing up in browser

2002-01-10 Thread Mark

lets say I have a page that contains just this code:
?
header(Location: /myfile.html);
?

the output I get is:
Location: /myfile.html Content-type: text/html

- Mark

On Thu, 10 Jan 2002 14:03:26 -0600, Rick Emery wrote:
what does your code look like?

-Original Message-
From: Mark [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 10, 2002 1:17 PM
To: PHP
Subject: [PHP] headers showing up in browser


I've got this problem that won't go away.

The headers are showing up at the top of the page when I run php in
cgi mode. any ideas?

thanks,
- Mark






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

2002-01-10 Thread Lerp

Hi there, how do I keep values in a form if the user has to go back and fill
in some missing fields?

Thx Joe :)



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

2002-01-10 Thread Mark

Just let the browser cache it.

On Thu, 10 Jan 2002 16:30:01 -0400, Lerp wrote:
Hi there, how do I keep values in a form if the user has to go back
and fill
in some missing fields?

Thx Joe :)







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

2002-01-10 Thread mike cullerton

keep the data in a variable and do something like

INPUT TYPE=text NAME=name VALUE=?php print($name); ?

on 1/10/02 1:30 PM, Lerp at [EMAIL PROTECTED] wrote:

 Hi there, how do I keep values in a form if the user has to go back and fill
 in some missing fields?
 
 Thx Joe :)
 
 


 -- mike cullerton   


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

2002-01-10 Thread Kevin Stone

IE5.5 actualy has a bug that will not cache certain form fields under
certain conditions.  There are other situations in which a browser won't
cache the information at all.  So it's best to do this within the script by
either printing the form from within the script its self, or include() the
HTML form into the script.  Then it's a simple matter of echoing the
information in the Value fields of each form elements.

First Name: input type=text size=30 name=first_name value=?echo
$first_name;?br
Last Name: input type=text size=30 name=last_name value=?echo
$last_name;?

That simple.

-Kevin

- Original Message -
From: Mark [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, January 10, 2002 1:39 PM
Subject: Re: [PHP] Form Question


 Just let the browser cache it.

 On Thu, 10 Jan 2002 16:30:01 -0400, Lerp wrote:
 Hi there, how do I keep values in a form if the user has to go back
 and fill
 in some missing fields?
 
 Thx Joe :)
 
 
 




 --
 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] Re: Finding PHP Developers for Remote Project

2002-01-10 Thread LaserJetter

You could try guru.com

LJ


Richard Spangenberg [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I may need some help on a project I am working on.
 Does anyone know of a good source of PHP developers where I can advertise
my
 needs?

 Rick





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

2002-01-10 Thread LaserJetter

I've noticed on some web pages that when the back button is pressed the data
in the fields is still there and sometimes it isnt. I would expect this with
a password field but why does it only save the data sometimes?


Mark [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Just let the browser cache it.

On Thu, 10 Jan 2002 16:30:01 -0400, Lerp wrote:
Hi there, how do I keep values in a form if the user has to go back
and fill
in some missing fields?

Thx Joe :)









-- 
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] cron job problem.

2002-01-10 Thread Mehmet Kamil ERISEN

Hello All,
I have a php script that i tested first through my browser.
If has a simple mail() command.
It workd fine and I received the email.
not I tried to run it as a cron job by adding 
#!/usr/local/bin/php -q
My webmaster account receives the confirmation that cron
job has run, but I do not receive the emails that the
program is 
supposed to send.
This is the code:
Thanks for the help...

#!/usr/local/bin/php -q
?php
$subject=Cron Job has run;
$body=test.php is running now;
$sendtome = [EMAIL PROTECTED];
mail($sendtome, $subject, $body);
?
--- mike cullerton [EMAIL PROTECTED] wrote:
 #!/usr/local/bin/php -q
 
 on 1/10/02 12:16 PM, Mark at [EMAIL PROTECTED]
 wrote:
 
  I've got this problem that won't go away.
  
  The headers are showing up at the top of the page when
 I run php in
  cgi mode. any ideas?
 
 
  -- mike cullerton 
 
 
 
 -- 
 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]
 


=
Mehmet Erisen
http://www.erisen.com

__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

-- 
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] does this work?

2002-01-10 Thread Erik Price

It seems that I have a parse error somewhere in the following code 
(since that's the only code in my script, it's a test script):

// arraytest.php
$tempsql = SELECT COUNT(*) AS count
FROM divisions;
$tempresult = mysql_query($tempsql, $db);
$temprow = mysql_fetch_array($tempresult);

echo $temprow[count];


Yet, it works fine in the mysql client.  Thus, I am led to believe that 
PHP is not capable of constructing the same kinds of SQL statements that 
can be constructed in the mysql client.  Is this the case?


Erik


PS: what I am -really- trying to do is dynamically fill in a select 
listbox with options that correspond to all of the records in a given 
table.  Like so:

form
  select
   ?php
   foreach 
($record_id_and_record_name_pair_pulled_from_mysql_query) {
   print(option 
value=\${record_id}\${record_name}/option);
   }
   ?
   /select
/form

but I am unsure of how to grab multiple values from the mysql_query() 
and load them into an array.  Has anyone done this before?


-- 
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] does this work?

2002-01-10 Thread Kevin Stone

Hmm I believe that the mysql_query() function requires quotes around the
query statement even it it is being passed as a variable..

mysql_query($tempsql, $db);

-Kevin

 It seems that I have a parse error somewhere in the following code
 (since that's the only code in my script, it's a test script):

 // arraytest.php
 $tempsql = SELECT COUNT(*) AS count
 FROM divisions;
 $tempresult = mysql_query($tempsql, $db);
 $temprow = mysql_fetch_array($tempresult);

 echo $temprow[count];


 Yet, it works fine in the mysql client.  Thus, I am led to believe that
 PHP is not capable of constructing the same kinds of SQL statements that
 can be constructed in the mysql client.  Is this the case?


 Erik


 PS: what I am -really- trying to do is dynamically fill in a select
 listbox with options that correspond to all of the records in a given
 table.  Like so:

 form
   select
?php
foreach
 ($record_id_and_record_name_pair_pulled_from_mysql_query) {
print(option
 value=\${record_id}\${record_name}/option);
}
?
/select
 /form

 but I am unsure of how to grab multiple values from the mysql_query()
 and load them into an array.  Has anyone done this before?


 --
 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] Post CGI variable to PHP

2002-01-10 Thread Benjamin Bostow

I am trying to pass variables from a CGI/Perl script
to a php page. I know how to pass it through the url
(i.e. page.php?tmp=[var1]tmp2=[var2]) but need to
know how to pass it so that the information does not
show up in the url. 

Benjamin

__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

-- 
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] does this work?

2002-01-10 Thread R'twick Niceorgaw

what eact parse error you are getting ? and what is that line ?

Is it giving an error like undefined variable  $temprow[count];
 or some thing like that ?

You may try to change the mysql_fetch_row line to the following

$temprow = mysql_fetch_array($tempresult, MYSQL_ASSOC);

- Original Message - 
From: Erik Price [EMAIL PROTECTED]
To: PHP (E-mail) [EMAIL PROTECTED]
Sent: Thursday, January 10, 2002 4:28 PM
Subject: [PHP] does this work?


 It seems that I have a parse error somewhere in the following code 
 (since that's the only code in my script, it's a test script):
 
 // arraytest.php
 $tempsql = SELECT COUNT(*) AS count
 FROM divisions;
 $tempresult = mysql_query($tempsql, $db);
 $temprow = mysql_fetch_array($tempresult);
 
 echo $temprow[count];
 
 
 Yet, it works fine in the mysql client.  Thus, I am led to believe that 
 PHP is not capable of constructing the same kinds of SQL statements that 
 can be constructed in the mysql client.  Is this the case?
 
 
 Erik
 
 
 PS: what I am -really- trying to do is dynamically fill in a select 
 listbox with options that correspond to all of the records in a given 
 table.  Like so:
 
 form
   select
?php
foreach 
 ($record_id_and_record_name_pair_pulled_from_mysql_query) {
print(option 
 value=\${record_id}\${record_name}/option);
}
?
/select
 /form
 
 but I am unsure of how to grab multiple values from the mysql_query() 
 and load them into an array.  Has anyone done this before?
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 


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




Re: [PHP] does this work?

2002-01-10 Thread Erik Price

I tried that... I get the same error (same line and everything).
As a side note, I haven't ever had to quote the first argument in 
mysql_query() before...
This is quite a conundrum, eh?


Erik


On Friday, January 11, 2002, at 04:25  AM, Kevin Stone wrote:

 Hmm I believe that the mysql_query() function requires quotes around the
 query statement even it it is being passed as a variable..

 mysql_query($tempsql, $db);

 -Kevin

 It seems that I have a parse error somewhere in the following code
 (since that's the only code in my script, it's a test script):

 // arraytest.php
 $tempsql = SELECT COUNT(*) AS count
 FROM divisions;
 $tempresult = mysql_query($tempsql, $db);
 $temprow = mysql_fetch_array($tempresult);

 echo $temprow[count];


 Yet, it works fine in the mysql client.  Thus, I am led to believe that
 PHP is not capable of constructing the same kinds of SQL statements 
 that
 can be constructed in the mysql client.  Is this the case?


 Erik


 PS: what I am -really- trying to do is dynamically fill in a select
 listbox with options that correspond to all of the records in a given
 table.  Like so:

 form
   select
?php
foreach
 ($record_id_and_record_name_pair_pulled_from_mysql_query) {
print(option
 value=\${record_id}\${record_name}/option);
}
?
/select
 /form

 but I am unsure of how to grab multiple values from the mysql_query()
 and load them into an array.  Has anyone done this before?


 --
 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: php-list-
 [EMAIL PROTECTED]




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




RE: [PHP] does this work?

2002-01-10 Thread Rick Emery

Show all your code.  Did you open a connection to the MYSQL server?  If so,
show the code.

-Original Message-
From: Erik Price [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 10, 2002 3:29 PM
To: PHP
Subject: [PHP] does this work?


It seems that I have a parse error somewhere in the following code 
(since that's the only code in my script, it's a test script):

// arraytest.php
$tempsql = SELECT COUNT(*) AS count
FROM divisions;
$tempresult = mysql_query($tempsql, $db);
$temprow = mysql_fetch_array($tempresult);

echo $temprow[count];


Yet, it works fine in the mysql client.  Thus, I am led to believe that 
PHP is not capable of constructing the same kinds of SQL statements that 
can be constructed in the mysql client.  Is this the case?


Erik


PS: what I am -really- trying to do is dynamically fill in a select 
listbox with options that correspond to all of the records in a given 
table.  Like so:

form
  select
   ?php
   foreach 
($record_id_and_record_name_pair_pulled_from_mysql_query) {
   print(option 
value=\${record_id}\${record_name}/option);
   }
   ?
   /select
/form

but I am unsure of how to grab multiple values from the mysql_query() 
and load them into an array.  Has anyone done this before?


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

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




RE: [PHP] does this work?

2002-01-10 Thread Rick Emery

Show all your code.  Did you open a connection to the MYSQL server?  If so,
show the code.

What is the exact error that you get?

-Original Message-
From: Erik Price [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 10, 2002 3:29 PM
To: PHP
Subject: [PHP] does this work?


It seems that I have a parse error somewhere in the following code 
(since that's the only code in my script, it's a test script):

// arraytest.php
$tempsql = SELECT COUNT(*) AS count
FROM divisions;
$tempresult = mysql_query($tempsql, $db);
$temprow = mysql_fetch_array($tempresult);

echo $temprow[count];


Yet, it works fine in the mysql client.  Thus, I am led to believe that 
PHP is not capable of constructing the same kinds of SQL statements that 
can be constructed in the mysql client.  Is this the case?


Erik


PS: what I am -really- trying to do is dynamically fill in a select 
listbox with options that correspond to all of the records in a given 
table.  Like so:

form
  select
   ?php
   foreach 
($record_id_and_record_name_pair_pulled_from_mysql_query) {
   print(option 
value=\${record_id}\${record_name}/option);
   }
   ?
   /select
/form

but I am unsure of how to grab multiple values from the mysql_query() 
and load them into an array.  Has anyone done this before?


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

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




RE: [PHP] does this work?

2002-01-10 Thread Rick Emery


quotes are not needed

-Original Message-
From: Kevin Stone [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 11, 2002 3:26 AM
To: Erik Price; PHP (E-mail)
Subject: Re: [PHP] does this work?


Hmm I believe that the mysql_query() function requires quotes around the
query statement even it it is being passed as a variable..

mysql_query($tempsql, $db);

-Kevin

 It seems that I have a parse error somewhere in the following code
 (since that's the only code in my script, it's a test script):

 // arraytest.php
 $tempsql = SELECT COUNT(*) AS count
 FROM divisions;
 $tempresult = mysql_query($tempsql, $db);
 $temprow = mysql_fetch_array($tempresult);

 echo $temprow[count];


 Yet, it works fine in the mysql client.  Thus, I am led to believe that
 PHP is not capable of constructing the same kinds of SQL statements that
 can be constructed in the mysql client.  Is this the case?


 Erik


 PS: what I am -really- trying to do is dynamically fill in a select
 listbox with options that correspond to all of the records in a given
 table.  Like so:

 form
   select
?php
foreach
 ($record_id_and_record_name_pair_pulled_from_mysql_query) {
print(option
 value=\${record_id}\${record_name}/option);
}
?
/select
 /form

 but I am unsure of how to grab multiple values from the mysql_query()
 and load them into an array.  Has anyone done this before?


 --
 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 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] does this work?

2002-01-10 Thread Erik Price


On Thursday, January 10, 2002, at 04:39  PM, Rick Emery wrote:

 Show all your code.  Did you open a connection to the MYSQL server?  If 
 so,
 show the code.


Okay, but I changed some personal info (that I know is definitely 
correct):

?php
// arraytest.php
$db = mysql_connect(hostname, username, password);
mysql_select_db(database_name, $db);
?

html
head
titleArray Test/title
/head
body


$tempsql = SELECT COUNT(*) AS count
FROM divisions;
$tempresult = mysql_query($tempsql, $db);
$temprow = mysql_fetch_array($tempresult);

echo $temprow[count];

mysql_close($db);
?
/body
/html


-- 
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] does this work?

2002-01-10 Thread Erik Price

Wait, my bad.  Typo... all my fault.
I feel like an ass.


Erik


-- 
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] Re: Post CGI variable to PHP

2002-01-10 Thread LaserJetter

If you send a form on an HTML page using GET then the variables show up in
the URL.  If you send it using POST then they dont.
With PHP 4.1.0 even if the variable is typed in the URL, PHP should only
read the real variables which were submitted if $_GET[$varname] is used (or
whatever it is!)
I have no idea how to combine PHP and Perl - not something I've done.

LJ

Benjamin Bostow [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I am trying to pass variables from a CGI/Perl script
 to a php page. I know how to pass it through the url
 (i.e. page.php?tmp=[var1]tmp2=[var2]) but need to
 know how to pass it so that the information does not
 show up in the url.

 Benjamin

 __
 Do You Yahoo!?
 Send FREE video emails in Yahoo! Mail!
 http://promo.yahoo.com/videomail/



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




  1   2   >