RE: [PHP] How do I make these two MySQL queries into one line?

2003-12-24 Thread Chris
You should *really* consider yourself lucky, because this is a PHP list, not
MySQL.

SELECT members.email FROM groups LEFT JOIN members USING(member_id) WHERE
'$chosenGroup'=group_id AND 'yes'=active

You should really find a tutorial on Joins, jsut search on `SQL tutorial
joins`

Chris

-Original Message-
From: Dave G [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 10:45 PM
To: 'PHP General'
Subject: [PHP] How do I make these two MySQL queries into one line?


PHP Gurus,
I'll consider myself lucky to get a response so close to
Christmas, but here goes.

I have two tables. One contains member information, and one
lists which groups the members belong to. I want to select the email
address of active members from the member information table, and I want
to select only the members which belong to a particular group. Right now
I can only think to accomplish this in two lines:
$query1 = SELECT member_id FROM groups WHERE group_id = .
$chosenGroup
Then, take the results and do another query:
$query2 = SELECT email FROM members WHERE active = yes AND
member_id = . $query1Results

But surely there's a way to collapse this into one MySQL line.

--
Yoroshiku!
Dave G
[EMAIL PROTECTED]

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

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



RE: [PHP] How do I make these two MySQL queries into one line? [SOLVED]

2003-12-24 Thread Dave G
Chris,
Thank you! I will look on the net for left joins, which is a
bit new to me, and I'll join a MySQL list, since I can see I'm going to
have more MySQL questions in the future.
Your reply is much appreciated, especially since it came so
fast!

-- 
Yoroshiku!
Dave G
[EMAIL PROTECTED]

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



Re: [PHP] Unlinking files.

2003-12-24 Thread David Otton
On Tue, 23 Dec 2003 19:08:28 -0800 (PST), you wrote:

How can I unlink files in a directory that are, for example older than 1
hour?

`find /path/to/dir -cmin +60 -type f -print0 | xargs -0 rm -f`;

Alternatively, for cross-platformness user opendir() and readdir() to
iterate over the directory, stat() or filemtime() to grab the last-modified
time of the file, and unlink() to remove files where ($last_modified 
time() - 3600).

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



[PHP] Apache error.log [warn] (OS 64) (OS 121)

2003-12-24 Thread Trevor Dowling
Hi,

I am having a real problem with error messages posted in the error.log file
in the Apache directory. I have been doing lots of searches to find a
solution and it seems obvious that many people are see this issue but I can
find no resolution or explanation for the entries (see below).

PHP Bug #25570 seemed to be a solution but the version of php I am using is
4.3.2 which is claimed to not exhibit the bug described in 25570.

The system is running on a Win2K box, and we are using php, sql and Apache.

Anyone out there have an idea of how to fix this issue?

Thanks

Trevor



Some system info:

System Windows NT UKRBCSR01 5.0 build 2195
Build Date May 28 2003 15:06:05
Server API Apache 2.0 Handler
Apache/2.0.47 (Win32) PHP/4.3.2

This is the more worring of the issues:

21:18:49 2003 [notice] Parent: child process exited with status
4294967295 -- Restarting.


But I am assuming that some or all of these are related.

21:19:44 2003 [warn] (OS 121)The semaphore timeout period has expired. :
winnt_accept: Asynchronous AcceptEx failed.
00:50:58 2003 [warn] (OS 64)The specified network name is no longer
available. : winnt_accept: Asynchronous AcceptEx failed.


Error Log snipit

21:18:16 2003 [notice] Parent: Created child process 3180
21:18:16 2003 [notice] Child 3180: Child process is running
21:18:16 2003 [notice] Child 3180: Acquired the start mutex.
21:18:16 2003 [notice] Child 3180: Starting 250 worker threads.
21:18:49 2003 [notice] Parent: child process exited with status
4294967295 -- Restarting.
21:18:49 2003 [notice] Parent: Created child process 676
21:18:49 2003 [notice] Child 676: Child process is running
21:18:49 2003 [notice] Child 676: Acquired the start mutex.
21:18:49 2003 [notice] Child 676: Starting 250 worker threads.
21:19:44 2003 [warn] (OS 121)The semaphore timeout period has expired. :
winnt_accept: Asynchronous AcceptEx failed.
00:50:58 2003 [warn] (OS 64)The specified network name is no longer
available. : winnt_accept: Asynchronous AcceptEx failed.
00:50:58 2003 [warn] (OS 64)The specified network name is no longer
available. : winnt_accept: Asynchronous AcceptEx failed.
01:54:48 2003 [warn] (OS 64)The specified network name is no longer
available. : winnt_accept: Asynchronous AcceptEx failed.
02:00:14 2003 [warn] (OS 64)The specified network name is no longer
available. : winnt_accept: Asynchronous AcceptEx failed.
05:41:18 2003 [warn] (OS 64)The specified network name is no longer
available. : winnt_accept: Asynchronous AcceptEx failed.
06:03:28 2003 [warn] (OS 64)The specified network name is no longer
available. : winnt_accept: Asynchronous AcceptEx failed.
06:31:33 2003 [warn] (OS 64)The specified network name is no longer
available. : winnt_accept: Asynchronous AcceptEx failed.
07:30:38 2003 [warn] (OS 64)The specified network name is no longer
available. : winnt_accept: Asynchronous AcceptEx failed.
07:30:38 2003 [warn] (OS 64)The specified network name is no longer
available. : winnt_accept: Asynchronous AcceptEx failed.
07:42:30 2003 [warn] (OS 64)The specified network name is no longer
available. : winnt_accept: Asynchronous AcceptEx failed.

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



php-general Digest 24 Dec 2003 13:06:18 -0000 Issue 2491

2003-12-24 Thread php-general-digest-help

php-general Digest 24 Dec 2003 13:06:18 - Issue 2491

Topics (messages 173275 through 173293):

Re: Headers Problem
173275 by: John W. Holmes

Re: Can't upload file greater than 11kb
173276 by: Chris
173277 by: Chris

Re: UNUSUAL PROBLEM WHEN WRITING TO THE SCREEN
173278 by: Chris W. Parker
173284 by: John W. Holmes

Re: apache chroot + mail()
173279 by: Tom Rogers

Re: HTTP headers, IE and downloading
173280 by: Andreas Magnusson

Unlinking files.
173281 by: Scott Holden
173282 by: Mike Migurski
173292 by: David Otton

[Newbie Guide] For the benefit of new members
173283 by: Ma Siva Kumar

Re: progress in PHP
173285 by: Manuel Lemos
173286 by: Jeremy Johnstone
173287 by: Manuel Lemos

Error with Absolute URLs
173288 by: Brad

How do I make these two MySQL queries into one line?
173289 by: Dave G
173290 by: Chris

Re: How do I make these two MySQL queries into one line? [SOLVED]
173291 by: Dave G

Apache error.log [warn] (OS 64)  (OS 121)
173293 by: Trevor Dowling

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---
Beauford wrote:

I'm getting the following error. My question is, where would I use the
ob_start() and ob_end_flush() function so I can get rid of this. I have read
the PHP manual, but not quite getting it.Or if there is a better way?
Don't work around the problem with output buffering; try fixing it.

Warning: session_start() [function.session-start]: Cannot send session cache
limiter - headers already sent (output started at
/usr/local/apache/htdocs/supreme/updates/update-corrections-write.php:2) in
/usr/local/apache/php/includes/restricted.inc on line 1
You must have session_start() before any output. You've placed it on 
line 1 of restricted.inc, but output was started on line 2 of 
update-corrections-write.php. If you're going to include restricted.inc 
and start a session, include it before there is output.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals  www.phparch.com
---End Message---
---BeginMessage---
post_max_size: 8M
upload_max_filesize: 10M

what quota and disk space affect the web server process and temp dir

This site is hosted by a third party:
Disk space is 400MB only a fraction is used.
temp dir -- unknown


Chris --

...and then Chris said...
%
% script on many php servers. However I am on one now which is not allowing
me
% to upload a file greater than 12kb.

What does phpinfo() say for

  post_max_size
  upload_max_filesize

and what quota and disk space affect the web server process and temp dir?


HTH  HAND

David T-G [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
---End Message---
---BeginMessage---
It has been my experience that max_file_size does terminate the upload
process if you include it in the form.
But you are right, if it gets to the upload, your stuck.

LimitRequestBody is beyond my control as the site is hosted by a third
party.

Thanks
Chris


Raditha Dissanayake [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 It's often said in many newsgroups and articles that the max_file_size
 is next to useless. It's also said that once IE starts uploading it will
 not stop even if you keep you foot on the stop button!

 If i remembers the earlier messages you have said the php.ini settings
 are correct. If so it could well be that you might be having
 misconfigured proxy server or firewall in the way.

 Apache also has a setting (LimitRequestBody) that could effect your
upload.

 all the best

 Chris wrote:

 I don't believe that the MAX_FILE_SIZE needs to be there. It will only
 terminate the upload process at the client, rather than wait for the
upload
 to complete.
 
 Anyway with or without MAX_FILE_SIZE the upload process is being
terminated
 after the file is uploaded.
 
 When the form is submitted, the selected file is uploaded to the server's
 temp directory then copied to the maps dir.  For some reason, when the
file
 size exceeds 11kb (very small) the process
 gets aborted (with or without MAX_FILE_SIZE). I've put in diagnostic
 messages and the POST script throws an error message if it can't find the
 file
 in the temp directory. I've uploaded several file sizes up to the max of
2MB
 and it appears the file is being uploaded. I base this assumption on the
 fact the upload time is proportional to the file size. When the file size
is
 greater than 11kb it appears that the file is deleted from the temp dir.
 
 Still no idea what is going on.
 Chris
 
 Larry Brown [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 
 
 The input type=hidden ... is 

[PHP] Removing/unsetting session variables.

2003-12-24 Thread Alain Williams
I have several variables that I set in a session - to record that a user is logged in.
I want to be able to unset them - when they log out.

$_SESSION['PERMS_USER'] = 'fred';
Sets the variable quite nicely, I can also change it and the change is recorded.
I cannot unset it. I have tried (in various combinations):

unset($_SESSION['PERMS_USER']);
unset($HTTP_SESSION_VARS['PERMS_USER']);
session_unregister($SESSION['PERMS_USER']);
session_unregister($HTTP_SESSION_VARS['PERMS_USER']);

None of which have any effect.

What should I do ?

Thanks

Merry Christmas.

-- 
Alain Williams

#include std_disclaimer.h

FATHERS-4-JUSTICE - Campaigning for equal rights for parents and the
best interests of our children. See http://www.fathers-4-justice.org

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



Re: [PHP] Removing/unsetting session variables.

2003-12-24 Thread CPT John W. Holmes
From: Alain Williams [EMAIL PROTECTED]

 I have several variables that I set in a session - to record that a user
is logged in.
 I want to be able to unset them - when they log out.

 $_SESSION['PERMS_USER'] = 'fred';
 Sets the variable quite nicely, I can also change it and the change is
recorded.
 I cannot unset it. I have tried (in various combinations):

 unset($_SESSION['PERMS_USER']);

unset is what you should use. How do you know it's not working??

---John Holmes...

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



Re: [PHP] Error with Absolute URLs

2003-12-24 Thread CPT John W. Holmes
From: Brad [EMAIL PROTECTED]
 I keep getting errors on my websites, that contain absolute URLs, e.g.
 http://www.url.com/blah.html. With most, being in the folder of my
 website, it's fine, i can just add $_SERVER['DOCUMENT_ROOT'], but
 there's a script I use to display the network statistics of an IRC
 network, which is located on a different server, so i can't use the
 $_SERVER['DOCUMENT_ROOT'], I'm wondering if anyone has an answer to
 this. I'm almost to the stage of just asking the script owner if I can
 have it located locally, so i can use the $_SERVER['DOCUMENT_ROOT']
 variable.

Ummm... if the page you're linking to isn't on your server, then you need to
hard code the link to that page. If your script automatically uses
$_SERVER['DOCUMENT_ROOT'] for every URL that's created, then you need to
rewrite that script. That's the solution.

---John Holmes...

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



RE: [PHP] Headers Problem

2003-12-24 Thread Beauford
Beauford wrote:

 I'm getting the following error. My question is, where would I use the
 ob_start() and ob_end_flush() function so I can get rid of this. I 
 have read the PHP manual, but not quite getting it.Or if there is a
better way?

 Don't work around the problem with output buffering; try fixing it.

 Warning: session_start() [function.session-start]: Cannot send session 
 cache limiter - headers already sent (output started at
 /usr/local/apache/htdocs/supreme/updates/update-corrections-write.php:
 2) in /usr/local/apache/php/includes/restricted.inc on line 1

You must have session_start() before any output. You've placed it on line 1
of restricted.inc, but output was started on line 2 of
update-corrections-write.php. If you're going to include restricted.inc and
start a session, include it before there is output.

Just a clarification, session_start() is on the first line of restricted.inc
and restricted.inc is included on the first line of
update-corrections-input.php. All update-corrections-write.php does is write
info to a database and includes update-corrections-input.php on the last
line. So I'm still not understanding where the output from
update-corrections-write.php is coming from.  

Thanks

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



Re: [PHP] Headers Problem

2003-12-24 Thread CPT John W. Holmes
From: Beauford [EMAIL PROTECTED]
 Just a clarification, session_start() is on the first line of
restricted.inc
 and restricted.inc is included on the first line of
 update-corrections-input.php. All update-corrections-write.php does is
write
 info to a database and includes update-corrections-input.php on the last
 line. So I'm still not understanding where the output from
 update-corrections-write.php is coming from.

Sounds like you have a blank line as the first line in
update-corrections-write.php. If ?php isn't the very first thing in the
file, then this isn't going to work.

---John Holmes...

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



RE: [PHP] Headers Problem

2003-12-24 Thread Beauford
Yes, there was a blank line. Now I just have to test it to see if that was
it. One other question though. It appears that Windows does not have this
problem - the site in question is on a Linux box. Why would this be? The two
sites are identical, I just use the Windows one for developing and testing.
I have looked at both php.ini files, and other than the OS specific stuff,
they are the same as well. 

Thanks again...

-Original Message-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] 
Sent: December 24, 2003 8:52 AM
To: Beauford
Cc: 'PHP'
Subject: Re: [PHP] Headers Problem

From: Beauford [EMAIL PROTECTED]
 Just a clarification, session_start() is on the first line of
restricted.inc
 and restricted.inc is included on the first line of 
 update-corrections-input.php. All update-corrections-write.php does is
write
 info to a database and includes update-corrections-input.php on the 
 last line. So I'm still not understanding where the output from 
 update-corrections-write.php is coming from.

Sounds like you have a blank line as the first line in
update-corrections-write.php. If ?php isn't the very first thing in the
file, then this isn't going to work.

---John Holmes...

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

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



[PHP] No ? or ?php in Windows

2003-12-24 Thread Robin Kopetzky
Good Morning and Merry Christmas to all.

I recently installed PHPTriad to a new server and the ? and ?php tags do
not work on ANY html page. Does anyone know what I may have missed in
configuration? Help...

Thanks a million in advance.

Robin 'Sparky' Kopetzky
Black Mesa Computers/Internet Service
Grants, NM 87020

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



Re: [PHP] No ? or ?php in Windows

2003-12-24 Thread CPT John W. Holmes
From: Robin Kopetzky [EMAIL PROTECTED]


 Good Morning and Merry Christmas to all.

 I recently installed PHPTriad to a new server and the ? and ?php tags do
 not work on ANY html page. Does anyone know what I may have missed in
 configuration? Help...

Try using them on a .php page? PHP doesn't normally run on plain HTML files
(with an .html or .htm extension).

---John Holmes...

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



[PHP] array data to XML

2003-12-24 Thread Chakravarthy Cuddapah
newbie ...
 
Is it possible to format data in array to XML and display ?
 
Thanks !


[PHP] Cannot Access Includes Above Current Directory if using SSL

2003-12-24 Thread Steve Benson
I'm new to your list and configuring Apache with the SSL module enabled
and have a newbie configuration glitch I've not been able to resolve.
I'm very puzzled over why my scripts with included files, either SSI or
PHP, work fine outside of the SSL directory structure (but still at
similar nested levels in directory tree but not SSL). i.e. 
given that /www/sd/htdocs/include/middle.html exists 
with index.shtml in /www/sd/htdocs/test (http) with the lines
!--#include file=../include/middle.html -- and 
!--#echo var=DOCUMENT_NAME -- run fine and middle.html is included
and the document name is displayed. Excellent! 
But the same index.shtml in /www/sd/htdocs/jobs (https) !--#include
file=../include/middle.html -- fails to include middle.html and the
error_log file reports: unable to include file
/www/sd/htdocs/include/middle.html in parsed file
/www/sd/htdocs/jobs/index.shtml Not problem with !--#echo
var=DOCUMENT_NAME -- the document name is displayed. Only half
excelent.
I changed the SSI to !--#include virtual=../include/middle.html --
as you suggested but the result was the same. I changed the relative
path used to absolute and also got the same result. I can use includes
in the SSL directory as long as they're at the same level or below. If I
move the above example (including the include directory) down one level
in the https directory tree i.e. given that
/www/sd/htdocs/jobs/include/middle.html exists with index.shtml in
/www/sd/htdocs/jobs/test (https) !--#include
file=../include/middle.html -- it also fails. So I can't go up even
within the https directory tree. The same scenario under http presents
no problems.
The SSI is mostly for testing trying to figure out why my PHP scripts
are acting this way. I'm trying to keep it simple so I can find the root
cause of my SSL (https) virtual server failure to work with upper level
include files.
i.e.
given that /www/sd/htdocs/include/prepend.php exists 
?php
include(../include/prepend.php);

? 

So, if I try the above code from a https directory, say
/www/sd/hddocs/jobs it will fail with: 
PHP Warning: main(../include/prepend.php): failed to open stream: No
such file or directory in /www/sd/htdocs/jobs/index.php on line 4
Using an absolute path rather than a relative path has no effect. I even
tried a scriptalias clause, same as /cgi-bin/ but /include/ to the
include files dir, but that didn't work either.
There is no problem if I change the include location to
/www/sd/htdocs/jobs/include, I can run the scripts fine. So it seems I
can include at the same level or below but not up any level in the
directory tree if using https.
I imagine there's something in my SSL configuration causing this but
after trying many Directory, Location and even a ScriptAlias changes
to the ssl.conf I've not been able to get around this.
I've created a number of Apache web sites but this is my first using
SSL(mod_ssl incorporated into Apache 2.0.48, openssl). I've never
encountered anything like this before in web development.
My configuration is:
RH Linux Kernel 2.4.20-8, Apache 2.0.48, OpenSSL -0.9.6l, PHP 4.3.4
(compiled as a mod w/Apache), Apache was compiled with SSL and SSI
enabled. SSL appears to work OK i.e. recognized by browser, cert and key
accepted etc.
To summarize:
- All scripts work fine with relative paths to include files as long as
they're accessed via http and are not in the https virtual server
directory tree structure.

- When accessing the same scripts within the https virtual server tree
the scripts cannot reference any include files that aren't at the same
level or below in the directory tree.

- If the include file is made available at the same level or below, no
problem accessing via relative or absolute paths.

- Even when the paths to include files are changed to absolute paths
they fail if the file is above the current directory in the tree
(https).  For some reason I can't go up the directory tree from within
the https virtual server directory structure. This is true no matter
where I am in the structure i.e. if I'm two levels deep in the directory
tree I can't reference a file up one level. If I'm three levels deep I
can't reference files back on level two, bummer!
I appreciate any suggestions. 
Thanks, 
 Steve


[PHP] Re: array data to XML

2003-12-24 Thread Matt Grimm
Of course.  If it's a simple (short) array, you can just create a string
with the XML tags and array values, and write that to a file with an XML
extension.

More sexy would be to use the DOMXML functions in PHP.
http://us3.php.net/manual/en/ref.domxml.php

Guy named Kris wrote a great XML - PHP script that you can find here,
although it may be more than you are looking for:
http://www.devdump.com/phpxml.php

I've written a DOMXML-based PHP - XML function that takes Kris' structure
as input, if you're interested.

--
Matt Grimm
Web Developer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Parkway
Anchorage, AK 99508
907.770.6200 ext. 686
907.336.6205 (fax)
E-mail: [EMAIL PROTECTED]
Web: www.healthtvchannel.org


Chakravarthy Cuddapah [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
newbie ...

Is it possible to format data in array to XML and display ?

Thanks !

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



[PHP] Re: Removing/unsetting session variables.

2003-12-24 Thread Matt Grimm
PHP manual recommends this, which works for me:

// Unset all of the session variables
$_SESSION = array();
// Destroy the session
session_destroy();

--
Matt Grimm
Web Developer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Parkway
Anchorage, AK 99508
907.770.6200 ext. 686
907.336.6205 (fax)
E-mail: [EMAIL PROTECTED]
Web: www.healthtvchannel.org

Alain Williams [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I have several variables that I set in a session - to record that a user
is logged in.
 I want to be able to unset them - when they log out.

 $_SESSION['PERMS_USER'] = 'fred';
 Sets the variable quite nicely, I can also change it and the change is
recorded.
 I cannot unset it. I have tried (in various combinations):

 unset($_SESSION['PERMS_USER']);
 unset($HTTP_SESSION_VARS['PERMS_USER']);
 session_unregister($SESSION['PERMS_USER']);
 session_unregister($HTTP_SESSION_VARS['PERMS_USER']);

 None of which have any effect.

 What should I do ?

 Thanks

 Merry Christmas.

 -- 
 Alain Williams

 #include std_disclaimer.h

 FATHERS-4-JUSTICE - Campaigning for equal rights for parents and the
 best interests of our children. See http://www.fathers-4-justice.org

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



[PHP] Cannot Access Includes Above Current Directory if using SSL

2003-12-24 Thread Steve Benson
I'm new to your list and configuring Apache with the SSL module enabled
and have a newbie configuration glitch I've not been able to resolve.
I'm very puzzled over why my scripts with included files, either SSI or
PHP, work fine outside of the SSL directory structure (but still at
similar nested levels in directory tree but not SSL). i.e. 
given that /www/sd/htdocs/include/middle.html exists 
with index.shtml in /www/sd/htdocs/test (http) with the lines
!--#include file=../include/middle.html -- and 
!--#echo var=DOCUMENT_NAME -- run fine and middle.html is included
and the document name is displayed. Excellent! 
But the same index.shtml in /www/sd/htdocs/jobs (https) !--#include
file=../include/middle.html -- fails to include middle.html and the
error_log file reports: unable to include file
/www/sd/htdocs/include/middle.html in parsed file
/www/sd/htdocs/jobs/index.shtml Not problem with !--#echo
var=DOCUMENT_NAME -- the document name is displayed. Only half
excelent.
I changed the SSI to !--#include virtual=../include/middle.html --
as you suggested but the result was the same. I changed the relative
path used to absolute and also got the same result. I can use includes
in the SSL directory as long as they're at the same level or below. If I
move the above example (including the include directory) down one level
in the https directory tree i.e. given that
/www/sd/htdocs/jobs/include/middle.html exists with index.shtml in
/www/sd/htdocs/jobs/test (https) !--#include
file=../include/middle.html -- it also fails. So I can't go up even
within the https directory tree. The same scenario under http presents
no problems.
The SSI is mostly for testing trying to figure out why my PHP scripts
are acting this way. I'm trying to keep it simple so I can find the root
cause of my SSL (https) virtual server failure to work with upper level
include files.
i.e.
given that /www/sd/htdocs/include/prepend.php exists 
?php
include(../include/prepend.php);

? 

So, if I try the above code from a https directory, say
/www/sd/hddocs/jobs it will fail with: 
PHP Warning: main(../include/prepend.php): failed to open stream: No
such file or directory in /www/sd/htdocs/jobs/index.php on line 4
Using an absolute path rather than a relative path has no effect. I even
tried a scriptalias clause, same as /cgi-bin/ but /include/ to the
include files dir, but that didn't work either.
There is no problem if I change the include location to
/www/sd/htdocs/jobs/include, I can run the scripts fine. So it seems I
can include at the same level or below but not up any level in the
directory tree if using https.
I imagine there's something in my SSL configuration causing this but
after trying many Directory, Location and even a ScriptAlias changes
to the ssl.conf I've not been able to get around this.
I've created a number of Apache web sites but this is my first using
SSL(mod_ssl incorporated into Apache 2.0.48, openssl). I've never
encountered anything like this before in web development.
My configuration is:
RH Linux Kernel 2.4.20-8, Apache 2.0.48, OpenSSL -0.9.6l, PHP 4.3.4
(compiled as a mod w/Apache), Apache was compiled with SSL and SSI
enabled. SSL appears to work OK i.e. recognized by browser, cert and key
accepted etc.
To summarize:
- All scripts work fine with relative paths to include files as long as
they're accessed via http and are not in the https virtual server
directory tree structure.

- When accessing the same scripts within the https virtual server tree
the scripts cannot reference any include files that aren't at the same
level or below in the directory tree.

- If the include file is made available at the same level or below, no
problem accessing via relative or absolute paths.

- Even when the paths to include files are changed to absolute paths
they fail if the file is above the current directory in the tree
(https).  For some reason I can't go up the directory tree from within
the https virtual server directory structure. This is true no matter
where I am in the structure i.e. if I'm two levels deep in the directory
tree I can't reference a file up one level. If I'm three levels deep I
can't reference files back on level two, bummer!
I appreciate any suggestions. 
Thanks, 
 Steve


[PHP] apache/web site question...

2003-12-24 Thread bruce
hi...

a very basic (i hope) question...

i know i can have a web page that uses PHP/ASP/Etc... and i can do a kind of
include, such that i can incorporate content/text from another file. i'm
curious to know if there is a way to do that such that i can incorporate
text from a file on another server on a separate domain/IP address???

any examples/sample pages demonstrating this would be helpful!!!

I would like to be able to accomplish this from within the apache httpd.conf
file if possible, where i simply define a website/page and the httpd.conf
directive points to the file on the separate PC. If this isn't possible,
I'll take the PHP/ASP/Etc.. approach where I can include a file that resides
on another completely different server/PC...

thanks...

bruce douglas
[EMAIL PROTECTED]
(925) 866-2790


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

[PHP] Re: array data to XML

2003-12-24 Thread Manuel Lemos
Hello,

On 12/24/2003 02:44 PM, Chakravarthy Cuddapah wrote:
Is it possible to format data in array to XML and display ?
This class seems to do what you want. It requires DOM XML extension.

Class: XML Array
http://www.phpclasses.org/xmlarray
You may also want to try this class for generating XML documents without 
requiring any extension:

Class: XML Writer class
http://www.phpclasses.org/xmlwriter
--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: apache/web site question...

2003-12-24 Thread Matt Grimm
As long as allow_url_fopen is enabled in php.ini, you can use HTTP and FTP
URLs with most of the functions that take a filename as a parameter. In
addition, URLs can be used with the include(), include_once(), require() and
require_once() statements.

http://us4.php.net/manual/en/features.remote-files.php

--
Matt Grimm
Web Developer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Parkway
Anchorage, AK 99508
907.770.6200 ext. 686
907.336.6205 (fax)
E-mail: [EMAIL PROTECTED]
Web: www.healthtvchannel.org


Bruce [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 hi...

 a very basic (i hope) question...

 i know i can have a web page that uses PHP/ASP/Etc... and i can do a kind
of
 include, such that i can incorporate content/text from another file. i'm
 curious to know if there is a way to do that such that i can incorporate
 text from a file on another server on a separate domain/IP address???

 any examples/sample pages demonstrating this would be helpful!!!

 I would like to be able to accomplish this from within the apache
httpd.conf
 file if possible, where i simply define a website/page and the httpd.conf
 directive points to the file on the separate PC. If this isn't
possible,
 I'll take the PHP/ASP/Etc.. approach where I can include a file that
resides
 on another completely different server/PC...

 thanks...

 bruce douglas
 [EMAIL PROTECTED]
 (925) 866-2790



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



[PHP] [Q] Compatibility issues using Apache and/or IIS

2003-12-24 Thread Michael T. Peterson
First I'm very new to all this, so forgive the naivity of these questions:
Anyway, I am building a WEB Site dev environment that supports PHP-MySQL
development.  I have both IIS and Apache WEB servers available for local
testing which begs the following question:

What are the factors that would influence my choosing IIS over Apache or
vice-versa?  If I develop and test against a local Apache server, will I run
into problems when uploading to a site that uses IIS?  What about using a
local IIS server  and uploading to an Apache site?

Thanks in advance.

Michael

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



[PHP] session problems across pages

2003-12-24 Thread obsidianchrysalis
thanks for the help, it definitely saved my from hours of pulling at me
hairs.

however i have a new problem. i can create session variables, but i can't
access them across pages.

for example.

page2.php

Code:

?php
// start the session
session_start();
header(Cache-control: private); //IE 6 Fix

echo strongStep 2 - Register Session /strongbr /;

// Get the user's input from the form
   $name = $_POST['name'];

// Register session key with the value
   $_SESSION['name'] = $name;

// Display the sssion information:
?

Welcome to my website strong? echo $_SESSION['name']; ?/strong!br /
Let's see what happens on the a href=page3.phpnext page./abr /br /



page3.php
Code:

?php
// start the session
session_start();
header(Cache-control: private); //IE 6 Fix
?
strongStep 3 - test Session Part II /strongbr /
Hey strong? echo $_SESSION['name']; ?/strong Everything is still
working!br /br /
strongPick an option:/strongbr /
Let's delete this session value now. a href=page4.phpClick Here./abr
/
Let's destroy this session. a href=page5.phpClick Here./abr /br /




on page2.php (after the _SESSION['name'] variable is set with a form on
another page) the value of the variable comes up fine. however on page3.php,
the value is blank. any thoughts why? i tried tinkering with the php.ini
(v.4.0 on a Win98 box) but nothing changed.

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



[PHP] basic set and read a cookie probs

2003-12-24 Thread Jack E. Wasserstein, DDS, Inc.
I am using the following code on the php form handler

if ($_POST[referdrremember] == true) {
setcookie(remailcookie,
$_POST_VARS[refdremail],time()+3600,/,wasserstein.com,0);

Try to see the cookie in the same script, not sure which one to use with or
without $

print  the cookie's value is  $HTTP_COOKIE_VARS[remailcookie] ;
print  the cookie's value is 2 $HTTP_COOKIE_VARS[$remailcookie] ;

In addition when I get back to the calling form and refresh it I try to see
the cookie with this:

if ($HTTP_COOKIE_VARS[remailcookie]) {
  print (remail cookie exists); }
  else {
  print (no cookie);
  }

This yeilds no cookie

I have also tried $_COOKIE[] as well


What am I doing wrong.

Thanks in advance,

Jack

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



[PHP] programming the onclick() event in an anchor

2003-12-24 Thread Peter Walter
I have written a session-enabled php page which displays a table of 
search results. The first column in the table contains anchor links to 
www.mydomain.com/mypage?seqno= where seqno is a variable I would 
like to pass when the anchor is clicked. However, I do not wish the 
?seqno= to display in the url of the browser. After googling a lot, 
it appears that I can use JavaScript to set a session variable in the 
onclick() event, but I have not been able to find an example of how to 
do it. Does anyone have experience doing this? Sample code would be 
greatly appreciated.

Peter

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


php-general Digest 25 Dec 2003 01:09:11 -0000 Issue 2492

2003-12-24 Thread php-general-digest-help

php-general Digest 25 Dec 2003 01:09:11 - Issue 2492

Topics (messages 173294 through 173313):

Removing/unsetting session variables.
173294 by: Alain Williams
173295 by: CPT John W. Holmes
173305 by: Matt Grimm

Re: Error with Absolute URLs
173296 by: CPT John W. Holmes

Re: Headers Problem
173297 by: Beauford
173298 by: CPT John W. Holmes
173299 by: Beauford

No ? or ?php in Windows
173300 by: Robin Kopetzky
173301 by: CPT John W. Holmes

array data to XML
173302 by: Chakravarthy Cuddapah
173304 by: Matt Grimm
173308 by: Manuel Lemos

Cannot Access Includes Above Current Directory if using SSL
173303 by: Steve Benson
173306 by: Steve Benson

apache/web site question...
173307 by: bruce
173309 by: Matt Grimm

[Q] Compatibility issues using Apache and/or IIS
173310 by: Michael T. Peterson

session problems across pages
173311 by: obsidianchrysalis

basic set and read a cookie probs
173312 by: Jack E. Wasserstein, DDS, Inc.

programming the onclick() event in an anchor
173313 by: Peter Walter

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---
I have several variables that I set in a session - to record that a user is logged in.
I want to be able to unset them - when they log out.

$_SESSION['PERMS_USER'] = 'fred';
Sets the variable quite nicely, I can also change it and the change is recorded.
I cannot unset it. I have tried (in various combinations):

unset($_SESSION['PERMS_USER']);
unset($HTTP_SESSION_VARS['PERMS_USER']);
session_unregister($SESSION['PERMS_USER']);
session_unregister($HTTP_SESSION_VARS['PERMS_USER']);

None of which have any effect.

What should I do ?

Thanks

Merry Christmas.

-- 
Alain Williams

#include std_disclaimer.h

FATHERS-4-JUSTICE - Campaigning for equal rights for parents and the
best interests of our children. See http://www.fathers-4-justice.org
---End Message---
---BeginMessage---
From: Alain Williams [EMAIL PROTECTED]

 I have several variables that I set in a session - to record that a user
is logged in.
 I want to be able to unset them - when they log out.

 $_SESSION['PERMS_USER'] = 'fred';
 Sets the variable quite nicely, I can also change it and the change is
recorded.
 I cannot unset it. I have tried (in various combinations):

 unset($_SESSION['PERMS_USER']);

unset is what you should use. How do you know it's not working??

---John Holmes...
---End Message---
---BeginMessage---
PHP manual recommends this, which works for me:

// Unset all of the session variables
$_SESSION = array();
// Destroy the session
session_destroy();

--
Matt Grimm
Web Developer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Parkway
Anchorage, AK 99508
907.770.6200 ext. 686
907.336.6205 (fax)
E-mail: [EMAIL PROTECTED]
Web: www.healthtvchannel.org

Alain Williams [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I have several variables that I set in a session - to record that a user
is logged in.
 I want to be able to unset them - when they log out.

 $_SESSION['PERMS_USER'] = 'fred';
 Sets the variable quite nicely, I can also change it and the change is
recorded.
 I cannot unset it. I have tried (in various combinations):

 unset($_SESSION['PERMS_USER']);
 unset($HTTP_SESSION_VARS['PERMS_USER']);
 session_unregister($SESSION['PERMS_USER']);
 session_unregister($HTTP_SESSION_VARS['PERMS_USER']);

 None of which have any effect.

 What should I do ?

 Thanks

 Merry Christmas.

 -- 
 Alain Williams

 #include std_disclaimer.h

 FATHERS-4-JUSTICE - Campaigning for equal rights for parents and the
 best interests of our children. See http://www.fathers-4-justice.org
---End Message---
---BeginMessage---
From: Brad [EMAIL PROTECTED]
 I keep getting errors on my websites, that contain absolute URLs, e.g.
 http://www.url.com/blah.html. With most, being in the folder of my
 website, it's fine, i can just add $_SERVER['DOCUMENT_ROOT'], but
 there's a script I use to display the network statistics of an IRC
 network, which is located on a different server, so i can't use the
 $_SERVER['DOCUMENT_ROOT'], I'm wondering if anyone has an answer to
 this. I'm almost to the stage of just asking the script owner if I can
 have it located locally, so i can use the $_SERVER['DOCUMENT_ROOT']
 variable.

Ummm... if the page you're linking to isn't on your server, then you need to
hard code the link to that page. If your script automatically uses
$_SERVER['DOCUMENT_ROOT'] for every URL that's created, then you need to
rewrite that script. That's the solution.

---John Holmes...
---End Message---
---BeginMessage---
Beauford wrote:

 I'm 

[PHP] Re: basic set and read a cookie probs

2003-12-24 Thread Jack E. Wasserstein, DDS, Inc.
Sorry,

No such thing as $_POST_VARS




Jack E. Wasserstein [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I am using the following code on the php form handler

 if ($_POST[referdrremember] == true) {
 setcookie(remailcookie,
 $_POST_VARS[refdremail],time()+3600,/,wasserstein.com,0);

 Try to see the cookie in the same script, not sure which one to use with
or
 without $

 print  the cookie's value is  $HTTP_COOKIE_VARS[remailcookie] ;
 print  the cookie's value is 2 $HTTP_COOKIE_VARS[$remailcookie] ;

 In addition when I get back to the calling form and refresh it I try to
see
 the cookie with this:

 if ($HTTP_COOKIE_VARS[remailcookie]) {
   print (remail cookie exists); }
   else {
   print (no cookie);
   }

 This yeilds no cookie

 I have also tried $_COOKIE[] as well


 What am I doing wrong.

 Thanks in advance,

 Jack

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



Re: [PHP] JavaScript question

2003-12-24 Thread -{ Rene Brehmer }-
you can simply call:

Window.location.href = 
'http://yourdomain.com/phpscripttocall.php?variable1=value1variable2=value2'

^works in all browsers supporting JavaScript ... there's a few variants of 
this that will only work in IE or Netscape, but this one is vague enough to 
work in both... (not sure about Opera, it doesn't run well on my setup, so 
testing with it is a basically impossible for me)...

if you use frames, it's a bit more tricky, but I trust you don't, otherwise 
just ask ... :) ... I've got the complete JavaScript code to change the 
content of frames criss-cross of each other in any way and pattern you can 
dream off... (my site used to be a JS driven monster before I got my 
webhotel and the option to do it all with PHP) ...

Rene

At 19:58 02-11-2003, you wrote:
Good morning.

I know this may be off-topic but I don't know where to turn.

I'm building a dynamic web page system with PHP and need to figure out in
JavaScript how to do something. I have the timer figured out in JavaScript
but what I need is a way to automatically submit a request back to the web
server after the timer runs out. What I'm trying to do is display slides in
sequence. When the timer expires, it sends back to the web server the
parameters of slide group and the last slide displayed. The PHP on the
server end builds a new page and sends it to the browser with the next slide
in the sequence.
Any help would be greatly appreciated and my PHP skills are vastly above my
JavaScript skills (very basic beginner).
Robin 'Sparky' Kopetzky
Black Mesa Computers/Internet Service
Grants, NM 87020
--
Rene Brehmer
aka Metalbunny
http://metalbunny.net/
References, tools, and other useful stuff...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Problem with session variables on Mac

2003-12-24 Thread Jim Sara Feldman
	I should first admit to being a php newbie, so the answer may 
be obvious, but this looks like a
bug to me. Global variables are OFF. I start a session at the very 
top of page member.php:

	session_start();

In a function called from the same page, I store some variables in 
the session array:

$pilot = mysql_fetch_array($result);
$usrname = $pilot['given']. .$pilot['last'];
$valid_ID = $pilot['ID'];
$timestamp = date(U);
session_register(usrname,timestamp,valid_ID);
then in another function called from the same page (or a different 
page, since this is where I find which
user is sending in a page), I attempt to use the timestamp data. 
Three echo lines are added to provide
some debugging help.

if (session_is_registered(valid_ID)){
echo inside check IF br;
$current_time = date(U);
echo Time = $current_time.br;
$session_time = $current_time - $_SESSION('timestamp');
echo session time = $session_time seconds.br;
The output to the browser (Safari) is as follows:

inside check IF
Time = 1072308706.
Fatal error: Call to undefined function: array() in
/Library/WebServer/Documents/testit/Logsafe_project/user_auth_fns.php 
on line 35

As you can see, the code bombs as soon as it hits the 
$_SESSION('timestamp'). Note that it did pass through
(session_is_registered(valid_ID) successfully and if I go look in 
the directory where the cookie would go,
it is there.

	I am operating in system 10.3.2 (Panther) and, as far as I 
can tell, using php 4.3.2. Any help would be appreciated.

Jim

--
Jim Feldman
14 Linda Lane
Newton, MA 02461
617-527-0509