[PHP] has anyone used cookies with snoopy?

2002-03-15 Thread Underbrush

Hello everyone,

Does anyone know how to retrieve a cookie with snoopy, such that I could store it and 
use it to reinitialize the cookie variable the next time I use snoopy.  Or, could I 
take the cookie off my system and use it to initialize the cookie variable?

I desperately need to figure this out.  All suggestions are greatly appreciated.

-underbrush




[PHP] writing data to a file, pointers

2002-03-15 Thread Philip J. Newman

can someone point me in the right direction for writing data to a file.

d:/site/file.txt

infomation:

[DATE] Information

Please point me right.

Philip J. Newman
PhilipNZ :: Design Solutions
http://www.philipnz.com/
[EMAIL PROTECTED]
ICQ# 20482482
+64 25 6144012



[PHP] Deleteing folders containing files...

2002-03-15 Thread Philip Jeffs

Hi,

Does anyone know of an 'easy' way to delete folders that contain files and sub-folders?

Thanks,

Phil
-
 
Philip Jeffs
 
The Tickle Group
The Gate House
Summerseat
Bury
Lancashire
BL9 5PE
United Kingdom
W: http://www.tickle.co.uk
T: 01706 823456
F: 01706 829500
E: [EMAIL PROTECTED] (daytime)
[EMAIL PROTECTED] (evening)
 
-




Re: [PHP] writing data to a file, pointers

2002-03-15 Thread mnc

On Fri, 15 Mar 2002, Philip J. Newman wrote:
 can someone point me in the right direction for writing data to a file.
 
 d:/site/file.txt
 
 infomation:
 
 [DATE] Information

  $information = 'Some information';
  $filename = 'd:/site/file.txt';

  if ((is_writable($filename) || !file_exists($filename))
 $fp = fopen($filename, 'a'))
  {
fputs($fp, date('[d-M-Y] ') . $information . \n);
fclose($fp);
  }
  else
  {
print Unable to open {$filename} for output;
  }

Look up fopen, fputs, fclose in the manual for more details on what's 
going on here.

miguel


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




[PHP] Re: Deleteing folders containing files...

2002-03-15 Thread Henrik Hansen

[EMAIL PROTECTED] (Philip Jeffs) wrote:

  Hi,

  Does anyone know of an 'easy' way to delete folders that contain files and 
 sub-folders?

system(rm -rf folder);

else you need to delete all the folders contents and then the foler
itself reccursivly.

-- 
Henrik Hansen

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




Re: [PHP] Deleteing folders containing files...

2002-03-15 Thread Andrey Hristov

Linux /Unix - 

$some=`rm -rf your_dir`;

Regards,
Andrey

- Original Message - 
From: Philip Jeffs [EMAIL PROTECTED]
To: PHP LIST [EMAIL PROTECTED]
Sent: Friday, March 15, 2002 11:36 AM
Subject: [PHP] Deleteing folders containing files...


Hi,

Does anyone know of an 'easy' way to delete folders that contain files and sub-folders?

Thanks,

Phil
-
 
Philip Jeffs
 
The Tickle Group
The Gate House
Summerseat
Bury
Lancashire
BL9 5PE
United Kingdom
W: http://www.tickle.co.uk
T: 01706 823456
F: 01706 829500
E: [EMAIL PROTECTED] (daytime)
[EMAIL PROTECTED] (evening)
 
-




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




[PHP] Reporting the size of a file/directory on the web server. 820420

2002-03-15 Thread Nick Patsaros

I've scoured the PHP manual and I still can't seem to
find it.  What I'm trying to do is have PHP grab the
size of a file or directory (say of a php file) then
when that file is displayed, I want it to display the
size of the file in the footer of the page.  I would
also like to have the viewer of my web site be able to
check the total size in KB or MB of the entire site. 
I also forsee applications of this in the direction of
reporting the filesize of a file on my FTP which could
be used to calculate the approximate download time for
different connection types.

Is there a way do this?  If so I thank you in advance
for the help.

__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

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




Re: [PHP] Reporting the size of a file/directory on the web server. 820420

2002-03-15 Thread Jason Wong

On Friday 15 March 2002 18:32, Nick Patsaros wrote:
 I've scoured the PHP manual and I still can't seem to
 find it.  What I'm trying to do is have PHP grab the
 size of a file or directory (say of a php file) then
 when that file is displayed, I want it to display the
 size of the file in the footer of the page.  I would
 also like to have the viewer of my web site be able to
 check the total size in KB or MB of the entire site.
 I also forsee applications of this in the direction of
 reporting the filesize of a file on my FTP which could
 be used to calculate the approximate download time for
 different connection types.

 Is there a way do this?  If so I thank you in advance
 for the help.

Manual  Filesystem functions


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

/*
God help those who do not help themselves.
-- Wilson Mizner
*/

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




[PHP] Re: Sorting in php

2002-03-15 Thread Luke Welling


Uma Shankari T. wrote:
   Can anyone please tell me is there any function in php for sorting in
 which the contents are stored in array

Have you seen  sort(), arsort(), asort(), ksort(), natsort(), natcasesort(),
rsort(), usort(), array_multisort(), or uksort()?

Luke Welling
--
PHP and MySQL Web Development
Luke Welling and Laura Thomson
http://www.amazon.com/exec/obidos/ASIN/0672317842



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




[PHP] Re: What permissions for uploading?

2002-03-15 Thread Luke Welling


Leif K-Brooks wrote:
 I have a script that allows the user to upload a file.   Right now,
though,
 it says permission denied when I try to upload.  The permissions for the
 folder I want to upload to is 755 right now.  What should I change it to?

Are you checking the permissions on both the folder you want to copy the
uploaded file to and the temp directory that it needs to go to first?

Luke Welling
--
PHP and MySQL Web Development
Luke Welling and Laura Thomson
http://www.amazon.com/exec/obidos/ASIN/0672317842





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




[PHP] Re: Reporting the size of a file/directory on the web server. 820420

2002-03-15 Thread Luke Welling


Nick Patsaros wrote:
 I've scoured the PHP manual and I still can't seem to
 find it.  What I'm trying to do is have PHP grab the
 size of a file or directory (say of a php file) then
 when that file is displayed, I want it to display the
 size of the file in the footer of the page.  I would
 also like to have the viewer of my web site be able to
 check the total size in KB or MB of the entire site.
 I also forsee applications of this in the direction of
 reporting the filesize of a file on my FTP which could
 be used to calculate the approximate download time for
 different connection types.

 Is there a way do this?  If so I thank you in advance
 for the help.

http://www.php.net/filesize

Luke Welling
--
PHP and MySQL Web Development
Luke Welling and Laura Thomson
http://www.amazon.com/exec/obidos/ASIN/0672317842





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




[PHP] unable to view .php files in browser

2002-03-15 Thread ngupta



I am using php,mysql,apache combination on a linux machine.

I used the INSTALL file available in php-4.0.6.tar to install PHP in
static mode.

Compilations and Installation go on fine with no errors.

But when a test.php script containing:
HTML
HEAD
TITLETesting PHP/TITLE
/HEAD
BODY
?
phpinfo();
?
/BODY
/HTML

is executed, only the HTML tags are interpreted. There is no output for
phpinfo().
The php.ini file is located in /usr/local/lib
The httpd.conf is present in /www/conf
The apache version used is apache_1.3.23


DISCLAIMER: This message is proprietary to Hughes Software Systems Limited
(HSS) and is intended solely for the use of the individual  to whom it is
addressed. It may contain  privileged or confidential information  and should
not be circulated or used for any purpose other than for what it is intended. If
you have received this message in error, please notify the originator
immediately. If you are not the intended recipient, you are notified that you
are strictly prohibited from using, copying, altering, or disclosing the
contents of this message. HSS accepts no responsibility for loss or damage
arising from the use of the information transmitted by this email including
damage from virus.






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




RE: [PHP] require() vs include()

2002-03-15 Thread Ford, Mike [LSS]

 -Original Message-
 From: Jim Lucas [php] [mailto:[EMAIL PROTECTED]]
 Sent: 15 March 2002 00:55
 
 Plus, depending on how you are calling the file.  Meaning if 
 the file name
 that you are calling is a static file name or dynamic file name
 
 require() and require_once()  will include a file before the 
 php parser
 starts its job, but this will only happen if the name isn't dynamic.

In fact, I believe that what you are describing is an OLD behaviour (prior to PHP 
4.0.2, in fact).  However, the manual has only recently changed to document the new 
behaviour (and actually doesn't do it very well, yet).  Now, BOTH require and include 
(and their _once versions) work dynamically, and the only difference is in how they 
report a failure.

Cheers!

Mike

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

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




[PHP] mail() function

2002-03-15 Thread Piotr Wozniak

Hi,

I can't send e-mail by mail() function (PHP 3.0.18, local MTA Postfix).
Function succeeds (return code is 1) but no e-mail is delivered
and there is no records in mail logs.
Variable sendmail_path in php3.ini is rather good: /usr/sbin/sendmail
- this is proper link to real executable sendmail.
What can I do?
Piotr Wozniak


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




Re: [PHP] Deleteing folders containing files...

2002-03-15 Thread Michael Sims

At 09:36 AM 3/15/2002 +, Philip Jeffs wrote:
Hi,

Does anyone know of an 'easy' way to delete folders that contain files and 
sub-folders?

Here's what I use (use rmdirRf($folderthatcontainsotherstuff)):

?
function rmdirRf($file) {
   if(file_exists($file)) {
 chmod($file,0777);
 if (is_dir($file)) {
   $directory = dir($file);
   while(false !== ($filename = $directory-read())) {
 if ($filename != .  $filename != ..) {
   rmdirRf($file./.$filename);
 }
   }
   $directory-close();
   rmdir($file);
 } else {
   unlink($file);
 }
   }
}
?


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




[PHP] array within an array

2002-03-15 Thread Caspar Kennerdale

I have an sql query which calls * rows from a table.

Each row is an array of table field values.

This is how I understand the heirachy

$table_row_array[0] = $field_row_array[]
$table_row_array[1] = $field_row_array[]
$table_row_array[2] = $field_row_array[]

Now $table_row_array is being drawn from the database via a while loop and
an $a++, thus I do not have a name for $field_row_array-

I just know that the value of each in $table_row_array is an array.

How can I access the values within $filed_row_array[]?

I want to do something like

$table_row_array[0 [1]]; (the second value from the array that is the first
of $table_row_array)

I know this isnt the syntax

Thanks in advance





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




Re: [PHP] array within an array

2002-03-15 Thread Jan Rademaker

On Fri, 15 Mar 2002, Caspar Kennerdale wrote:

 I have an sql query which calls * rows from a table.
 
 Each row is an array of table field values.
 
 This is how I understand the heirachy
 
 $table_row_array[0] = $field_row_array[]
 $table_row_array[1] = $field_row_array[]
 $table_row_array[2] = $field_row_array[]
 
 Now $table_row_array is being drawn from the database via a while loop and
 an $a++, thus I do not have a name for $field_row_array-
 
 I just know that the value of each in $table_row_array is an array.
 
 How can I access the values within $filed_row_array[]?
 
 I want to do something like
 
 $table_row_array[0 [1]]; (the second value from the array that is the first
 of $table_row_array)

$table_row_array[0][1];

 
 I know this isnt the syntax
 
 Thanks in advance
 
 
 
 
 
 

-- 
Jan Rademaker [EMAIL PROTECTED]
http://www.ottobak.com



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




RE: [PHP] array within an array

2002-03-15 Thread Niklas Lampén

$array[0][1] is how you access multi-dimensional arrays.


Niklas

-Original Message-
From: Caspar Kennerdale [mailto:[EMAIL PROTECTED]] 
Sent: 15. maaliskuuta 2002 15:18
To: [EMAIL PROTECTED]
Subject: [PHP] array within an array


I have an sql query which calls * rows from a table.

Each row is an array of table field values.

This is how I understand the heirachy

$table_row_array[0] = $field_row_array[]
$table_row_array[1] = $field_row_array[]
$table_row_array[2] = $field_row_array[]

Now $table_row_array is being drawn from the database via a while loop
and an $a++, thus I do not have a name for $field_row_array-

I just know that the value of each in $table_row_array is an array.

How can I access the values within $filed_row_array[]?

I want to do something like

$table_row_array[0 [1]]; (the second value from the array that is the
first of $table_row_array)

I know this isnt the syntax

Thanks in advance





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


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




RE: [PHP] array within an array

2002-03-15 Thread Caspar Kennerdale

Thanks all

I knew it was something simple, but my brain was in twists. (no change there
ha ! ha !)

-Original Message-
From: Niklas Lampén [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 13:24
To: Php-General
Subject: RE: [PHP] array within an array


$array[0][1] is how you access multi-dimensional arrays.


Niklas

-Original Message-
From: Caspar Kennerdale [mailto:[EMAIL PROTECTED]]
Sent: 15. maaliskuuta 2002 15:18
To: [EMAIL PROTECTED]
Subject: [PHP] array within an array


I have an sql query which calls * rows from a table.

Each row is an array of table field values.

This is how I understand the heirachy

$table_row_array[0] = $field_row_array[]
$table_row_array[1] = $field_row_array[]
$table_row_array[2] = $field_row_array[]

Now $table_row_array is being drawn from the database via a while loop
and an $a++, thus I do not have a name for $field_row_array-

I just know that the value of each in $table_row_array is an array.

How can I access the values within $filed_row_array[]?

I want to do something like

$table_row_array[0 [1]]; (the second value from the array that is the
first of $table_row_array)

I know this isnt the syntax

Thanks in advance





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


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


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




RE: [PHP] array within an array (one more query)

2002-03-15 Thread Caspar Kennerdale

can you therefore have $array[0][9][2][3]

if you had an array within an array within an array within an array.

(not sure i'd want to, but you never know)



$array[0][1] is how you access multi-dimensional arrays.


Niklas

-Original Message-
From: Caspar Kennerdale [mailto:[EMAIL PROTECTED]]
Sent: 15. maaliskuuta 2002 15:18
To: [EMAIL PROTECTED]
Subject: [PHP] array within an array


I have an sql query which calls * rows from a table.

Each row is an array of table field values.

This is how I understand the heirachy

$table_row_array[0] = $field_row_array[]
$table_row_array[1] = $field_row_array[]
$table_row_array[2] = $field_row_array[]

Now $table_row_array is being drawn from the database via a while loop
and an $a++, thus I do not have a name for $field_row_array-

I just know that the value of each in $table_row_array is an array.

How can I access the values within $filed_row_array[]?

I want to do something like

$table_row_array[0 [1]]; (the second value from the array that is the
first of $table_row_array)

I know this isnt the syntax

Thanks in advance





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


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


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


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




RE: [PHP] array within an array (one more query)

2002-03-15 Thread Niklas Lampén

Yes.


Niklas

-Original Message-
From: Caspar Kennerdale [mailto:[EMAIL PROTECTED]] 
Sent: 15. maaliskuuta 2002 15:35
To: Php-General
Subject: RE: [PHP] array within an array (one more query)


can you therefore have $array[0][9][2][3]

if you had an array within an array within an array within an array.

(not sure i'd want to, but you never know)



$array[0][1] is how you access multi-dimensional arrays.


Niklas

-Original Message-
From: Caspar Kennerdale [mailto:[EMAIL PROTECTED]]
Sent: 15. maaliskuuta 2002 15:18
To: [EMAIL PROTECTED]
Subject: [PHP] array within an array


I have an sql query which calls * rows from a table.

Each row is an array of table field values.

This is how I understand the heirachy

$table_row_array[0] = $field_row_array[]
$table_row_array[1] = $field_row_array[]
$table_row_array[2] = $field_row_array[]

Now $table_row_array is being drawn from the database via a while loop
and an $a++, thus I do not have a name for $field_row_array-

I just know that the value of each in $table_row_array is an array.

How can I access the values within $filed_row_array[]?

I want to do something like

$table_row_array[0 [1]]; (the second value from the array that is the
first of $table_row_array)

I know this isnt the syntax

Thanks in advance





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


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


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


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


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




Re: [PHP] unable to view .php files in browser

2002-03-15 Thread heinisch

At 15.03.2002  17:28, you wrote:



I am using php,mysql,apache combination on a linux machine.

I used the INSTALL file available in php-4.0.6.tar to install PHP in
static mode.

Compilations and Installation go on fine with no errors.

But when a test.php script containing:
? phpinfo(); ?
is executed, only the HTML tags are interpreted. There is no output for
phpinfo().
The php.ini file is located in /usr/local/lib
The httpd.conf is present in /www/conf
The apache version used is apache_1.3.23

Check out, what filename you have, here´s an exerpt from my
httpd.conf.
maybe yours has not the correct endings defined
(As I work for several servers, nearly every ending will be parsed)

  IfDefine PHP
 AddType application/x-httpd-php3 .php3
 AddType application/x-httpd-php3-source .phps
 AddType application/x-httpd-php3 .phtml
 AddType application/x-httpd-php3 .htmls
 AddType application/x-httpd-php3 .html
 AddType application/x-httpd-php3 .php
 /IfDefine

 #
 # And for PHP 4.x, use:
 #
 IfDefine PHP4
 AddType application/x-httpd-php .php
 AddType application/x-httpd-php-source .phps
 /IfDefine
HTH Oliver


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




[PHP] multiple variables

2002-03-15 Thread Ralph Jarvis

Hi;

An obvious question for some, but I am stumped:

I want to use multiple optins in an if statement...

if(user($arbitraryVariable)==(1 or 2 or 3 or 4))

What would be the proper syntax for this?

Thanks



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




RE: [PHP] multiple variables

2002-03-15 Thread Christoph Starkmann

Hi!

 if(user($arbitraryVariable)==(1 or 2 or 3 or 4))
 What would be the proper syntax for this?

Here:

if((user($arbitraryVariable) = 1) and ($arbitraryVariable = 4) and
($arbitraryVariable == round($arbitraryVariable)))

In other cases, you'd have to write

if((user($arbitraryVariable)==1) or (user($arbitraryVariable)==2) or (...))

Cheers,

Kiko

-
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-

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




Re: [PHP] multiple variables

2002-03-15 Thread Andrey Hristov

if (in_array($arbitraryValue,array(1,2,3,4))){


}
- Original Message - 
From: Ralph Jarvis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 15, 2002 4:50 PM
Subject: [PHP] multiple variables


 Hi;
 
 An obvious question for some, but I am stumped:
 
 I want to use multiple optins in an if statement...
 
 if(user($arbitraryVariable)==(1 or 2 or 3 or 4))
 
 What would be the proper syntax for this?
 
 Thanks
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


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




Re: [PHP] multiple variables

2002-03-15 Thread Edward van Bilderbeek - Bean IT

or use something like this:

$array_values = array(1,2,3,4);
if (in_array(user($arbitraryVariable), $array_values)) {
// do your stuff
}

Greets,

Edward

- Original Message -
From: Christoph Starkmann [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 15, 2002 4:11 PM
Subject: RE: [PHP] multiple variables


 Hi!

  if(user($arbitraryVariable)==(1 or 2 or 3 or 4))
  What would be the proper syntax for this?

 Here:

 if((user($arbitraryVariable) = 1) and ($arbitraryVariable = 4) and
 ($arbitraryVariable == round($arbitraryVariable)))

 In other cases, you'd have to write

 if((user($arbitraryVariable)==1) or (user($arbitraryVariable)==2) or
(...))

 Cheers,

 Kiko

 -
 It's not a bug, it's a feature.
 christoph starkmann
 mailto:[EMAIL PROTECTED]
 http://www.fh-augsburg.de/~kiko
 ICQ: 100601600
 -

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




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




Re: [PHP] PHP Is Inserting (the same) Database Record Multiple Times In My HTML Output

2002-03-15 Thread Erik Price


On Friday, March 15, 2002, at 12:19  AM, hugh danaher wrote:

 You're the second one I've seen using do.  What do? Is it in the php
 manual and I missed it?

do { ... } while ( ... );

Runs the while loop at least once, regardless of whether or not the 
while conditional evaluates to TRUE.  Somewhat unrelated, but I used to 
use this technique for looping through a result array from a 
mysql_fetch_*() function if the internal array pointer has already been 
bumped to the second position by a containing while loop.  Now I just 
use two result container variables instead of the same one, since it's 
conceptually a little cleaner (than worrying about the array pointer's 
position for two separate loops that overlap each other).

 I changed your code slightly (to major if it's your baby).  It might 
 puke if
 the $row is empty for the While loop.  If it does, try an @ sign before 
 the
 while.  I didn't test it but it looks like should go. Or, generate some
 interesting error messages.

My experience with programming is limited, but I was under the 
understanding that the @ sign should be used only suppress possible 
unexpected error messages from users; that using it to suppress known 
errors is really not as good a solution as finding out what is causing 
the error and fixing it... of course, sometimes in a pinch you have to 
MacGuyver the thing I guess.  Just some advice :)


Erik







Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] has anyone used cookies with snoopy?

2002-03-15 Thread Underbrush

I figured it out.  Don't know how to retrieve cookies, but I learned how to set them 
with curl.  No need to use Snoopy.  Sorry.
  - Original Message - 
  From: Underbrush 
  To: [EMAIL PROTECTED] 
  Sent: Friday, March 15, 2002 4:24 PM
  Subject: [PHP] has anyone used cookies with snoopy?


  Hello everyone,

  Does anyone know how to retrieve a cookie with snoopy, such that I could store it 
and use it to reinitialize the cookie variable the next time I use snoopy.  Or, could 
I take the cookie off my system and use it to initialize the cookie variable?

  I desperately need to figure this out.  All suggestions are greatly appreciated.

  -underbrush




Re: [PHP] Targetted redirection?

2002-03-15 Thread Analysis Solutions

Hi Folks:

Okay, here's what I'm talking about...  A sample system.  Four files.

index.php main page holding the frameset.  frameset has two
  frames.  one on left.  one on right.
left.php  navigation menu that goes in the left hand frame
right.php content in right hand frame.  this page is the default
  one that comes up in the initial frameset.
right2.phpanother page for the right hand frame


* index.php **

?php
#   This has no effect.
#   header('Window-target: _top');
?

html
headtitleindex page/title/head
frameset COLS=120,*
FRAME SRC=left.php name=menu scrolling=no
frame src=right.php name=content
/frameset
/html


* left.php **

?php
#   Turning this on will jump this page out of the frames.
#   header('Window-target: _top');
?

htmlheadtitlethe menu/title/headbody
a href=right.php target=contentright/a
br /a href=right2.php target=contentright 2/a
/body/html


* right.php **

?php
#   Turning this on will jump this page out of the frames.
#   header('Window-target: _top');
?

HTMLHEADTITLERight/TITLE/HEADBODY
Hi there. This is the main content page in the right frame.
/BODY/HTML


* right2.php **

?php
#  This has no effect.
#  header('Window-target: _top');
?

HTMLHEADTITLERight 2/TITLE/HEADBODY
Hi there. This is the secondary content page in the right frame.
/BODY/HTML



Now, put all those files on your machine.  Hit index.php and you'll see 
everything normally.  Then, uncomment the header function in left.php or 
right.php and you'll see that page jump out of the frames.  But, turn 
the header on in index.php or index2.php and you'll still be in the 
frames.

Enjoy,

--Dan

-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y

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




Re: [PHP] XML char data parsing

2002-03-15 Thread Thalis A. Kalfigopoulos

  If I send just a line of simple text (like The quick brown fox
  drowned) for XML parsing, why doesn't it call the function which I
  declare for character data handling? It doesn't even give me an error
  :-( Is it wrong to have plain text as input for XML parsing?
 
 Why, as a matter of fact, yes!
 
 The data going into the parser needs to be valid, well-formed, XML.  I
 assume you didn't get an error message because you didn't ask to see the
 error message.  The most basic thing you can do is (assuming you've
 already declared your XML Parser functions...
 
$Contents = 'BLAHThe quick brown fox drowned/BLAH';
 
if ( xml_parse($Parser, $Contents) ) {
   echo Yipee!\n;
} else {
   echo Rejected by parser:\n;
   echo xml_error_string(xml_get_error_code($Parser));
}

Well, as a matter of fact I do. My code is pretty straightforward. I declare the 
handlers:
if(!($xml_parser=xml_parser_create())){
printError(failed to create xml parser);
}
if(!xml_set_element_handler($xml_parser, startElementHandler, endElementHandler)){
printError(failed to set element handlers);
}
if(!xml_set_character_data_handler($xml_parser,charDataHandler)){
printError(failed to set character data handler);
}

And then I parse looking out for any errors:
if (!xml_parse($xml_parser, $xmlstring)){
printError(sprintf(XML: 
%s,xml_error_string(xml_get_error_code($xml_parser;
return false;
}

I don't get any error. I get the $xmlstring from a database and I have verified that 
I'm getting the 1-line pure text (the quick brown fox chocked) just fine. But when 
parsed, a call to charDataHandler() is never made :-(
Is it a bug or am I missing something obvious? Dan, did you actually run this and got 
an error?


TIA,
thalis


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




Re: [PHP] Targetted redirection?

2002-03-15 Thread Erik Price


On Friday, March 15, 2002, at 10:27  AM, Analysis  Solutions wrote:

 Now, put all those files on your machine.  Hit index.php and you'll see
 everything normally.  Then, uncomment the header function in left.php or
 right.php and you'll see that page jump out of the frames.  But, turn
 the header on in index.php or index2.php and you'll still be in the
 frames.

Is this because the frame of the _top page needs to be a child of the 
parent _top page?  That is to say, if the frameset is not created by a 
particular page A then the pages with the header() function do not 
consider page A to be their _top ?

Good example.

Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP] SERVER INFO

2002-03-15 Thread Dani

Hi all,

I appologise if this is off topic but I don't know who to ask. I hope
you guys don't mind.

Does any body know where I can find information about the steps of
setting up a server(LINUX) so that people can find a certain URL
address?

I want to sent up a small server for myself from home with my machine
but I don't know how to make it so that the web pages that I put in
my
server accessable by other people around the world.

do I have to connect my modem into my phone line (online) all the
time
or...???

Does my question make any sense?

any help is welcome.

regards,
Dani


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




[PHP] SESSIONS not timing out

2002-03-15 Thread Anson Smith

My I am working on a PHP page that uses sessions. I use $_SESSION['whatever'] to set 
all my session vars. I can use the session_destroy() and it works fine but if I just 
close the browser (All Browsers), when I come back to the page the Session is still 
active. the session.cookie_lifetime is set to 0 in php.ini. any help will be 
appreciated.


RE: [PHP] SERVER INFO

2002-03-15 Thread Hunter, Ray

Check out the Linux howto's at http://www.linuxdoc.org/docs.html#howto

This will help you set up a server and get online...



Thank you,

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


-Original Message-
From: Dani [mailto:[EMAIL PROTECTED]] 
Sent: Friday, March 15, 2002 11:42 AM
To: [EMAIL PROTECTED]
Subject: [PHP] SERVER INFO
Importance: High


Hi all,

I appologise if this is off topic but I don't know who to ask. I hope you
guys don't mind.

Does any body know where I can find information about the steps of setting
up a server(LINUX) so that people can find a certain URL address?

I want to sent up a small server for myself from home with my machine but I
don't know how to make it so that the web pages that I put in my server
accessable by other people around the world.

do I have to connect my modem into my phone line (online) all the time
or...???

Does my question make any sense?

any help is welcome.

regards,
Dani


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



php-general Digest 15 Mar 2002 15:56:32 -0000 Issue 1228

2002-03-15 Thread php-general-digest-help


php-general Digest 15 Mar 2002 15:56:32 - Issue 1228

Topics (messages 88619 through 88664):

Re: Fetching 1 array from either one of 2 possible columns?
88619 by: Martin Towell

mt_rand()
88620 by: Phillip S. Baker
88630 by: David Robley

Re: GET values from Checkboxes
88621 by: Analysis  Solutions

Re: Help Out A Newbie In Configuring PHP.INI
88622 by: David Robley

Re: gmp_mod support
88623 by: David Robley

Re: apache md5 vs. php md5
88624 by: Rasmus Lerdorf

`XtOffsetOf' redefined messing up 4.1.2 build
88625 by: Phil Glatz

Re: PHP Is Inserting (the same) Database Record Multiple Times In My HTML Output
88626 by: hugh danaher
88657 by: Erik Price

Re: Targetted redirection?
88627 by: Analysis  Solutions
88628 by: Michael P. Carel
88659 by: Analysis  Solutions
88661 by: Erik Price

New Day, New Problem
88629 by: jtjohnston

has anyone used cookies with snoopy?
88631 by: Underbrush
88658 by: Underbrush

writing data to a file, pointers
88632 by: Philip J. Newman
88634 by: mnc.stoic.net

Deleteing folders containing files...
88633 by: Philip Jeffs
88635 by: Henrik Hansen
88636 by: Andrey Hristov
88645 by: Michael Sims

Reporting the size of a file/directory on the web server. 820420
88637 by: Nick Patsaros
88638 by: Jason Wong
88641 by: Luke Welling

Re: Sorting in php
88639 by: Luke Welling

Re: What permissions for uploading?
88640 by: Luke Welling

unable to view .php files in browser
88642 by: ngupta.hss.hns.com
88652 by: heinisch.creaction.de

Re: require() vs include()
88643 by: Ford, Mike   [LSS]

mail() function
88644 by: Piotr Wozniak

array within an array
88646 by: Caspar Kennerdale
88647 by: Jan Rademaker
88648 by: Niklas Lampén
88649 by: Caspar Kennerdale

Re: array within an array (one more query)
88650 by: Caspar Kennerdale
88651 by: Niklas Lampén

multiple variables
88653 by: Ralph Jarvis
88654 by: Christoph Starkmann
88655 by: Andrey Hristov
88656 by: Edward van Bilderbeek - Bean IT

Re: XML char data parsing
88660 by: Thalis A. Kalfigopoulos

SERVER INFO
88662 by: Dani
88664 by: Hunter, Ray

SESSIONS not timing out
88663 by: Anson Smith

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--

---BeginMessage---

instead of:

$esc_subject = $row[SUBJECT1];

use:

$esc_subject1 = $row[SUBJECT1];
$esc_subject2 = $row[SUBJECT2];

and have some logic, in php, later to determine which one(s) to display

-Original Message-
From: phplist [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 2:55 PM
To: 'Martin Towell'; [EMAIL PROTECTED]
Subject: RE: [PHP] Fetching 1 array from either one of 2 possible
columns?


I apologize if I wasn't clear in my email. The query part is fine I
think, as I tested it through the myPHPAdmin and had no problem with the
results (but brackets are good though).

It's this part I'm not too sure about. AS you can see, it's just using
[SUBJECT1] as shown. Correct me if I'm wrong, but even though I have 2
results, the final output would only show 1 because it's only showing
the match in SUBJECT1?

 while ($row = mysql_fetch_array($sql_result)) {
 
   $esc_organization = $row[ORGANIZATION];
   $esc_desc = $row[DESCRIPTION];
   $esc_url = $row[URL];
   $esc_subject = $row[SUBJECT1];
   $esc_geographic = $row[GEOGRAPHIC];


 -Original Message-
 From: Martin Towell [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, March 14, 2002 7:42 PM
 To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
 Subject: RE: [PHP] Fetching 1 array from either one of 2 
 possible columns?
 
 
 use brackets
 
 where (sub1 or sub2) and geo
 
 -Original Message-
 From: phplist [mailto:[EMAIL PROTECTED]]
 Sent: Friday, March 15, 2002 2:41 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Fetching 1 array from either one of 2 possible columns?
 
 
 I'm working on a query by selection type of form, where if a 
 user selects a subject to get information. Each database 
 entry will have 2 subject fields, Subject 1 being the main 
 subject and Subject 2 being the cross-subject. A table is set 
 up like this:
 
 +--+--+--+--+--+-+
 | ID   | Organization | URL  | SUBJECT1 | SUBJECT2 | Geographic  |
 +--+--+--+--+--+-+
 |  1   | Acme | www  |  Math|  English | Canada  |
 |  2   | Loony Toons  | www  |  Comedy  |  Math| Brazil  |
 
 ...
 
 
 The idea is that the query will 

[PHP] Populating Dropdown with MYSQL data

2002-03-15 Thread Jeff Dale

I want to have a dropdown list populated with data from my MySql server.

Any examples or websites that could help is appreciated.



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




Re: [PHP] XML char data parsing

2002-03-15 Thread Analysis Solutions

On Fri, Mar 15, 2002 at 10:34:28AM -0500, Thalis A. Kalfigopoulos wrote:

[regarding error checking...]
 Well, as a matter of fact I do.

Good, good.


 Dan, did you actually run this and got an error?

Why, as a matter of fact, yes!  :)  The error I get is syntax error

Enjoy,

--Dan

-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y

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




[PHP] Re: Populating Dropdown with MYSQL data

2002-03-15 Thread Julio Nobrega Trabalhando

select name=somename
?php
$sql = SELECT id, name FROM table;
$res = mysql_query($sql);
while (list($id, $name) = mysql_fetch_array($res)) {
echo option value=\$id\$name/option;
}
?
/select

--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884


Jeff Dale [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I want to have a dropdown list populated with data from my MySql server.

 Any examples or websites that could help is appreciated.





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




[PHP] XML parser questions

2002-03-15 Thread Thalis A. Kalfigopoulos

OK, I'm getting a bit confused about the well-formedness checking of expat. Doesn't 
expat do basic well-formedness checking? If I set empty start/endElement and charData 
handlers, and I parse:
elem1
  elem2text
  /elem1
/elem2
I get an error as expected about mismatched tags.

But if I give:
elemtext

Or:
elem/text

It doesn't give an error.

Why is that?

TIA,
thalis


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




RE: [PHP] Targetted redirection?

2002-03-15 Thread Brinkman, Theodore

OK, If I understand correctly, the following scenario would work?

Given: My site is being brought up inside somebody else's (say
about.com)frameset.  [We'll call this page about.html]
Given: I want my main page (index.html) to break out of the frames in the
about.html page.  

Solution: My main page (index.html) should send header('Window-target:
_Top');

So, if I use frames, and I want to keep my frameset page out of someone
else's frame, I should send that header for my frameset page?

Is this correct?

- Theo


-Original Message-
From: Analysis  Solutions [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 10:27 AM
To: PHP List
Subject: Re: [PHP] Targetted redirection?


Hi Folks:

Okay, here's what I'm talking about...  A sample system.  Four files.

index.php main page holding the frameset.  frameset has two
  frames.  one on left.  one on right.
left.php  navigation menu that goes in the left hand frame
right.php content in right hand frame.  this page is the default
  one that comes up in the initial frameset.
right2.phpanother page for the right hand frame


* index.php **

?php
#   This has no effect.
#   header('Window-target: _top');
?

html
headtitleindex page/title/head
frameset COLS=120,*
FRAME SRC=left.php name=menu scrolling=no
frame src=right.php name=content
/frameset
/html


* left.php **

?php
#   Turning this on will jump this page out of the frames.
#   header('Window-target: _top');
?

htmlheadtitlethe menu/title/headbody
a href=right.php target=contentright/a
br /a href=right2.php target=contentright 2/a
/body/html


* right.php **

?php
#   Turning this on will jump this page out of the frames.
#   header('Window-target: _top');
?

HTMLHEADTITLERight/TITLE/HEADBODY
Hi there. This is the main content page in the right frame.
/BODY/HTML


* right2.php **

?php
#  This has no effect.
#  header('Window-target: _top');
?

HTMLHEADTITLERight 2/TITLE/HEADBODY
Hi there. This is the secondary content page in the right frame.
/BODY/HTML



Now, put all those files on your machine.  Hit index.php and you'll see 
everything normally.  Then, uncomment the header function in left.php or 
right.php and you'll see that page jump out of the frames.  But, turn 
the header on in index.php or index2.php and you'll still be in the 
frames.

Enjoy,

--Dan

-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y

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




[PHP] Help - Variables

2002-03-15 Thread BUDINSCHI Cosmin


Could smbdy please help me


I have  a variable with the name 
$name(=the_name_of_the_variable)

and I want to know if $the_name_of_the_variable
is set.


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




[PHP] Help w/passing a search parameter that includes space and ,

2002-03-15 Thread Jack Sasportas

I have never passed a search value with a space or a comma , in it,
but here is the first time.
What happens is that IE puts in the space and takes the whole value as
the parameter and correctly finds the result we are looking for from the
search request, but in Netscape it only sees up to where there is a
space or where there is a comma.
Here is how the search value looks from the command line in the browser

display_products.php?search_value=Toilet Tissue,  2-Ply

Within the application it returns there is no match for Toilet which
basically tells me that php thinks that's the end of the string being
passed to it. 
Any ideas on how I should get around this ?

This is what the db search string looks like:

$db_result = mysql_query(select * from $db_tablename where
category='$value');


Thanks !
___
Jack Sasportas

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




Re: [PHP] SERVER INFO

2002-03-15 Thread bvr


Hi,

Yes, you have to be connected while someone looks at your site.
A webserver on a modem would be terribly slow, but possible if you just 
want to expiriment.

If you want to start 'quickly' without too much RTFM, find out what 
webservers are good and
have an installer package for your platform/distribution, sometimes 
these are even pre-compiled.

bvr.


Dani wrote:

Hi all,

I appologise if this is off topic but I don't know who to ask. I hope
you guys don't mind.

Does any body know where I can find information about the steps of
setting up a server(LINUX) so that people can find a certain URL
address?

I want to sent up a small server for myself from home with my machine
but I don't know how to make it so that the web pages that I put in
my
server accessable by other people around the world.

do I have to connect my modem into my phone line (online) all the
time
or...???

Does my question make any sense?




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




[PHP] Re: Help - Variables

2002-03-15 Thread Julio Nobrega Trabalhando

if (isset($var_name)) {
echo 'Isset!';
}

  ?

--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884


Budinschi Cosmin [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 Could smbdy please help me


 I have  a variable with the name
 $name(=the_name_of_the_variable)

 and I want to know if $the_name_of_the_variable
 is set.




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




Re: [PHP] Re: Help - Variables

2002-03-15 Thread BUDINSCHI Cosmin

On Fri, 15 Mar 2002, Julio Nobrega Trabalhando wrote:

:if (isset($var_name)) {
:echo 'Isset!';
:}
:
:  ?

This I knew ... i don't know the variable's name untill I execute 
the script.
I want to found out if a cookie is set who's name is $var1.$var2
and $var2 is the result of a function.
:
:
: I have  a variable with the name
: $name(=the_name_of_the_variable)
:
: and I want to know if $the_name_of_the_variable
: is set.
:


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




Re: [PHP] Targetted redirection?

2002-03-15 Thread Chris Boget

 ?php
 #   Turning this on will jump this page out of the frames.
 #   header('Window-target: _top');
 ?

Can you use this only for the predefined variables?  _top, 
_parent, etc?  Because it isn't working for me.  Perhaps I
am misunderstanding something.  Here are my sample files:

index.php

//
html
headtitleindex page/title/head
frameset COLS=120,*
FRAME SRC=left.php name=menu scrolling=no
frame src=left.php name=content
/frameset
/html
//

left.php

//
script language=php

  if( isset( $submit )) {
header( Window-target: content );
header( location: right.php );
exit();

  }

/script
html
headtitleleft page/title/head
body

form action=left.php method=post

input type=text name=test

input type=submit name=submit value=Submit

/form

/body
/html
//

right.php

//
html
headtitleright page/title/head
body

you got redirected here

/body
/html
//


Am I misunderstanding something?  Or doesn't that header work
this way?  

Thanks for any insight you might give!

Chris



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




Re: [PHP] Re: Help - Variables

2002-03-15 Thread bvr


isset($_COOKIE[$var1 . $var2])
isset($HTTP_COOKIE_VARS[$var1 . $var2])  // (for ancient PHP versions)

http://www.php.net/manual/en/features.cookies.php

or

isset(${$var1 . $var2})

http://www.php.net/manual/en/language.variables.variable.php

bvr.

BUDINSCHI Cosmin wrote:

On Fri, 15 Mar 2002, Julio Nobrega Trabalhando wrote:

:if (isset($var_name)) {
:echo 'Isset!';
:}
:
:  ?
   
   This I knew ... i don't know the variable's name untill I execute 
the script.
   I want to found out if a cookie is set who's name is $var1.$var2
and $var2 is the result of a function.
:
:
: I have  a variable with the name
: $name(=the_name_of_the_variable)
:
: and I want to know if $the_name_of_the_variable
: is set.
:






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




Re: [PHP] How to access arrays from $GLOBAL?

2002-03-15 Thread bvr



Maybe it makes sense to you like this:

$mtxt = $GLOBALS['mtxt'];

$mtxt === $GLOBALS['mtxt']
$mtxt[1] === $GLOBALS['mtxt'][1]

bvr.

 hmm.. the '===' operator, now that's weird ;)

Because in my mind (which I know is totally wrong in this instance, I'm just
explaining for your benefit) using:

$GLOBALS['mtxt'][1];

is like saying give me element 1 of the globals array when I was thinking
but I want element 1 of the mtxt array which is why I tried the various
combinations of mtxt[1] _inside_ of the globals[].

Hope that explains a little.




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




Re: [PHP] Re: Help - Variables

2002-03-15 Thread BUDINSCHI Cosmin

On Fri, 15 Mar 2002, bvr wrote:
:isset($_COOKIE[$var1 . $var2])
:isset($HTTP_COOKIE_VARS[$var1 . $var2])  // (for ancient PHP versions)
:
:http://www.php.net/manual/en/features.cookies.php
:
:or
:
:isset(${$var1 . $var2})
:
:http://www.php.net/manual/en/language.variables.variable.php
:
:bvr.
:

Thanks a lot . I'll try it and tell you the result


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




Re: [PHP] array within an array (one more reply)

2002-03-15 Thread bvr



Sorry, replies to really deep threads looks nice in my mail program..

;)bvr.


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




Re: [PHP] Targetted redirection?

2002-03-15 Thread Analysis Solutions

On Fri, Mar 15, 2002 at 11:27:59AM -0500, Brinkman, Theodore wrote:
 
 Given: My site is being brought up inside somebody else's (say
 about.com)frameset.  [We'll call this page about.html]
 Given: I want my main page (index.html) to break out of the frames in the
 about.html page.  
 
 Solution: My main page (index.html) should send header('Window-target:
 _Top');

That works for me.  I use my layout templating sytsem to send out that 
header on every page.


 So, if I use frames, and I want to keep my frameset page out of someone
 else's frame, I should send that header for my frameset page?

Hmm.  Under these circumstances, from the _minimal_ testing I just did
on this matter, it might not.  I'm guessing, that if their frameset has
already been established and one of their pages has a link which will
put your content into one of their existing frames, then, no, you won't
be able to hop out.

In this scenario, have the page check for the referrer and if it's 'da
basta'ds, have your script print out a hyperlink to your content rather
with a source=_blank in it.

Enjoy,

--Dan

-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y

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




Re: [PHP] Targetted redirection?

2002-03-15 Thread Analysis Solutions

On Fri, Mar 15, 2002 at 11:03:22AM -0600, Chris Boget wrote:

 script language=php
   if( isset( $submit )) {
 header( Window-target: content );
 header( location: right.php );
 exit();
   }
 /script

The script needs to be in between ?php and ? in order to execute 
on your server.  Browsers don't execute PHP.  What you've written is how 
Java'sCrap works.

Enjoy,

--Dan

-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y

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




Re: [PHP] Targetted redirection?

2002-03-15 Thread Chris Boget

  script language=php
if( isset( $submit )) {
  header( Window-target: content );
  header( location: right.php );
  exit();
}
  /script
 The script needs to be in between ?php and ? in order to execute 
 on your server.  Browsers don't execute PHP.  What you've written is how 
 Java'sCrap works.

Huh?  The file names are .php and the code is within PHP script tags so it
is running on the server.  The redirection is occuring, just that it's not going 
to the right frame.

script language=php/script

is the same as writing

?php ?

The latter is just shorthand.

Chris


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




Re: [PHP] SERVER INFO

2002-03-15 Thread Oliver Heinisch

At 16.03.2002  01:41, you wrote:

Hi all,

I appologise if this is off topic but I don't know who to ask. I hope
you guys don't mind.

Does any body know where I can find information about the steps of
setting up a server(LINUX) so that people can find a certain URL
address?

I want to sent up a small server for myself from home with my machine
but I don't know how to make it so that the web pages that I put in
my
server accessable by other people around the world.

do I have to connect my modem into my phone line (online) all the
time
or...???
It sounds, as you are a newbe. Setting up a linuxbox is one thing,
getting it in the internet is another.
Better way is to look for a provider (maybe free, or free  php)
to put the pages there. That´s cheaper then having the linuxbox be connected
to the internet via a phone-line. (mh.. what about an IP ?)
If you want to do PHP, set up a linux server as described in the link (see 
th other reply)
test your stuff locally and when you´re ready put them on the provider´s 
machine.
You´ll save a lot of money and time.
look in the archive for free php spaces.
HTH Oliver


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




Re: [PHP] Help w/passing a search parameter that includes space and ,

2002-03-15 Thread Jason Wong

On Saturday 16 March 2002 00:38, Jack Sasportas wrote:
 I have never passed a search value with a space or a comma , in it,
 but here is the first time.
 What happens is that IE puts in the space and takes the whole value as
 the parameter and correctly finds the result we are looking for from the
 search request, but in Netscape it only sees up to where there is a
 space or where there is a comma.
 Here is how the search value looks from the command line in the browser

 display_products.php?search_value=Toilet Tissue,  2-Ply

 Within the application it returns there is no match for Toilet which
 basically tells me that php thinks that's the end of the string being
 passed to it.
 Any ideas on how I should get around this ?

 This is what the db search string looks like:

 $db_result = mysql_query(select * from $db_tablename where
 category='$value');

Well the truth is that you're not supposed to send spaces via the URL. 

Use urlencode()  it's sibling, to make your parameters URL friendly.


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

/*
Two sure ways to tell a REALLY sexy man; the first is, he has a bad memory.
I forget the second.
*/

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




Re: [PHP] Targetted redirection?

2002-03-15 Thread Analysis Solutions

On Fri, Mar 15, 2002 at 12:25:10PM -0500, Analysis  Solutions wrote:
 On Fri, Mar 15, 2002 at 11:03:22AM -0600, Chris Boget wrote:
 
  script language=php
  /script
 
 The script needs to be in between ?php and ? in order to execute 
 on your server.  Browsers don't execute PHP.  What you've written is how 
 Java'sCrap works.

Wow.  Someone just pointed out I'm wrong, showing me the following link:
http://www.php.net/manual/en/language.basic-syntax.php#language.basic-syntax.p
+hpmode

Sorry about that!  When I started using PHP, I don't recall that being
the case.  Things change, eh?

--Dan

-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y

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




[PHP] Undefined Variable in IF...ELSE IF ...ELSE IF (NEWBIE ?)

2002-03-15 Thread Daniel Negron/KBE

I have error's enabled in php.ini.  I keep getting  Undefined variable when
I run a script that contains IF or ELSE IF's.  Is this normal because the
variable hasn't been set at the beginning of the script ?



Thank You



Daniel Negrón
Lotus Notes Administrator / Developer
KB Electronics, Inc.
954.346.4900x122
http://www.kbelectronics.com




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




Re: [PHP] SERVER INFO

2002-03-15 Thread Dave Goodrich

Dani, you have so much to learn. There are many issues to be considered 
when creating a webserver, but all are within your grasp. I suggest a 
trip to your local bookstore to get a copy of Running Linux. Read 
every page, every single page. Then you will know the answer to your 
question, and where to find more answers to the questions you will 
certainly have after reading the book.

You will need to know about filesystems, text editors (VIM Emacs Joe 
Jed), TCP/IP, DNS, PPP, web server configuration, security, users and 
groups, make, /usr/bin/sh, etc. The list of links I would supply you 
with for information about the steps of setting up a server(LINUX) so 
that people can find a certain URL address?  would quite large. I would 
also suggest locating a local user group in your area and join a newbies 
list for your Linux distribution (I've found these to be the best 
behaved and most informative lists on the internet).

Good luck, feel free to ask me anything you like off the list. I'll try 
to be as helpfull as I can.

DAve

Dani wrote:

 Hi all,
 
 I appologise if this is off topic but I don't know who to ask. I hope
 you guys don't mind.
 
 Does any body know where I can find information about the steps of
 setting up a server(LINUX) so that people can find a certain URL
 address?
 
 I want to sent up a small server for myself from home with my machine
 but I don't know how to make it so that the web pages that I put in
 my
 server accessable by other people around the world.
 
 do I have to connect my modem into my phone line (online) all the
 time
 or...???
 
 Does my question make any sense?
 
 any help is welcome.
 
 regards,
 Dani
 
 
 



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




[PHP] Variable Variables and Mulitdimensional Arrays

2002-03-15 Thread Charlie Killian

Hi. I want to be able to access a key in a multidimensional array at some
depth n without knowing before runtime what the keys are.

I thought this might be possible using variable variables. Here's some
sample code using variable variables and multidimensional arrays:
$y = 'a';
$z = 'b';
$t = 'c';
$x = array(a=array(b=array(c=TRUE)));

print_r($x{$y}{$z}{$t}); // Prints 1.


// I want to be able to concatenate the array indexes into one variable
variable. This would be done in a loop at runtime.
$u = ${$y.$z.$t};

print_r($x{$u}); // Doesn't work.

Any help would greatly be appreciated,

Charlie



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




[PHP] write to specific place in file

2002-03-15 Thread John P. Donaldson

How do I write to a specific place in a file instead
of just using fputs to append text to the end of the
file?

Thanks,
John

__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

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




Re: [PHP] write to specific place in file

2002-03-15 Thread Bas Jobsen

First read it, then split and then write it.

$fp=fopen($file,r);
$content=fread($fp,filesize($file));
fclose($file);
$parts=explode($splitsign,$content);
$fp=fopen($file,w);
fwrite($fp,$parts[0].$insert.$splitsign.$parts[1]);
fclose($file);


Op vrijdag 15 maart 2002 19:09, schreef John P. Donaldson:
 How do I write to a specific place in a file instead
 of just using fputs to append text to the end of the
 file?

 Thanks,
 John

 __
 Do You Yahoo!?
 Yahoo! Sports - live college hoops coverage
 http://sports.yahoo.com/

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




[PHP] Ayuda urgente!!!!

2002-03-15 Thread Raúl Hernández

Gracias amigos de la lista:
Necesito instalar el modulo php en solaris 6, pero con la configuracion del
manual que esta en la pagina me emite un error, alguien sabe o a tenido
experiencia instalando php sobre solaris...

Cordialmente,

Razl Hernandez S.




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


[PHP] FW: AW: agh - Compile w/php

2002-03-15 Thread Alex Black

hi all,

I received this from a guy at SAP regarding a SAPDB compile with php:
As you might have guessed, I am still unable to compile --with-sapdb

I've entered a bug report with all of the details:

http://bugs.php.net/bug.php?id=16100

If anyone has successfully compiled SAPDB with PHP on any machine, please
get in contact with me and tell me what you did :)

-alex

 Hi Alex
 
 I think, I've found the solution.
 
 Facts:
 - libsqlod is the driver
 - libsqlrte is some lib of our runtime env
 - libsqlrte is added to the libs in the configure file
 
 Therefore, php wants to link with -lsqlrte which is
 actually not necessary.
 
 Solution:
 
 - quick and dirty: cp libsqlod.so libsqlrte.so
 - edit php's ext/odbc/config.m4: delete the line
 AC_ADD_LIBRARY(sqlrte)
  in the sapdb section. Then autoconf, configure, make ...
 
 
 The problem is a remainder of the ancestor ADABAS.
 
 Please tell me, whether it now works for you.
 I will then inform the list about this.
 
 
 Greetings  Thomas
 
 
 --
 Dr. Thomas Kötter
 SAP DB, SAP Labs Berlin
 
 
 SAP DB is open source. Get it!www.sapdb.org
 
 
 
 

-- End of Forwarded Message


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




Re: [PHP] Populating Dropdown with MYSQL data

2002-03-15 Thread mnc

On Fri, 15 Mar 2002, Jeff Dale wrote:
 I want to have a dropdown list populated with data from my MySql server.
 
 Any examples or websites that could help is appreciated.

function outputSingleSelect()
// $name = name to give the HTML form element.
// $query = MySQL query. Should return 2 columns. First column
//is the key, second is the label.
// $default = key of item to be preselected, if any.
// $labelchoice = instructional item (like - Select a city -) to
//place at the top of the list
{
global $DEBUG;
list ($name, $query, $default, $labelchoice) = func_get_args();
if (!$query) return;
if ($DEBUG) print brCalling outputSingleSelect with $query;
$st = mysql_query($query);
if (mysql_errno()) return;
$select = select name=\$name\;
if ($labelchoice)
{
$select .= 'option value=**';
if (!$default) { $select .= ' selected'; }
$select .= $labelchoice;
}
while ($row = mysql_fetch_row($st))
{
$select .= 'option value=' . $row[0] . '';
if ($default == $row[0]) { $select .= ' selected'; }
$select .= '' . $row[1];
}
$select .= '/select';
return (mysql_num_rows($st)) ? $select : '';
}



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




[PHP] Re: Help Out A Newbie In Configuring PHP.INI

2002-03-15 Thread Dr. Shim

Uh oh, did I ask this question before? If I did, I'm very sorry. =(

David Robley [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] says...
 Note that I'm using the Windows version of PHP.

 Whenever I use a mail() function in my PHP code I get an error of Failed
to
 Connect on line number. So, I'm guessing my error lies in the PHP
 configuration file. I searched around the PHP.INI file for anything
 resembililing mail. I found these two lines:


 [mail function]
 ; For Win32 only.
 SMTP = alienmelon.com

 ; For Win32 only.
 sendmail_from = [EMAIL PROTECTED]


 I filled them out also, as you see above. Did I fill them out correctly?
 Even though I filled them out as you see above I still get the same error.
 Is the root of the error in the .ini at all?

I have feeling of deja vu here. Is alienmelon.com a valid mail server? If
not, you need to change it to something that is.

--
David Robley
Temporary Kiwi!

Quod subigo farinam



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




[PHP] Passing parameters

2002-03-15 Thread Morten Nielsen

Hi,

I have a php file where a make a lookup in a data base. I store the result
in a variable call $qid.
I then have an include statement of another file where I need the data from
$qid. Can anybody tell me how I get the data.

Thanks,
Morten



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




Re: [PHP] Passing parameters

2002-03-15 Thread mnc

On Fri, 15 Mar 2002, Morten Nielsen wrote:
 I have a php file where a make a lookup in a data base. I store the result
 in a variable call $qid.
 I then have an include statement of another file where I need the data from
 $qid. Can anybody tell me how I get the data.

If it was in the global context in the first file, it will likewise be 
available in the global context in the second file. Just pretend it's one 
big PHP file.

If the variable was local to a function, you have to either make it global 
in scope, or pass it in and out of the function(s).

miguel


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




[PHP] Re: Undefined Variable in IF...ELSE IF ...ELSE IF (NEWBIE ?)

2002-03-15 Thread Charlie Killian

I have error's enabled in php.ini.  I keep getting  Undefined variable when
I run a script that contains IF or ELSE IF's.  Is this normal because the
variable hasn't been set at the beginning of the script ?

Yes. If the variable hasn't been defined previously you'll get a warning:

if ( $dd  2) true;

Will warn unless $dd is initialized prior to the if().

Charlie



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




RE: [PHP] Targetted redirection?

2002-03-15 Thread Robert V. Zwink

Here's a nice link to Netscape.com describing the basics of frames:
http://www.netscape.com/eng/mozilla/2.0/relnotes/demo/target.html

You can find the predefined variables for use in frames listed, along with a
quick reference to the optional HTTP header that can be specified.

For your particular question though I would consider targeting the action of
the FROM tag:

FORM ACTION=top.php TARGET=_parent

This will essentially cover over the frame.  Hope this helps.

Robert Zwink
http://www.zwink.net/daid.php


-Original Message-
From: Analysis  Solutions [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 12:50 PM
To: PHP List
Subject: Re: [PHP] Targetted redirection?


On Fri, Mar 15, 2002 at 12:25:10PM -0500, Analysis  Solutions wrote:
 On Fri, Mar 15, 2002 at 11:03:22AM -0600, Chris Boget wrote:

  DEFANGED_script language=php
  /script

 The script needs to be in between ?php and ? in order to execute
 on your server.  Browsers don't execute PHP.  What you've written is how
 Java'sCrap works.

Wow.  Someone just pointed out I'm wrong, showing me the following link:
http://www.php.net/manual/en/language.basic-syntax.php#language.basic-syntax
.p
+hpmode

Sorry about that!  When I started using PHP, I don't recall that being
the case.  Things change, eh?

--Dan

--
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y

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


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




[PHP] PHP and Java Servlets

2002-03-15 Thread Richard Fox

I have to build a bridge page from my PHP script that does the following:

1. Kick off a Java servlet (in my case running on my Tomcat4 plug-in to
Apache)
2. Receive data back from that servlet and continue my PHP script.

Does anyone have hard won advice, tips on great articles, examples, etc?

TIA,

Rich




[PHP] Ayuda instalando php

2002-03-15 Thread Raúl Hernández

Auxilio
necesito ayuda instalando PHP, me saca el siguiente error.

# make
gcc -g -O2 -DEAPI -DMOD_PERL -DUSE_EXPAT -O -O2 -G -Kpic  -I. -I.
-I/usr/apache/include 
-c language-parser.tab.c -o language-parser.tab.o
gcc: unrecognized option 
`-Kpic'
/usr/ccs/bin/as: /var/tmp/ccCSARvP.s, 
line 26048: error: unknown opcode .subsection
/usr/ccs/bin/as: /var/tmp/ccCSARvP.s, 
line 26048: error: statement syntax
/usr/ccs/bin/as: /var/tmp/ccCSARvP.s, 
line 26343: error: unknown opcode .previous
/usr/ccs/bin/as: /var/tmp/ccCSARvP.s, 
line 26343: error: statement syntax
make: *** [language-parser.tab.o] Error 1

Gracias,

Raúl Hernández S



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


[PHP] converting html entities outside of tags

2002-03-15 Thread Alain Dresse

Hi,

I want to allow the users of my site to insert text with anchors, bold and
italic html tags. I have filtered out all the other tags. I now want to
convert the other , , quote, double quote and  to html entities. If I use
the function htmlspecialchars, it of course also quotes the valid anchors.

For instance, I would like the following

This is a a href=http://www.domain.com;string with quotes and other
 signs /a

to be converted to

This is a a href=http://www.domain.com;string with quot;quotesquot;
and other lt; signs /a

and not

This is a lt;a href=quot;http://www.domain.comquot;gt;string with
quot;quotesquot; and other lt; signs lt;/agt;

Can anybody help ?

Thanks,
Alain Dresse
[EMAIL PROTECTED]



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




Re: [PHP] Targetted redirection?

2002-03-15 Thread Chris Boget

 Here's a nice link to Netscape.com describing the basics of frames:
 http://www.netscape.com/eng/mozilla/2.0/relnotes/demo/target.html

Ok, I'll have to check it out.
 
 For your particular question though I would consider targeting the action of
 the FROM tag:
 FORM ACTION=top.php TARGET=_parent
 This will essentially cover over the frame.  Hope this helps.

Indeed.  However, the reason why I have the target as, essentially, $PHP_SELF
is so I can validate the form before going on to the next page.  If I want to do that,
the page has to stay in the current frame until everything checks out.

Chris


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




Re: [PHP] Re: Undefined Variable in IF...ELSE IF ...ELSE IF (NEWBIE?)

2002-03-15 Thread mnc

On Fri, 15 Mar 2002, Daniel Negron/KBE wrote:
 Thank You Charlie.  I also found out that I needed to put an  symbol
 infrom of the string.  This stopped it from throwing me an error.
 
 If($submit) blah blah blah

Better yet, use:

   if (isset($submit)) blah blah blah

That explicitly checks to see whether the variable has been defined 
previously in the run, which makes your code easier to understand and 
avoids the klugey .

miguel


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




Re: [PHP] multiple variables

2002-03-15 Thread mnc

On Fri, 15 Mar 2002, Ralph Jarvis wrote:
 An obvious question for some, but I am stumped:
 I want to use multiple optins in an if statement...
if(user($arbitraryVariable)==(1 or 2 or 3 or 4))
 What would be the proper syntax for this?

Sometimes I find a switch to be the most efficient (and least typing) 
approach:

  switch(user($arbitraryVariable))
  {
  case 1:
  case 2:
  case 3:
  case 4:
 do whatever
 break;
  default:
 do the other thing
  }

miguel




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




RE: [PHP] Re: Undefined Variable in IF...ELSE IF ...ELSE IF (NEWBIE ?)

2002-03-15 Thread Dave

I have been sloppy in teh past and just used

if($submit) blah blah blah

not sure of ramifications, but seems to work unless $submit is false or not
set.

again, take with grain of salt,  other suggestions (especially isset) are much
more certain.

Dave

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 3:46 PM
To: Daniel Negron/KBE
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Undefined Variable in IF...ELSE IF ...ELSE IF
(NEWBIE ?)


On Fri, 15 Mar 2002, Daniel Negron/KBE wrote:
 Thank You Charlie.  I also found out that I needed to put an @ symbol
 infrom of the string.  This stopped it from throwing me an error.

 If(@$submit) blah blah blah

Better yet, use:

   if (isset($submit)) blah blah blah

That explicitly checks to see whether the variable has been defined
previously in the run, which makes your code easier to understand and
avoids the klugey @.

miguel


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





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




[PHP] okok

2002-03-15 Thread Raúl Hernández

GRacias lo vo a compilar y les cuento si me funciona



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


[PHP] Mulitple ini files?

2002-03-15 Thread charlesk

I want to make use of the doc_root settings in the ini file.  But I don't want ot have 
links on my sites like
on one site
href=/site1/document.php
and on another site
href=/site2/document.php

Is there some way to have different doc_roots based on the domain name or per IIS site?

Charles Killmer
IIS 5.0 Windows 2000 Server PHP 4.1.2

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




Re: [PHP] Mulitple ini files?

2002-03-15 Thread charlesk

I have many sites and all are virtual hosts.  I would like IIS to specify the home 
directory, for html, gifs, jpgs... and all of the php files to be somewhere else in 
the filesystem, specified by the php.ini.  

Charles

-- Original Message --
From: [EMAIL PROTECTED]
Date: Fri, 15 Mar 2002 15:38:17 -0600 (CST)

This is an IIS configuration issue. IIS is a horrible program to try to 
configure (look into getting Apache, which has flexible, powerful and 
well-documented configuration), but in a nutshell you need to look up how 
to create virtual hosts. Each one can have its own root.

miguel

On Fri, 15 Mar 2002, charlesk  wrote:

 I want to make use of the doc_root settings in the ini file.  But I don't want ot 
have links on my sites like
 on one site
 href=/site1/document.php
 and on another site
 href=/site2/document.php
 
 Is there some way to have different doc_roots based on the domain name or per IIS 
site?
 
 Charles Killmer
 IIS 5.0 Windows 2000 Server PHP 4.1.2
 
 



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




[PHP] Changing 2 frames ...

2002-03-15 Thread Marcel Besancon

Hi everybody,

is it possible to change two frames at one time using a php-script. For
example: When I click on a link then the right _and _ the left frame should
change to another side. Ist this possible or do I have to use JavaScript
instead ???

Any answer can be useful

Bye, Marcel

--
registered Fli4l-User #0388



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




[PHP] shell_exec()

2002-03-15 Thread Carlos Fernando Scheidecker Antunes

Hello all,

Does anyone know if shell_exec waits to have whatever it was passed to 
be executed before returning to the script?

I am asking that because I need to write a script to compact files to a 
zip and then have it e-mailed to a predefined address.

The files it will compact might have a considerable size and since this 
script will be triggered by a web page I wonder if shell_exec would be 
executed as a separate thread or if it will be the same one.

For me, the ideal thing was to have it wait for the command to be over.

Any suggestions?

Thank you,

Carlos Fernando.


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




Re: [PHP] Populating Dropdown with MYSQL data

2002-03-15 Thread Daniel Negron/KBE


also found this.  http://www.thickbook.com/extra/tb_loopoption.pdf




|+
||  [EMAIL PROTECTED] |
|||
||  03/15/02 02:39|
||  PM|
|||
|+
  
-|
  |
 |
  |  To: Jeff Dale [EMAIL PROTECTED]  
 |
  |  cc: [EMAIL PROTECTED] 
 |
  |  Subject: Re: [PHP] Populating Dropdown with MYSQL data
 |
  
-|




On Fri, 15 Mar 2002, Jeff Dale wrote:
 I want to have a dropdown list populated with data from my MySql server.

 Any examples or websites that could help is appreciated.

function outputSingleSelect()
// $name = name to give the HTML form element.
// $query = MySQL query. Should return 2 columns. First column
//is the key, second is the label.
// $default = key of item to be preselected, if any.
// $labelchoice = instructional item (like - Select a city -) to
//place at the top of the list
{
global $DEBUG;
list ($name, $query, $default, $labelchoice) = func_get_args();
if (!$query) return;
if ($DEBUG) print brCalling outputSingleSelect with $query;
$st = mysql_query($query);
   if (mysql_errno()) return;
$select = select name=\$name\;
if ($labelchoice)
{
$select .= 'option value=**';
if (!$default) { $select .= ' selected'; }
$select .= $labelchoice;
}
while ($row = mysql_fetch_row($st))
{
$select .= 'option value=' . $row[0] . '';
if ($default == $row[0]) { $select .= ' selected'; }
$select .= '' . $row[1];
}
$select .= '/select';
return (mysql_num_rows($st)) ? $select : '';
}



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






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




Re: [PHP] Changing 2 frames ...

2002-03-15 Thread Justin French

To do it with PHP, you'd have to refresh the entire frameset, with some
vars in the URL to load certain pages into the frameset.  Yuk.

The other solution is Javascript, but of course not everyone will have
it, so I wouldn't rely on it for anything mission critical like
navigation of the entire site.

The question I usualy ask myself on stuff which relys heavily on
Javascript is Do I *really* need this?


Good luck,

Justin French



Marcel Besancon wrote:
 
 Hi everybody,
 
 is it possible to change two frames at one time using a php-script. For
 example: When I click on a link then the right _and _ the left frame should
 change to another side. Ist this possible or do I have to use JavaScript
 instead ???
 
 Any answer can be useful
 
 Bye, Marcel
 
 --
 registered Fli4l-User #0388
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

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




[PHP] Driving me nuts, need one second of your time

2002-03-15 Thread cosmin laslau

?
$query = SELECT * from mytable;
$result = mysql_db_query(db, $query);

while ($myarray = mysql_fetch_array($result))
{
$title = $myarray[title];
echo $titlebr;
}
?

Can someone PLEASE tell me why the coding above gives the following error:


Warning: Supplied argument is not a valid MySQL result resource in 
/var/web/somesite.com/html/index.php on line 5


It's absurd. It's driving me nuts. I'm about to introduce my computer to the 
pavement 40 feet below.

Thanks in advance for whoever sees what I am sure is a glaring and obvious 
flaw in the coding. I've been looking at it for an hours and just can't get 
anything from where I'm standing, maybe a different perpective will help.



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


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




RE: [PHP] Driving me nuts, need one second of your time

2002-03-15 Thread Darren Gamble

Good day,

You get this message because the mysql_db_query statement failed, and that
your code didn't check to see that it did or not before proceeding to the
next statement.

And, this statement fails because you have not even connected to the
database yet.

At the risk of sounding condescending, I would request that you look at
PHP's documentation on how to use the MySQL wrapper functions (
http://www.php.net/manual/en/ref.mysql.php ).  There you can find good
documentation and a number of useful examples (the two best things a coder
could ask for).

Your error message is also in PHPs FAQ list.
http://www.php.net/manual/en/faq.databases.php .

Hope this helps,


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


-Original Message-
From: cosmin laslau [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 4:14 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Driving me nuts, need one second of your time


?
$query = SELECT * from mytable;
$result = mysql_db_query(db, $query);

while ($myarray = mysql_fetch_array($result))
{
$title = $myarray[title];
echo $titlebr;
}
?

Can someone PLEASE tell me why the coding above gives the following error:


Warning: Supplied argument is not a valid MySQL result resource in 
/var/web/somesite.com/html/index.php on line 5


It's absurd. It's driving me nuts. I'm about to introduce my computer to the

pavement 40 feet below.

Thanks in advance for whoever sees what I am sure is a glaring and obvious 
flaw in the coding. I've been looking at it for an hours and just can't get 
anything from where I'm standing, maybe a different perpective will help.



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


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

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




Re: [PHP] Driving me nuts, need one second of your time

2002-03-15 Thread Steve Cayford

It looks like your sql query failed, so the result is invalid.

Assuming that this is really the whole script, then you're counting on 
the mysql_db_query function to open a connection to the database db 
using the default connection values which (according to the manual) are 
host: localhost, user: (whatever user is running the script, probably 
'www', 'apache', or 'nobody' depending on your system), and password: 
(blank). Do you really have your mysql database setup to allow access 
with these defaults?

I'd recommend trying mysql_connect() first, then if that works continue 
on to the mysql_query(). At least you'll know better which aspect failed.

-Steve

On Friday, March 15, 2002, at 05:14  PM, cosmin laslau wrote:

 ?
 $query = SELECT * from mytable;
 $result = mysql_db_query(db, $query);

 while ($myarray = mysql_fetch_array($result))
 {
 $title = $myarray[title];
 echo $titlebr;
 }
 ?

 Can someone PLEASE tell me why the coding above gives the following 
 error:


 Warning: Supplied argument is not a valid MySQL result resource in 
 /var/web/somesite.com/html/index.php on line 5


 It's absurd. It's driving me nuts. I'm about to introduce my computer 
 to the pavement 40 feet below.

 Thanks in advance for whoever sees what I am sure is a glaring and 
 obvious flaw in the coding. I've been looking at it for an hours and 
 just can't get anything from where I'm standing, maybe a different 
 perpective will help.



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


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



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




Re: [PHP] XSLT parsing causes passed by reference error

2002-03-15 Thread Edward Tanguay

Hello Erik,

I have this hosted at my ISP. The phpinfo() shows that they have:

Linux 2.4.3
PHP Version 4.0.4pl1
Sablotron XSLT support: enabled

Which annotations are you refering to?

The odd thing is that I have copied the code from two different examples
from the web and both give me this same only variables can be passed by
reference error.  My ISP says that Sablotron is installed correctly but
doesn't know why I am getting this error.

I cannot find any reference to this error and Sablotron at www.deja.com or
elsewhere on the net. Am I the only one that is getting this error?

I can't wait to get this going. Thanks for the help.

Edward
www.tanguay.info


Erik Price [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 On Wednesday, March 13, 2002, at 06:13  PM, Edward Tanguay wrote:

  Fatal error: Only variables can be passed by reference in
  /home/tanguay/test/testxslt.php on line 7
 
  when I run this code:
 
  ?php
 
  // Allocate a new XSLT processor
  $xh = xslt_create();
 
  // Process the document, returning the result into the $result variable
  $result = xslt_process($xh, 'content.xml', 'website.xsl');
 

 I was curious about this, since I just recompiled with XSLT and
 Sablotron support myself.  I read through the annotated manual page for
 xslt_process().  Have you checked it out?  It appears that this
 extension is still fairly experimental, so the way that the program
 behaves may differ depending on which version you're running.

 Which version of PHP are you using, for which OS?  Did you compile using
 the --enable-xslt and --with-xslt-sablot configure parameters?  Try some
 of the workarounds suggested in those annotations, specifically the one
 which suggests that xslt_process() doesn't like NULL arguments.  It'll
 be ugly, but perhaps you can use implode() to read those files into a
 string, and get it to work by passing string references rather than
 filenames.  If you really want to use filenames, try using an absolute
 path, try using ./ before the file names (assuming those files are in
 the same directory as the script itself).  Finally, consider passing a
 joke array as the 5th and 6th arguments to the function.  It may be that
 in your particular build you need to use workarounds.

 Be sure to post the results of your experimentation for the benefit of
 the rest of us.




 

 Erik Price
 Web Developer Temp
 Media Lab, H.H. Brown
 [EMAIL PROTECTED]




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




[PHP] new_xmldoc won't work?

2002-03-15 Thread Edward Tanguay

Can anyone shed light on why this code doesn't work?
I get: fatal error: Call to undefined function: new_xmldoc() in
/home/tanguay/test/testsab2.php on line 4

?
xslt_output_begintransform('tst.xsl');

$doc = new_xmldoc('1.0');
$root = $doc-ad_root('sites');
$site = $root-ne_child('site','');
$site-new_child('title','PHP.net');
$site-new_child('url','http://www.php.net');
$site-new_child('description','The homepge of PHP');
$site-new_child('keywords','MySQL, PHP');

print $doc-dumpmem();

xslt_output_endtransform();
?

Where can I get new_xmldoc()?

Thanks,
Edward



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




[PHP] Using Switch to control form action . .

2002-03-15 Thread Andre Dubuc

I'd like to control which php file is called when clicking two buttons on the 
bottom of a form; one called Add Names, the other Submit

I've tried the following with no success:

***
form action=
switch ($name) {
case add:
rap.php method get;
break;
case submit:
rap2.php method get;
break;
}

. . .

input type=submit name=add value=Add Names
input type=submit name=submit value=Submit
/form

**

I'm still a newbie, and this is the first time I've tried to use a switch 
statement. I've probably performed an illegal operation by splitting the 
form action . . statement. Is there any other way of accomplishing a change 
of action? This seems so clumsy -- and also, since the clicking occurs only 
after all info is entered, does the info actually get stored anywhere prior 
to clicking or pressing Enter? 

Btw, I've also tried putting this switch statement after the input ... 
code, and also tried if statements. It usually defaults to whatever is 
loaded, and doesn't respond to the if or switch statements.

I'd appreciate any help on this -- or pointers where to look.

Tia,
Andre


-- 
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the suffering souls in Purgatory.

May God bless you abundantly in His love!

For a free Cenacle Scriptural Rosary Booklet -- http://www.webhart.net/csrb/


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




Re: [PHP] Using Switch to control form action . .

2002-03-15 Thread mnc

On Fri, 15 Mar 2002, Andre Dubuc wrote:
 I'd like to control which php file is called when clicking two buttons on the 
 bottom of a form; one called Add Names, the other Submit
 
 I've tried the following with no success:
 
 ***
 form action=
   switch ($name) {
   case add:
   rap.php method get;
   break;
   case submit:
   rap2.php method get;
   break;
 }
 
 . . .
 
 input type=submit name=add value=Add Names
 input type=submit name=submit value=Submit
 /form
 
 **
 
 I'm still a newbie, and this is the first time I've tried to use a switch 
 statement. I've probably performed an illegal operation by splitting the 
 form action . . statement.

Yup, you're not switching between HTML and PHP properly. Whenever you 
switch between literal HTML code (which is processed by the browser at 
the end of the transmission) and PHP code (which is processed by the 
server before the transmission), you need to indicate this to the server.

Try this:

  form action=?
  switch ($name)
  {
  case add:
?rap.php?
break;
  case submit:
?rap2.php?
break;
  }
  ? method=getinput type=submit name=add value=Add Names
  input type=submit name=submit value=Submit
  /form

Notice that all the PHP code is enclosed between ? and ?. I switched
back and forth liberally (normally, for the sake of readability, I'd
probably do print 'rap.php;' instead of ?rap.php?) so you could see
how it's possible to switch more or less at any moment.

miguel


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




Re: [PHP] Using Switch to control form action . .

2002-03-15 Thread Justin French

I haven't had any experience with switch at all, but I do have forms
with multiple submit buttons.

I've been running things slightly differently:

FORM action=rap.php method=post
  ...
  input type=submit name=submit value=Add Names
  input type=submit name=submit value=Submit
/FORM


Then rap.php has a basic if statement:

?
if($submit == Add names)
  {
  ... do this ...
  }
elseif($submit == Submit)
  {
  ... do this ...
  }
else
  {
  ... they didn't click a button, maybe pressed enter, so there's no
submit value ...
  }
?


Otherwise, the code you have below seems to be missing some ? ?'s
around the PHP, but it might be psuedo code.


Good luck,

Justin French



Andre Dubuc wrote:
 
 I'd like to control which php file is called when clicking two buttons on the
 bottom of a form; one called Add Names, the other Submit
 
 I've tried the following with no success:
 
 ***
 form action=
 switch ($name) {
 case add:
 rap.php method get;
 break;
 case submit:
 rap2.php method get;
 break;
 }
 
 . . .
 
 input type=submit name=add value=Add Names
 input type=submit name=submit value=Submit
 /form
 
 **
 
 I'm still a newbie, and this is the first time I've tried to use a switch
 statement. I've probably performed an illegal operation by splitting the
 form action . . statement. Is there any other way of accomplishing a change
 of action? This seems so clumsy -- and also, since the clicking occurs only
 after all info is entered, does the info actually get stored anywhere prior
 to clicking or pressing Enter?
 
 Btw, I've also tried putting this switch statement after the input ...
 code, and also tried if statements. It usually defaults to whatever is
 loaded, and doesn't respond to the if or switch statements.
 
 I'd appreciate any help on this -- or pointers where to look.
 
 Tia,
 Andre
 
 --
 Please pray the Holy Rosary to end the holocaust of abortion.
 Remember in your prayers the suffering souls in Purgatory.
 
 May God bless you abundantly in His love!
 
 For a free Cenacle Scriptural Rosary Booklet -- http://www.webhart.net/csrb/
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

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




Re: [PHP] Mulitple ini files?

2002-03-15 Thread Michael Sims

At 03:59 PM 3/15/2002 -0600, charlesk wrote:
I have many sites and all are virtual hosts.  I would like IIS to specify 
the home directory, for html, gifs, jpgs... and all of the php files to be 
somewhere else in the filesystem, specified by the php.ini.

There is a thread archived on Google that addresses this. See:

http://groups.google.com/groups?selm=3C30AE25.76855132%40caraveo.comoe=ISO-8859-1

Watch out for line wrapping in the link above...

I've used this method to setup different php_include directories on a 
per-virtual server basis.

HTH...


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




[PHP] Issues displaying data from database organizing by category

2002-03-15 Thread Jim

I'm new to PHP so bare with me please.  I'm collect data fine from mySQL
into an accociative array. I can display it fine.  Here's the issue:

** Looks like this:
GALLERY 1
  Item Name Item Desc
GALLERY 2
  Item Name Item Desc
GALLERY 2
  Item Name Item Desc
GALLERY 3
  Item Name Item Desc

** Should look like this
GALLERY 1
  Item Name Item Desc
GALLERY 2
  Item Name Item Desc
  Item Name Item Desc
GALLERY 3
  Item Name Item Desc

I have 2 tables: tblGalleries and tblItems. tblItems has a column
(itmGalley_ID) that corresponds to the gallery it belongs to in
tblGalleries (galID).  I've got my SQL set right (I've tested with mysql
command line).  But I can't get it to display the Gallery (galName),
every item within that gallery, and the next Gallery name going down
with its items and so on.

I've tweaked the while statement, tried foreach loops, reorganizng that
arrys but to no avail.

Bit of my code:

?php
while ($row = mysql_fetch_assoc($result)) {
? 
  TR
TD
H1?php echo{$row['galName']} ?/H1
/TD
TD/TD
TD/TD
  /TR
  TR
TD width=100UItem Name/U/TD
TD width=200UItem Desc/U/TD
  /TR
  TR
TD width=100?php echo{$row['itmItem_Name']}?/TD
TD width=200?php echo{$row['itmItem_Desc']}?/TD
TD/TD
  /TR
?php 
}
?

Simple issue I'm sure but frustrating..Thanks for the help..


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




Re: [PHP] Issues displaying data from database organizing bycategory

2002-03-15 Thread mnc

On 15 Mar 2002, Jim wrote:
 ** Should look like this
 GALLERY 1
   Item Name Item Desc
 GALLERY 2
   Item Name Item Desc
   Item Name Item Desc
 GALLERY 3
   Item Name Item Desc
 
 I have 2 tables: tblGalleries and tblItems. tblItems has a column
 (itmGalley_ID) that corresponds to the gallery it belongs to in
 tblGalleries (galID).  I've got my SQL set right (I've tested with mysql
 command line).  But I can't get it to display the Gallery (galName),
 every item within that gallery, and the next Gallery name going down
 with its items and so on.
 
 I've tweaked the while statement, tried foreach loops, reorganizng that
 arrys but to no avail.
 
 Bit of my code:
 
   ?php
   while ($row = mysql_fetch_assoc($result)) {
   ? 
   TR
 TD
 H1?php echo{$row['galName']} ?/H1
 /TD
 TD/TD
 TD/TD
   /TR
   TR
 TD width=100UItem Name/U/TD
 TD width=200UItem Desc/U/TD
   /TR
   TR
 TD width=100?php echo{$row['itmItem_Name']}?/TD
 TD width=200?php echo{$row['itmItem_Desc']}?/TD
 TD/TD
   /TR
 ?php 
 }
 ?

Think carefully about what you're trying to do.

  ?

  $last_galname = '';
  while ($row = mysql_fetch_assoc($result))
  {
if ($row['galname'] != $last_galname')
  print trtd colspan=\2\h1{$row['galname']}/h1/td/tr\n;
$last_galname = $row['galname'];
print trtd width=\100\{$row['itmItem_Name']}/td
  td width=\200\{$row['itmItem_Desc']}/td/tr\n;
  }

  ?

Just keep track of the header, and only display it when it changes from 
the previous iteration.

miguel


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




[PHP] Weird?

2002-03-15 Thread jtjohnston

Does anyone have time to run this code?
This is definitely weird. Either a Windows or a code problem. If I set:

$to_path = c:\\ccl_www\\.$date.ccl_www\\;

to:

$to_path = c:\\ccl_www\\.$date.\\ccl_www\\;
(I add \\)

It fails to create c:\ccl_www\20020315\ccl_www, but otherwise will
create c:\ccl_www\20020315ccl_www

I've tried debugging this thing backwards, but have not found my
problem.

If for example, I tried creating manually:

c:\ccl_www

thinking it was a root thing. It worked, then it didn't.

:x( John
P.S. By the by, I tried this on a Unix box, and thought it worked, but
then it didn't when I went back to it this morning. I'm confused!


snip
$date = date (MD);
###
###  Don't forget trailing slash  #
###
$from_path = c:\\program files\\easyphp\\ccl_www\\;
$to_path = c:\\ccl_www\\.$date.ccl_www\\;
###

if(!is_dir($from_path))
{
echo failed;
exit;
}else{
rec_copy($from_path, $to_path);
echo files copies from $from_path and backed up to $to_path;
}

#

function rec_copy ($from_path, $to_path) {
if(!is_dir($to_path))
mkdir($to_path, 0777);

$this_path = getcwd();
 if (is_dir($from_path))
 {
chdir($from_path);
$handle=opendir('.');

while (($file = readdir($handle))!==false)
{
 if (($file != .)  ($file != ..)) {
  if (is_dir($file))
  {
  rec_copy ($from_path.$file./,  $to_path.$file./);
   chdir($from_path);
  }else{
#  echo error if (is_dir($file))br;
  }
  if (is_file($file))
  {
  copy($from_path.$file, $to_path.$file);
  }else{
#  echo error copy($from_path.$file, $to_path.$file)br;
  }
 }#end (($file != .)
}#end while (($file

closedir($handle);
 }# end if (is_dir
 else{
# echo if (is_dir($from_path))br;
 }
}# end function




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




Re: [PHP] Using Switch to control form action . .

2002-03-15 Thread Andre Dubuc

Thanks Miguel,

I sort of figured I wasn't doing something right. Thanks for setting me 
straight on switching between html and php. Sort of basic, but I didn't know 
whether I needed to do that everytime.

Sorry for the delay in replying -- just as I received your message, we had 
company over.

Regards,
Andre


On Friday 15 March 2002 19:41, you wrote:
 On Fri, 15 Mar 2002, Andre Dubuc wrote:
  I'd like to control which php file is called when clicking two buttons on
  the bottom of a form; one called Add Names, the other Submit
 
  I've tried the following with no success:
 
  ***
  form action=
  switch ($name) {
  case add:
  rap.php method get;
  break;
  case submit:
  rap2.php method get;
  break;
  }
 
  . . .
 
  input type=submit name=add value=Add Names
  input type=submit name=submit value=Submit
  /form
 
  **
 
  I'm still a newbie, and this is the first time I've tried to use a switch
  statement. I've probably performed an illegal operation by splitting the
  form action . . statement.

 Yup, you're not switching between HTML and PHP properly. Whenever you
 switch between literal HTML code (which is processed by the browser at
 the end of the transmission) and PHP code (which is processed by the
 server before the transmission), you need to indicate this to the server.

 Try this:

   form action=?
   switch ($name)
   {
   case add:
 ?rap.php?
 break;
   case submit:
 ?rap2.php?
 break;
   }
   ? method=getinput type=submit name=add value=Add Names
   input type=submit name=submit value=Submit
   /form

 Notice that all the PHP code is enclosed between ? and ?. I switched
 back and forth liberally (normally, for the sake of readability, I'd
 probably do print 'rap.php;' instead of ?rap.php?) so you could see
 how it's possible to switch more or less at any moment.

 miguel

-- 
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the suffering souls in Purgatory.

May God bless you abundantly in His love!

For a free Cenacle Scriptural Rosary Booklet -- http://www.webhart.net/csrb/

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




Re: [PHP] Using Switch to control form action . .

2002-03-15 Thread Andre Dubuc

Thanks Justin,

It wasn't pseudo code -- I just didn't know what I was doing! :

I didn't know I had to brace php code with ?php . . . ?.
I like your method as well -- I'll give it a try.
Thanks for replying,

Regards, 
Andre


On Friday 15 March 2002 19:58, you wrote:
 I haven't had any experience with switch at all, but I do have forms
 with multiple submit buttons.

 I've been running things slightly differently:

 FORM action=rap.php method=post
   ...
   input type=submit name=submit value=Add Names
   input type=submit name=submit value=Submit
 /FORM


 Then rap.php has a basic if statement:

 ?
 if($submit == Add names)
   {
   ... do this ...
   }
 elseif($submit == Submit)
   {
   ... do this ...
   }
 else
   {
   ... they didn't click a button, maybe pressed enter, so there's no
 submit value ...
   }
 ?


 Otherwise, the code you have below seems to be missing some ? ?'s
 around the PHP, but it might be psuedo code.


 Good luck,

 Justin French

 Andre Dubuc wrote:
  I'd like to control which php file is called when clicking two buttons on
  the bottom of a form; one called Add Names, the other Submit
 
  I've tried the following with no success:
 
  ***
  form action=
  switch ($name) {
  case add:
  rap.php method get;
  break;
  case submit:
  rap2.php method get;
  break;
  }
 
  . . .
 
  input type=submit name=add value=Add Names
  input type=submit name=submit value=Submit
  /form
 
  **
 
  I'm still a newbie, and this is the first time I've tried to use a switch
  statement. I've probably performed an illegal operation by splitting the
  form action . . statement. Is there any other way of accomplishing a
  change of action? This seems so clumsy -- and also, since the clicking
  occurs only after all info is entered, does the info actually get stored
  anywhere prior to clicking or pressing Enter?
 
  Btw, I've also tried putting this switch statement after the input ...
  code, and also tried if statements. It usually defaults to whatever is
  loaded, and doesn't respond to the if or switch statements.
 
  I'd appreciate any help on this -- or pointers where to look.
 
  Tia,
  Andre
 
  --
  Please pray the Holy Rosary to end the holocaust of abortion.
  Remember in your prayers the suffering souls in Purgatory.
 
  May God bless you abundantly in His love!
 
  For a free Cenacle Scriptural Rosary Booklet --
  http://www.webhart.net/csrb/
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the suffering souls in Purgatory.

May God bless you abundantly in His love!

For a free Cenacle Scriptural Rosary Booklet -- http://www.webhart.net/csrb/

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




[PHP] Re: Help Out A Newbie In Configuring PHP.INI

2002-03-15 Thread David Robley

In article [EMAIL PROTECTED], 
[EMAIL PROTECTED] says...
 Uh oh, did I ask this question before? If I did, I'm very sorry. =(
 
 David Robley [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] says...
  Note that I'm using the Windows version of PHP.
 
  Whenever I use a mail() function in my PHP code I get an error of Failed
 to
  Connect on line number. So, I'm guessing my error lies in the PHP
  configuration file. I searched around the PHP.INI file for anything
  resembililing mail. I found these two lines:
 
 
  [mail function]
  ; For Win32 only.
  SMTP = alienmelon.com
 
  ; For Win32 only.
  sendmail_from = [EMAIL PROTECTED]
 
 
  I filled them out also, as you see above. Did I fill them out correctly?
  Even though I filled them out as you see above I still get the same error.
  Is the root of the error in the .ini at all?
 
 I have feeling of deja vu here. Is alienmelon.com a valid mail server? If
 not, you need to change it to something that is.

Well, aroung 14 Feb I ended up saying this to an address that might or 
might not be yours :-):

Subject: Re: [PHP] Troubles With Mail Function
From: David Robley [EMAIL PROTECTED]
Date: 

In article [EMAIL PROTECTED], 
[EMAIL PROTECTED] says...
 Alright, I will show you my entire mail code here. BTW: I cannot mail using
 mail() function
 
 [mail function]
 ; For Win32 only.
 SMTP = mindspring.com
 
 ; For Win32 only.
 sendmail_from = [EMAIL PROTECTED]
 
 ; For Unix only.  You may supply arguments as well (default:
 'sendmail -t -i').
 ;sendmail_path =
 
 
 I'm using Windows XP at the moment to develop.
 
 I'm not quite sure what I'd put under SMTP...is there any tutorials online
 that would show me how to configure this right?

In addition to my previous message - OK, I've gone and put the necessary 
software on the linux side of this thing and asked the appropriate 
questions - if I do a 'dig' on alienmelon i find:


;  DiG 9.1.2  -t mx alienmelon.com
;; global options:  printcmd
;; Got answer:
;; -HEADER- opcode: QUERY, status: NOERROR, id: 43766
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 3

;; QUESTION SECTION:
;alienmelon.com.IN  MX

;; ANSWER SECTION:
alienmelon.com. 28739   IN  MX  10 mail.alienmelon.com.

;; AUTHORITY SECTION:
alienmelon.com. 163967  IN  NS  NS.HOST4U.NET.
alienmelon.com. 163967  IN  NS  NS2.HOST4U.NET.

;; ADDITIONAL SECTION:
mail.alienmelon.com.28739   IN  A   64.33.108.112
NS.HOST4U.NET.  170095  IN  A   209.150.128.30
NS2.HOST4U.NET. 3201IN  A   209.150.129.3

;; Query time: 154 msec
;; SERVER: 203.96.152.4#53(203.96.152.4)
;; WHEN: Thu Feb 14 16:07:51 2002
;; MSG SIZE  rcvd: 146

which implies that alienemelon uses mail.alienmelon.com to handle its 
mail. So a ping to that to see if it exists gives us

C:\WINDOWSping mail.alienmelon.com

Pinging mail.alienmelon.com [64.33.108.112] with 32 bytes of data:

Reply from 64.33.108.112: bytes=32 time=329ms TTL=239
Reply from 64.33.108.112: bytes=32 time=325ms TTL=239
Reply from 64.33.108.112: bytes=32 time=315ms TTL=239
Reply from 64.33.108.112: bytes=32 time=315ms TTL=239

Ping statistics for 64.33.108.112:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 315ms, Maximum =  329ms, Average =  321ms

C:\WINDOWS

so it seems to exist. I suggest you try mail.alienmelon.com as the SMTP 
entry in your config and see what happens.

-- 
David Robley
Temporary Kiwi!

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] [More] Re: Weird?

2002-03-15 Thread jtjohnston

Miguel,
No, You're right I wasn't running E=All.  It's a windows machine, so I have
all the write priveledges I want.
These are the errors I'm getting:

 Warning: stat failed for c:\ccl_www\MarFriccl_www\ (errno=2 - No such
file or
 directory) in C:\WINDOWS\Bureau\php\microweb\backup4.php on line 23
 Warning: MkDir failed (No such file or directory) in
 C:\WINDOWS\Bureau\php\microweb\backup4.php on line 24
 Warning: stat failed for c:\ccl_www\MarFriccl_www\Nouveau dossier/
 (errno=2 - No such file or directory) in
 C:\WINDOWS\Bureau\php\microweb\backup4.php on line 23
 Warning: MkDir failed (No such file or directory) in
 C:\WINDOWS\Bureau\php\microweb\backup4.php on line 24
 Warning: Unable to create 'c:\ccl_www\MarFriccl_www\Nouveau
 dossier/aa.txt': No such file or directory in
 C:\WINDOWS\Bureau\php\microweb\backup4.php on line 44
 Warning: Unable to create 'c:\ccl_www\MarFriccl_www\aa.txt': No such
file or
 directory in  C:\WINDOWS\Bureau\php\microweb\backup4.php on line 44
 files copies from c:\program files\easyphp\ccl_www\ and backed up to
 c:\ccl_www\MarFriccl_www\

The code calls itself each time it enters another level.
If I create c:\ccl_www myself, I get this error:

 Warning: stat failed for c:\ccl_www\MarFriccl_www\ (errno=2 - No such
file or
 directory) in C:\WINDOWS\Bureau\php\microweb\backup4.php on line 23
 Warning: stat failed for c:\ccl_www\MarFriccl_www\Nouveau dossier/
 (errno=2 - No such file or directory) in
C:\WINDOWS\Bureau\php\microweb\backup4.php on line 23
 files copies from c:\program files\easyphp\ccl_www\ and backed up to
 c:\ccl_www\MarFriccl_www\

But despite (errno=2 - No such file or directory) the code does create
c:\ccl_www\MarFriccl_www and does copy the necessary files.

Can anyone help?


-snip--
$date = date (MD);
$from_path = c:\\program files\\easyphp\\ccl_www\\;
$to_path = c:\\ccl_www\\.$date.ccl_www\\;

if(!is_dir($from_path))
{
echo failed;
exit;
}else{
rec_copy($from_path, $to_path);
echo files copies from $from_path and backed up to $to_path;
}

#
function rec_copy ($from_path, $to_path) {
if(!is_dir($to_path))
mkdir($to_path, 0777);

$this_path = getcwd();
 if (is_dir($from_path))
 {
chdir($from_path);
$handle=opendir('.');

while (($file = readdir($handle))!==false)
{
 if (($file != .)  ($file != ..)) {
  if (is_dir($file))
  {
  rec_copy ($from_path.$file./,  $to_path.$file./);
   chdir($from_path);
  }else{
#  echo error if (is_dir($file))br;
  }
  if (is_file($file))
  {
  copy($from_path.$file, $to_path.$file);
  }else{
#  echo error copy($from_path.$file, $to_path.$file)br;
  }
 }#end (($file != .)
}#end while (($file

closedir($handle);
 }# end if (is_dir
 else{
# echo if (is_dir($from_path))br;
 }
}# end function



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




Re: [PHP] shell_exec()

2002-03-15 Thread Jason Wong

On Saturday 16 March 2002 06:21, Carlos Fernando Scheidecker Antunes wrote:
 Hello all,

 Does anyone know if shell_exec waits to have whatever it was passed to
 be executed before returning to the script?

 I am asking that because I need to write a script to compact files to a
 zip and then have it e-mailed to a predefined address.

 The files it will compact might have a considerable size and since this
 script will be triggered by a web page I wonder if shell_exec would be
 executed as a separate thread or if it will be the same one.

 For me, the ideal thing was to have it wait for the command to be over.

It waits.


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

/*
There's so much to say but your eyes keep interrupting me.
*/

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




  1   2   >