php-general Digest 2 Jul 2003 16:10:52 -0000 Issue 2152

Topics (messages 153655 through 153725):

Re: Email troubles
        153655 by: Manuel Lemos

Re: online file management
        153656 by: Suhas Pharkute
        153685 by: Paul Chvostek

Re: php - printer button
        153657 by: Shivanischal A
        153669 by: daniel.electroteque.org
        153674 by: Jyry Kuukkanen
        153694 by: nasar.digilib.umm.ac.id

2values on form, help in catching as one.
        153658 by: Miranda, Joel Louie M
        153664 by: Jason Sheets
        153720 by: Mark

Re: Session vs Cookie Issues
        153659 by: Mike Migurski
        153661 by: Ow Mun Heng
        153682 by: Matt MacLeod
        153723 by: Mike Migurski
        153724 by: Mike Migurski

Removed the bundled MySQL client library. (Sterling)
        153660 by: Vincent Bouret
        153662 by: - Edwin -

Items displayed left and right, help newman.
        153663 by: Mark Tehara
        153665 by: Mark Tehara
        153667 by: Jeff Harris

Re: php and gd
        153666 by: Jason Sheets

Re: safe_mode and file/directory ownership
        153668 by: Jason Sheets
        153686 by: Paul Chvostek

PHP user group
        153670 by: Erich Kolb

How can I get all vars
        153671 by: Slava
        153697 by: sven

Re: OT (kinda): Mod_rewrite
        153672 by: Wendell Brown

Previous Basic Auth clarified
        153673 by: Dave Carrera

Re: php-general as REPLY TO
        153675 by: Joel Rees

Re: PHP on one box, Apache on another?
        153676 by: Joel Rees
        153677 by: Joel Rees

mysql detect
        153678 by: RoyD.bercacakra.com
        153681 by: Manuel Lemos
        153695 by: Marco Tabini

Java Applet to PHP Communication
        153679 by: Sharat Hegde
        153680 by: justin gruenberg
        153689 by: Sharat Hegde
        153714 by: Ray Hunter

Template Programme!
        153683 by: Jupiter Wen

Session Performance questions
        153684 by: Sancar Saran

Re: Geting information from XML
        153687 by: Nabil

dynamic classes or dynamic extends ?
        153688 by: Torsten Rosenberger
        153692 by: Pete Morganic

Re: have some free time?
        153690 by: Ford, Mike               [LSS]

Quickie - manipulating strings
        153691 by: Matt MacLeod
        153693 by: Pete Morganic

Using INCLUDES in SAFE MODE
        153696 by: MIKE YRABEDRA
        153721 by: Jim Lucas

Forms & PHP
        153698 by: Gary Ogilvie
        153701 by: Jay Blanchard
        153703 by: Gary Ogilvie
        153704 by: Jay Blanchard
        153706 by: Gary Ogilvie
        153708 by: Greg Wiley
        153710 by: Gary Ogilvie
        153711 by: Jay Blanchard

outputting xml declaration
        153699 by: Steven Apostolou
        153700 by: Adam Voigt
        153702 by: Jay Blanchard
        153709 by: Yann Larrivee
        153713 by: Ray Hunter
        153718 by: Adam Voigt
        153722 by: Jim Lucas

Re: Forms & PHP[Scanned]
        153705 by: Michael Egan
        153707 by: Gary Ogilvie

passthru() problem
        153712 by: david
        153716 by: Kristin Schesonka

Re: states
        153715 by: Ray Hunter

Re: Forms & PHP - Thanks
        153717 by: Gary Ogilvie

Quick ? ... how come this doesn't work?
        153719 by: Anthony

weird issues w/PHP install
        153725 by: Michael Geier

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]


----------------------------------------------------------------------
--- Begin Message --- Hello,

On 06/30/2003 07:30 PM, Sparky Kopetzky wrote:
I'm getting this error while sending email with mail():

Warning: mail(): SMTP server response: 550 5.7.1 <[EMAIL PROTECTED]>... Relaying denied in (path to my program)

How do I turn relaying on??

I think that means you need to authenticate. The mail() function has no authentication support. You may want to try this class that comes with a subclass for sending messages via SMTP that supports authentication. It comes also with a wrapper function named smtp_mail() that emulates the mail() function so you can use it as replacement without changing your scripts too much:


http://www.phpclasses.org/mimemessage

You also need this for message delivery.

http://www.phpclasses.org/smtpclass


--


Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/


--- End Message ---
--- Begin Message ---
Hello,

I have developed a package which is exactly same what you explained here. It
is PHP-MySQL (Windows/Linux)combination. I have another older version which
was PHP-MSAccess (Windows). If you want I can give you logins for test
purposes.

This system is currently in use. I have to creat identical system for you on
another server. Please let me know if you are interested in this.

Let me know
Suhas
_________________________________

Suhas S Pharkute.
P O Box 8551,
Pocatello ID 83209.
1.208.221.3896
http://myweb.cableone.net/psuhas
_________________________________
----- Original Message ----- 
From: "Paul Chvostek" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 01, 2003 8:03 PM
Subject: [PHP] online file management


>
> Hiya.
>
> I'm looking for a tool that will allow online file management, with a UI
> something like that of a traditional FTP client.
>
> The ideal candidate would authenticate based on a MySQL table and would
> be able to handle multiple users with unique base directories.  I'd
> rather not use an PHP-based FTP client, but I'm open to that if nothing
> else is available.
>
> Before I write one myself, is there a package that has already been
> built that any one can recommend (or recommend against)?
>
> Thanks.  :-)
>
> -- 
>   Paul Chvostek                                             <[EMAIL PROTECTED]>
>   it.canada                                            http://www.it.ca/
>   Free PHP web hosting!                            http://www.it.ca/web/
>
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message ---
> ----- Original Message -----
> From: "Paul Chvostek" <[EMAIL PROTECTED]>
> >
> > I'm looking for a tool that will allow online file management, with a UI
> > something like that of a traditional FTP client.
> >
> > The ideal candidate would authenticate based on a MySQL table and would
> > be able to handle multiple users with unique base directories.  I'd
> > rather not use an PHP-based FTP client, but I'm open to that if nothing
> > else is available.

On Tue, Jul 01, 2003 at 09:44:01PM -0600, Suhas Pharkute wrote:
>
> I have developed a package which is exactly same what you explained here. It
> is PHP-MySQL (Windows/Linux)combination. I have another older version which
> was PHP-MSAccess (Windows). If you want I can give you logins for test
> purposes.
>
> This system is currently in use. I have to creat identical system for you on
> another server. Please let me know if you are interested in this.

I'm interested in an established package with support by the user
community, not a package with source distribution restrictions and
prohibitive licensing fees.

If you release your software for public review, I'll happily consider
it.  Otherwise, I guess I'll write my own....


-- 
  Paul Chvostek                                             <[EMAIL PROTECTED]>
  it.canada                                            http://www.it.ca/
  Free PHP web hosting!                            http://www.it.ca/web/


--- End Message ---
--- Begin Message ---
hi,

PHP dos have some printer_* functions. had a look? :-)

-shiva

<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Dear all,
>
> I have research about library automation engine in my library.
> developing on PHP + MySQL
> We need to develop printer utility at some module to get print out
> transaction.
>
> Can I do this utility using SUBMIT BUTTON under HTML & PHP?
> how to make the php printer script?
> help... please & thanks
>
> Regard,
> Nasar
>
>
>



--- End Message ---
--- Begin Message ---
lol we we just discussing this at work  the printer functions are only for
windoze , there is jscript window.print() to bring up the printer dialog ,
a project i just did implemented htmldoc which outputted the formatted
content to pdf which was a more well formed format for printing rather than
from the browser itself

> hi,
>
> PHP dos have some printer_* functions. had a look? :-)
>
> -shiva
>
> <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>>
>> Dear all,
>>
>> I have research about library automation engine in my library.
>> developing on PHP + MySQL
>> We need to develop printer utility at some module to get print out
>> transaction.
>>
>> Can I do this utility using SUBMIT BUTTON under HTML & PHP?
>> how to make the php printer script?
>> help... please & thanks
>>
>> Regard,
>> Nasar
>>
>>
>>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php




--- End Message ---
--- Begin Message ---
On Tue, 1 Jul 2003 [EMAIL PROTECTED] wrote:

> 
> On Tue, 1 Jul 2003, Dore van Hoorn wrote:
> 
> > This is not exactly what you've asked for, but perhaps you're able to use
> > it anyway. It is the PHP script I use to create a print-friendly page:
> > Everything between <!-- Start Print Version --> and <!-- End Print Version
> 
> thanks friend..
> exactly I wish print my data transaction to paper via printer driver  
> and this cliet running ms windows (printer this here)
> and server running redhat linux (PHP on apache web server this here)

http://dataxi.sourceforge.net

Download dataxi-install-xxx.tar.gz.
That inludes a package called dzdocprint.php that produces PDF that you 
can pass to CUPS printer on the server side (lpr -Pprintername tmp.pdf).

If you download the example-xxx.tar.gz you find a file called 
print_album.ini that is an example template for printing used by 
dzdocprint.php.

Let me know if you have any troubles getting started with it.

Cheers,
-- 
--Jyry
:-(    C:-/    C========8-O    C8-/    C:-(


--- End Message ---
--- Begin Message ---
thanks for all who respons my problem,
i was found solution java script at
http://javascriptsource.com/ with keyword "printer button"

thanks again...

rg
nasar


--- End Message ---
--- Begin Message ---
I have this php code (below), My form passes 2 values w/c is TemplateOne and
TemplateTwo I was wondering how could I make that in php to catch the value
as one only? I tried this and it didn't work. But if the value is just one
the case display it. Any ideas?

<?php
  $v_template = $_REQUEST['TemplateOne'] ;
  $v_template = $_REQUEST['TemplateTwo'] ;

switch($v_template) {
 case 'TemplateOne':
 echo "one";
 break;

 case 'TemplateTwo':
 echo "two";
 break;
}
?>

--
Thank you,
Miranda, Louie

--- End Message ---
--- Begin Message --- You could do it a couple different ways, if you just want to combine the values the easiest way is:

$v_template = $_REQUEST['TemplateOne'] . $_REQUEST['TemplateTwo'];

If you want a space between the two values expand on this idea using:

$v_template = $_REQUEST['TemplateOne'] . ' ' . $_REQUEST['TemplateTwo'];

If you get a minute checkout the PHP manual at http://www.php.net/manual, it covers this topic and has quite a few useful tips in it.

Jason


Miranda, Joel Louie M wrote:


I have this php code (below), My form passes 2 values w/c is TemplateOne and
TemplateTwo I was wondering how could I make that in php to catch the value
as one only? I tried this and it didn't work. But if the value is just one
the case display it. Any ideas?

<?php
 $v_template = $_REQUEST['TemplateOne'] ;
 $v_template = $_REQUEST['TemplateTwo'] ;

switch($v_template) {
case 'TemplateOne':
echo "one";
break;

case 'TemplateTwo':
echo "two";
break;
}
?>

--
Thank you,
Miranda, Louie





--- End Message ---
--- Begin Message ---
It's not clear what you're trying to do. If the values are for a
radio button or checkbox, use the same name for both buttons. 

The values have to be mutually exclusive for what you;re trying to do
to work.

You could do something like this:

if (isset($_REQUEST['TemplateOne']) {
  $test=$_REQUEST['TemplateOne'];
} elseif (isset($_REQUEST['TemplateTwo']) {
  $test=$_REQUEST['TemplateTwo'];
} else {
  $test="";
}

echo $test;

------

or this:
$test=0
if (isset($_REQUEST['TemplateOne']) {
  $test=1;
}
if (isset($_REQUEST['TemplateTwo']) {
  $test+=2;
}

switch ($test) {
  case 1:
  echo "one";
  break;
  case 2:
  echo "two";
  break;
  case 3:
  echo "one and two";
  break;
}

Without knowing what you're actually trying to do, however, we're all
just shooting in the dark.

--- "Miranda, Joel Louie M" <[EMAIL PROTECTED]> wrote:
> I have this php code (below), My form passes 2 values w/c is
> TemplateOne and
> TemplateTwo I was wondering how could I make that in php to catch
> the value
> as one only? I tried this and it didn't work. But if the value is
> just one
> the case display it. Any ideas?
> 
> <?php
>   $v_template = $_REQUEST['TemplateOne'] ;
>   $v_template = $_REQUEST['TemplateTwo'] ;
> 
> switch($v_template) {
>  case 'TemplateOne':
>  echo "one";
>  break;
> 
>  case 'TemplateTwo':
>  echo "two";
>  break;
> }
> ?>
> 
> --
> Thank you,
> Miranda, Louie
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


=====
Mark Weinstock
[EMAIL PROTECTED]
***************************************
You can't demand something as a "right" unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***************************************

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

--- End Message ---
--- Begin Message ---
>       I know this topic has been talked about a LOT but all the info
>I've managed to get from google is that there is no center / best option
>to choose between using sessions or cookies.

You're comparing apples and oranges -- cookies are one of the mechanisms
by which PHP implements sessions. The other is URL-munging. So if you use
sessions, odds are cookies are coming along for the ride. What you
definitely /don't/ want to do is to store application data in the cookie
itself, due to various security (public machines) and technical (4k size
limit) concerns. PHP's built-in session support uses the cookie data as an
identifier, to match a user to the data stored in a session file, and in
general this is the way to go. The only major flaw I've found with PHP's
session support is that it doesn't appear to be possible to force the data
to be written without also closing the session. In general, PHP's session
features are pretty complete, and easily modifiable.

To clear up a few items below:


>Cons of Sessions
>1. saves it in /tmp - world viewable

not necessarily so, see php.net/session_save_path

>2. Session ID may be easy to guess unless I md5 the sessionID before
>sending it out

you can define your own session id if you'd like, see php.net/session_id
for example, to help deter session fixation, you might require that the
session be a hash of certain environment variables, such as remote IP or
user-agent string.


>Cons of cookies
>1. cookies can be rejected by users
>2. if rejected, means session can't be preserved across pages?? (this I'm
>not sure)

this is where URL-munging will come into play; PHP will resort to this if
cookies are rejected.


>3. cookie is stored in user's hard drive. What is user using public PC?

don't use the cookie to store application data - use it to determine the
user's identity. This is the behavior that PHP's session features
encapsulate.


---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca            http://mike.teczno.com/contact.html


--- End Message ---
--- Begin Message ---
Hi Mike,

        based on what you're saying, I gather that if I were to choose to
use cookies, and if cookies were rejected by the user, PHP will default to
using sessions?

----: quote :---
The only major flaw I've found with PHP's
session support is that it doesn't appear to be possible to force the data
to be written without also closing the session.

----: End Quote :----

Is the above a serious flaw which I need to be aware of?

Thanks

Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia 
DID : 03-7870 5168


-----Original Message-----
From: Mike Migurski [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 02, 2003 11:47 AM
To: Ow Mun Heng
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Session vs Cookie Issues


>       I know this topic has been talked about a LOT but all the info
>I've managed to get from google is that there is no center / best option
>to choose between using sessions or cookies.

You're comparing apples and oranges -- cookies are one of the mechanisms
by which PHP implements sessions. The other is URL-munging. So if you use
sessions, odds are cookies are coming along for the ride. What you
definitely /don't/ want to do is to store application data in the cookie
itself, due to various security (public machines) and technical (4k size
limit) concerns. PHP's built-in session support uses the cookie data as an
identifier, to match a user to the data stored in a session file, and in
general this is the way to go. The only major flaw I've found with PHP's
session support is that it doesn't appear to be possible to force the data
to be written without also closing the session. In general, PHP's session
features are pretty complete, and easily modifiable.

To clear up a few items below:


>Cons of Sessions
>1. saves it in /tmp - world viewable

not necessarily so, see php.net/session_save_path

>2. Session ID may be easy to guess unless I md5 the sessionID before
>sending it out

you can define your own session id if you'd like, see php.net/session_id
for example, to help deter session fixation, you might require that the
session be a hash of certain environment variables, such as remote IP or
user-agent string.


>Cons of cookies
>1. cookies can be rejected by users
>2. if rejected, means session can't be preserved across pages?? (this I'm
>not sure)

this is where URL-munging will come into play; PHP will resort to this if
cookies are rejected.


>3. cookie is stored in user's hard drive. What is user using public PC?

don't use the cookie to store application data - use it to determine the
user's identity. This is the behavior that PHP's session features
encapsulate.


---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca            http://mike.teczno.com/contact.html


--- End Message ---
--- Begin Message --- I've had similar issues using cookies. The cookie was storing my details but only for the duration of the session despite having set the expiry date to a time well into the future. Any ideas for why this may have happened?


The only major flaw I've found with PHP's
session support is that it doesn't appear to be possible to force the data
to be written without also closing the session.


Mike - can you expand on your point above?

Thanks,
Matt


--- End Message ---
--- Begin Message ---
>       based on what you're saying, I gather that if I were to choose to
>use cookies, and if cookies were rejected by the user, PHP will default
>to using sessions?

If you chose to use sessions, and cookies were rejected by the user, then
PHP would append the session ID to each internal link, in order to
preserve the session ID between requests.

If you just used cookies with no supplemental method, and cookies were
rejected by the user, then your method would break.

---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca            http://mike.teczno.com/contact.html


--- End Message ---
--- Begin Message ---
>>The only major flaw I've found with PHP's session support is that it
>>doesn't appear to be possible to force the data to be written without
>>also closing the session.
>
>Mike - can you expand on your point above?

I've running into this problem where--in an app with a lot of OOP and
reference-passing, on a shared host--requests would die out before
reaching the end, though they'd do enough work to be useful. I can't seem
to be able to fix the instability (see below), but I was able to work
around one of the flaws of the session support: normally the user's
session data is read from a file, typically in /tmp, at the start of a
request. This data is manipulated by the script when values in
$GLOBALS['_SESSION'] are changed, and then it's written back to the file
at the end of the request.  My issue was that frequently, my scripts
wouldn't finish correctly, session data would not be written to the file,
and therefore it would be lost between requests. I had hoped to find a
function like session_write_close() that did not have the side effect of
closing the session altogether, but instead I ended up rolling my own,
with more frequent disk writes at crucial junctures.

If anyone can help shed any light on the sort of instability I'm seeing,
that would really help. Apache child processes die right and left, with
segfaults and bus errors.

---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca            http://mike.teczno.com/contact.html


--- End Message ---
--- Begin Message ---
I found this in the ChangeLog of PHP5: Removed the bundled MySQL client
library. (Sterling)

What does that mean? We can't access MySQL anymore from PHP?


Vincent




--- End Message ---
--- Begin Message ---
On Tue, 1 Jul 2003 23:51:09 -0400
"Vincent Bouret" <[EMAIL PROTECTED]> wrote:

> I found this in the ChangeLog of PHP5: Removed the bundled MySQL client
> library. (Sterling)
> 
> What does that mean? We can't access MySQL anymore from PHP?
> 

Check this thread:

  http://marc.theaimsgroup.com/?t=105699187300004&r=1&w=2

- E -

__________________________________________________
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/


--- End Message ---
--- Begin Message ---
Where should i start with the lodgic.  I'm trying to list a group of items


Left: item one, Right: Item 2


This is repeated

I can only seem to get them to go str8 down not left then right.


Any Ideas?

/ Mark

--- End Message ---
--- Begin Message ---
Dude, Can you not use something like

while ....

and then add a for ($i=1 to ... lodgic...

(o;

----- Original Message ----- 
From: "Mark Tehara" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Cc: "Philip J. Newman" <[EMAIL PROTECTED]>
Sent: Wednesday, July 02, 2003 3:56 PM
Subject: [PHP] Items displayed left and right, help newman.


Where should i start with the lodgic.  I'm trying to list a group of items


Left: item one, Right: Item 2


This is repeated

I can only seem to get them to go str8 down not left then right.


Any Ideas?

/ Mark


--- End Message ---
--- Begin Message ---
On Jul 2, 2003, "Mark Tehara" claimed that:

|Where should i start with the lodgic.  I'm trying to list a group of items
|
|
|Left: item one, Right: Item 2
|
|
|This is repeated
|
|I can only seem to get them to go str8 down not left then right.
|
|
|Any Ideas?
|
|/ Mark

Perhaps you want an html table?

Maybe using a counter of some sort to keep track of your <tr> <td> left
</td> <td> right </td> </tr>?

Perhaps you want to use <pre>to output left item, 20-strlen(left_item)
spaces, right item \n?

Perhaps to pull the values, your counter will increment by 2.
value[counter] on left, value[counter+1] on right?

Perhaps create the page in only html the way you want it to appear, then
look for patterns that can be created by looping through a logic structure
(like www.netfobs.org/dates.php)?

Jeff

-- 
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



--- End Message ---
--- Begin Message --- PHP 4.3.2 has GD bundled with it, if you compile it from source do --with-gd to use the bundled library. It sounds like you need to install GD2, you can find it on freshmeat.net or probably find an RPM for your distro somewhere.

If you have libjpeg and libpng I've had no problems using the bundled GD library with PHP, if you take the PHP compile line from phpinfo() it should be pretty easy to recompile your PHP and at the same time upgrade to 4.3.2 :).

Take a look at http://www.php.net/manual for install instructions if you need more information.

Jason

David Miller wrote:

Hello

I hope someone can help me.

I use my local machine to develop and then upload to whatever site.

I have one site that does some image resizing, uses a call to imagecreatetruecolor.
Works fine on the host and used to work fine on my local machine. But now that I come back to make some changes it no longer works on local machine.


I get this warning: Warning: imagecreatetruecolor(): requires GD 2.0 or later.

I was using RedHat 8.0 and a short time back I ran up2date that upgraded the php but not the gd. I think this is where the problem came in.

I tried to upgrade gd but there were dependicies that seem like it would reguire updating half the system. If I remember gd 2.0 wanted db4.1 and db4.0 is used by many, many things.

I thought it would be easier to simply upgrade from RedHat 8 to RedHat 9 which is what I did. It took me all day to get everything straighened out and running again but I still have the same problem getting the same warning.

If I run a script that contains the following:
<?php

// Show all information, defaults to INFO_ALL
phpinfo();

?>
I am told that I am now running PHP Version 4.2.2 and if I go down to the gd section the second line says GD Version 1.6.2 or higher.
I tried uninstalling and reinstalling the php but this didn't help.


Thanks

David Miller




--- End Message ---
--- Begin Message --- Take a look at safe_mode_gid, it tells PHP to do safe mode owner checking using the group id rather than user id.

safe_mode_gid boolean

By default, Safe Mode does a UID compare check when opening files. If you want to relax this to a GID compare, then turn on safe_mode_gid. Whether to use UID (FALSE) or GID (TRUE) checking upon file access.

http://www.php.net/manual/en/features.safe-mode.php

Other than that consider turning off safe mode if you have access to it, or turn it off for your virtual host.

Jason




Paul Chvostek wrote:


I've got a script whose configuration creates a storage directory owned
by the web server in which files get stored, also owned by the web
server.  With safe_mode in effect, I'm getting errors like:

Warning: file_exists() [function.file-exists]: SAFE MODE Restriction in effect. The script whose uid is 10054 is not allowed to access /path/to/some/data owned by uid 80 in /path/to/some/file.php on line 111

Wouldn't it make sense for safe_mode also to allow read access to files
owned by the web server's process as well as the directory owner's?

Obviously, a process running as uid 80 won't be able to suid to another
user.  If I make the directory owned by the user, the files will be
inaccessible, but if I make the directory uid 80, then *it* will be
inaccessible.

Is there some other solution to storing (and then retrieving) files with
safe_mode on?

Thanks.





--- End Message ---
--- Begin Message ---
Jason,

safe_mode_gid may indeed be the solution, though it seems to go way too
far in relaxing things.

It's the functionality of safe_mode that I want ... with the proviso
that the web server should be able to read files that it writes.

I will not consider turning off safe_mode entirely, any more than I will
consider giving customers shell access to my servers.  That would seem
to be foolhardy.  But that may just be the paranoia talking.

p


On Tue, Jul 01, 2003 at 10:19:01PM -0700, Jason Sheets wrote:
> 
> Take a look at safe_mode_gid, it tells PHP to do safe mode owner 
> checking using the group id rather than user id.
> 
> safe_mode_gid boolean
> 
> By default, Safe Mode does a UID compare check when opening files. If 
> you want to relax this to a GID compare, then turn on safe_mode_gid. 
> Whether to use UID (FALSE) or GID (TRUE) checking upon file access.
> 
> http://www.php.net/manual/en/features.safe-mode.php
> 
> Other than that consider turning off safe mode if you have access to it, 
> or turn it off for your virtual host.
> 
> Paul Chvostek wrote:
> >I've got a script whose configuration creates a storage directory owned
> >by the web server in which files get stored, also owned by the web
> >server.  With safe_mode in effect, I'm getting errors like:
> >
> > Warning: file_exists() [function.file-exists]: SAFE MODE Restriction in 
> > effect. The script whose uid is 10054 is not allowed to access 
> > /path/to/some/data owned by uid 80 in /path/to/some/file.php on line 111
> >
> >Wouldn't it make sense for safe_mode also to allow read access to files
> >owned by the web server's process as well as the directory owner's?
> >
> >Obviously, a process running as uid 80 won't be able to suid to another
> >user.  If I make the directory owned by the user, the files will be
> >inaccessible, but if I make the directory uid 80, then *it* will be
> >inaccessible.
> >
> >Is there some other solution to storing (and then retrieving) files with
> >safe_mode on?

-- 
  Paul Chvostek                                             <[EMAIL PROTECTED]>
  it.canada                                            http://www.it.ca/
  Free PHP web hosting!                            http://www.it.ca/web/


--- End Message ---
--- Begin Message ---
Does anyone know of a PHP user group near Gurnee, IL.  I found one in
Chicago, but its a little far to go and they meet in the middle of the day
on Sat.



--- End Message ---
--- Begin Message ---
Hi,
Can somebody say how can I get all vars and their values from a script.



--- End Message ---
--- Begin Message ---
get_defined_vars (); ?

Slava wrote:
> Hi,
> Can somebody say how can I get all vars and their values from a
> script.



--- End Message ---
--- Begin Message ---
On Tue, 01 Jul 2003 22:38:38 -0700, John wrote:

>When using mod_rewrite, is there any way to post variables from a form the
>way you want to.
>
>eg 
>a text box called first name
>another textbox called second name
>action being http://www.searcher.com/search
>
>and the result being
>http://www.searcher/search/firstname/secondname
>
>is this possible?? i dont think so

Errrr... I'm not totally sure I understand what you are asking for, but
I do know the following should work:

1)  Create a index.php file in the /search/ directory that expects two
"GET" parameters.

2)  Set up the following mod_rewrite:

RewriteRule   /search/([^/]+)/(.+) 
/www/htdocs/search/index.php?First=$1&Last=$2

Should allow this:

> http://www.searcher.com/search/firstname/secondname

to call index.php as:

> http://www.searcher/search/index.php?First=firstname&Second=secondname

Hope this helps.


--- End Message ---
--- Begin Message ---
Hi All

I think I missed a bit to my Basic Auth issue which I hope to clarify here.

1) User successfully logins into my UNIX/Apache/Php site using my
MySql/SESSION/$_POST combo.

2) Now I need to send a username:password pair to a Windows box to allow
access to a Basic Auth protected resource on the Win box.

3) The aim is to seamlessly pass the u:p pair to the win box for auth and
allow my user to access the resource.

I thought that after doing my checking than sending the u:p pair like this:

http://username:[EMAIL PROTECTED]://10.0.0.1/dir in a similar fashion to browser
ftping would do the trick but it doesn't .

Can anyone help me with this please.

Server 1 = FreeBSD/Apache1.3/PHP.4.3

Server 2 = Win2K Server

Thanks in advance for any help

Dave C

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.493 / Virus Database: 292 - Release Date: 25/06/2003
 


--- End Message ---
--- Begin Message ---
> > You'll have to learn to adjust then I guess. And do those 2k really
> > matter? Come on...  Just get a good mailer that defaults to 
> > "Reply-All"
> > (like, mutt, pine, pcpine)
> 
> Some of us don't have the choice -- we work in a corporate or institutional 
> environment where the decision is made centrally.  (Hence M$ Outlook 98 here!!!)

There is a setting in MSOutlook/MSOE to wrap your lines, say, at 62 or
70.

I don't remember my experiences with MSOE on Mac very well, but MSOE on
MSW2k had little triangles on buttons in various places. If you hit the
button, you got the standard function. If you hit the triangle, you got
a pop-up menu. Pop-up menu for replies included basically all the
potential reply addresses (according to MS judgement of potential reply
addresses). Look around, maybe you can find something like that on
MSOutlook 98.

<rambling>
We had some virus problems here last year, and now MS mail clients are
banned. The company standardized on Becky for the MSWxx boxes, which is
a really nice client, all sorts of features for mailing lists,
newsgroups, etc. The filter setup is a little weird, but it works great.
So I am beginning to forget the "conveniences" of MSOE on MSW2k, as well,
which is not something I mind forgetting.

But I have to admit, I find it puzzling why copy/pasting a mail address
should be considered such an inconvenience. I admit, copy/paste on MSWxx
feels clumsier than on a Mac, but the operations are fundamental to GUI.

I also find it a puzzle why so many companies seem to think that
MSOutlook's advantages outweigh the problems of having to bolt antivirus
on everything (and the occasional slip-through that then proceeds to
dirty entire subnets), but that is a separate topic.
</rambling>

-- 
Joel Rees, programmer, Kansai Systems Group
Altech Corporation (Alpsgiken), Osaka, Japan
http://www.alpsgiken.co.jp


--- End Message ---
--- Begin Message ---
> Hi,
> 
> > I told him that support for PHP was compiled into Apache and that it
> > would be impractical. I asked if he wanted the DB on another box. I
> > asked if he wated the scripts on another box. I am quite sure that there
> > is no particular logic behind the request as I have not received any
> > answers. If he tells me more I'll let you know.
> 
>       We had a request for this type of setup a couple months ago.  The only
> logic behind it was a guy who didn't have any idea what he was talking about
> reading somewhere that you should have 3 servers per application you setup.
> 1. Web Server, 2. File Server,

File server, of course, has nothing to do with php unless you write the
file server in php. 8*| Or, perhaps that mod_php is usually compiled
into the file server.

(Is this possibly echos of iSCSI?)

> 3. DB Server.  After we all got done laughing
> him off the phone call, we setup 2 servers, 1. Web/Files, 2. DB.
> Fortunately he decided to listen that day.

Perhaps what he meant by web server was firewall (i. e., handling the
internet interface), and by file server he meant what we now call web
server (i. e., presenting the view of the file system that the outside
world is supposed to see)?

-- 
Joel Rees, programmer, Kansai Systems Group
Altech Corporation (Alpsgiken), Osaka, Japan
http://www.alpsgiken.co.jp


--- End Message ---
--- Begin Message ---
> I don't know the details of this request (like why., but as soon as I
> know I'll tell you) but can Apache live on one box with all PHP requests
> being handled on another box?

Yeah, but what you're likely to end up with is apache on one machine
just passing requests to and from apache-mod_php-your_app on another
machine.

Or, you could use some other web server on the second machine, might
even be something dead-simple, like a shell process running command-line
PHP (don't do that unless you know how and why already) or a perl (php?)
script that passes things on to the PHP cgi. 

Are you familiar with Tomcat?

The typical production arrangement with Tomcat, except for sites that
use very little static html, is to have Apache handle the static html,
and Tomcat handle the jsp/java. Apache and Tomcat can definitely be on 
separate machines.

I think I have read somewhere reports of some project working to set up
a similar special-purpose php-template server for php, but that may be
just my imagination.

-- 
Joel Rees, programmer, Kansai Systems Group
Altech Corporation (Alpsgiken), Osaka, Japan
http://www.alpsgiken.co.jp


--- End Message ---
--- Begin Message ---
helo all ,

what command in linux , to see default direcktory instalation mysql
database dan mysql library


##############################################
With best regards !
Roy Daniel , ST
IT Application Support & Development Engineer - PT BERCA
[EMAIL PROTECTED]  // [EMAIL PROTECTED]
ICQNumber : # 103507581 // Phone Cell : 0816-1192832
##############################################


--- End Message ---
--- Begin Message --- Hello,

On 07/02/2003 04:05 AM, [EMAIL PROTECTED] wrote:
what command in linux , to see default direcktory instalation mysql
database dan mysql library

./configure ?



--


Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/


--- End Message ---
--- Begin Message ---
locate mysql.lib?

Can you be a bit more specific?


Marco

On Wed, 2003-07-02 at 03:05, [EMAIL PROTECTED] wrote:
> helo all ,
> 
> what command in linux , to see default direcktory instalation mysql
> database dan mysql library
> 
> 
> ##############################################
> With best regards !
> Roy Daniel , ST
> IT Application Support & Development Engineer - PT BERCA
> [EMAIL PROTECTED]  // [EMAIL PROTECTED]
> ICQNumber : # 103507581 // Phone Cell : 0816-1192832
> ##############################################
-- 

Marco Tabini
President

Marco Tabini & Associates, Inc.
28 Bombay Avenue
Toronto, ON M3H 1B7
Canada

Phone: (416) 630-6202
Fax: (416) 630-5057
Web: http://www.tabini.ca


--- End Message ---
--- Begin Message ---
Hello,

I need to be able to communicate from a Java Applet to a PHP program on the
server to enable "Live Connect" for data. This is what I intend to do:

In my web application, a Java Script program will call a Java Applet which
then calls the PHP program on the server. The PHP program works like a
"servlet" and passes the result back to the Java applet which passes the
information back to the JavaScript program.

How can a Java applet work with a PHP program? Are there any special
precautions / programming issues involved?

Thanks in advance

With Regards,
Sharat

*********************************************************************
Disclaimer: The information in this e-mail and any attachments is
confidential / privileged. It is intended solely for the addressee or
addressees. If you are not the addressee indicated in this message, you may
not copy or deliver this message to anyone. In such case, you should destroy
this message and kindly notify the sender by reply email. Please advise
immediately if you or your employer does not consent to Internet email for
messages of this kind.
*********************************************************************

--- End Message ---
--- Begin Message --- Sharat Hegde wrote:

Hello,

I need to be able to communicate from a Java Applet to a PHP program on the
server to enable "Live Connect" for data. This is what I intend to do:

In my web application, a Java Script program will call a Java Applet which
then calls the PHP program on the server. The PHP program works like a
"servlet" and passes the result back to the Java applet which passes the
information back to the JavaScript program.

How can a Java applet work with a PHP program? Are there any special
precautions / programming issues involved?

Thanks in advance

With Regards,
Sharat

Not anything that you wouldn't have to pay attention to in passing stuff between applications in other instances.

I'd use XML/SOAP to pass around the data. There are many reasons to do this, I wont list them here just because there are plenty of articles on the web advocating the use of XML. The added bonus is the buzzword factor.




--- End Message ---
--- Begin Message ---
Thanks Justin,

Do you have any leads on where I can get info on accessing XML data using
SOAP from a Java Applet. I know how to parse XML data.

Regards,
Sharat Hegde
Phone: 6575800 Ext 4610
Direct: 6566615


-----Original Message-----
From: justin gruenberg [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 02, 2003 1:27 PM
To: Sharat Hegde
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Java Applet to PHP Communication


Sharat Hegde wrote:

>Hello,
>
>I need to be able to communicate from a Java Applet to a PHP program on the
>server to enable "Live Connect" for data. This is what I intend to do:
>
>In my web application, a Java Script program will call a Java Applet which
>then calls the PHP program on the server. The PHP program works like a
>"servlet" and passes the result back to the Java applet which passes the
>information back to the JavaScript program.
>
>How can a Java applet work with a PHP program? Are there any special
>precautions / programming issues involved?
>
>Thanks in advance
>
>With Regards,
>Sharat
>
Not anything that you wouldn't have to pay attention to in passing stuff 
between applications in other instances.

I'd use XML/SOAP to pass around the data.  There are many reasons to do 
this, I wont list them here just because there are plenty of articles on 
the web advocating the use of XML.  The added bonus is the buzzword factor.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
*********************************************************************
Disclaimer: The information in this e-mail and any attachments is
confidential / privileged. It is intended solely for the addressee or
addressees. If you are not the addressee indicated in this message, you may
not copy or deliver this message to anyone. In such case, you should destroy
this message and kindly notify the sender by reply email. Please advise
immediately if you or your employer does not consent to Internet email for
messages of this kind.
*********************************************************************

--- End Message ---
--- Begin Message ---
you want to use either dom or saxon to parse the xml within java. So
your applet can call some class that loads, parses and then does
something with the xml.

Usually you want to use a sax parser for the speed, however you can use
a dom parser to manipulate the dom tree...

--
BigDog


On Wed, 2003-07-02 at 05:02, Sharat Hegde wrote:
> Thanks Justin,
> 
> Do you have any leads on where I can get info on accessing XML data using
> SOAP from a Java Applet. I know how to parse XML data.
> 
> Regards,
> Sharat Hegde
> Phone: 6575800 Ext 4610
> Direct: 6566615
> 
> 
> -----Original Message-----
> From: justin gruenberg [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 02, 2003 1:27 PM
> To: Sharat Hegde
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Java Applet to PHP Communication
> 
> 
> Sharat Hegde wrote:
> 
> >Hello,
> >
> >I need to be able to communicate from a Java Applet to a PHP program on the
> >server to enable "Live Connect" for data. This is what I intend to do:
> >
> >In my web application, a Java Script program will call a Java Applet which
> >then calls the PHP program on the server. The PHP program works like a
> >"servlet" and passes the result back to the Java applet which passes the
> >information back to the JavaScript program.
> >
> >How can a Java applet work with a PHP program? Are there any special
> >precautions / programming issues involved?
> >
> >Thanks in advance
> >
> >With Regards,
> >Sharat
> >
> Not anything that you wouldn't have to pay attention to in passing stuff 
> between applications in other instances.
> 
> I'd use XML/SOAP to pass around the data.  There are many reasons to do 
> this, I wont list them here just because there are plenty of articles on 
> the web advocating the use of XML.  The added bonus is the buzzword factor.
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> *********************************************************************
> Disclaimer: The information in this e-mail and any attachments is
> confidential / privileged. It is intended solely for the addressee or
> addressees. If you are not the addressee indicated in this message, you may
> not copy or deliver this message to anyone. In such case, you should destroy
> this message and kindly notify the sender by reply email. Please advise
> immediately if you or your employer does not consent to Internet email for
> messages of this kind.
> *********************************************************************


--- End Message ---
--- Begin Message ---
Hello,

Is there any template-processing programme designed for PHP5?

Thanks!

Jupiter



--- End Message ---
--- Begin Message ---
Hi,

I'm working on a CMS like system. Its uses heavly SQL for page rendering. 
Yesterday I made a stress test. System stable for just 30 secs (for 60 
request per sec, An Athlon750 with 320 mb ram). My investigation is Apache 
stalls when writing sessions. System uses sessions for store sniffed browser 
information.

Which is faster, writing 2 or 3 k data into session or sql db (after 
serializing)

Thanks.


--- End Message ---
--- Begin Message ---
please i need like those classes , because i have to read from XML and
insert into MySQL..

Nabil


"Stephen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> There are a lot of classes that parse XML files. I can send you a few
> functions I made myself to parse a paticular type of XML file. It should
> help you get started.
>
> With bubblegum in my shoe,
> Stephen Craton
> Senior Executive Web Developer
> Mophus.com, Inc.
>
>
> ----- Original Message -----
> From: <Denis C (ahuk <[EMAIL PROTECTED]>)>
> To: "PHP List" <[EMAIL PROTECTED]>
> Sent: Monday, June 30, 2003 12:58 PM
> Subject: [PHP] Geting information from XML
>
>
> Can someone tell how to get information from an XML file, without the F*
> commands, in PHP?
>
> e.g.:
> <? xml version=1.0 ?>
> <messages>
> <subject>Hello</subject>
> </messages>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>



--- End Message ---
--- Begin Message ---
Hello


i plan to reorganize my CMS code.
The idee is to only use classes for the hole system.

There should be a Core class to handle the whole functionality
(Login, Backend, Permission, Modules)

Every Module as a class (News, Pictures ...)

the construct should be like this


class Core extends Backend {
}

class Backend extends News {
}

class News {
}


if i have more modules as only one  class Backend must extends News,
Pictures ....

i could make a temp class to extend the Module only if the module is
called

class Backend extends Temp {
}

rquire_once 'class to inlude in case of Module'


--- file for class News ----
class Temp extends News {
}

class News {
}


--- file for class Picture ---
class Temp extends Picture {
}

class Picture {
}


in this case I must always write the Temp class in every Module Class

maybe there is a ohter solution for this ?


I'm working with ITX_Templates, DB from PEAR and wenn i split the
classes i must always assign the objects to the other classes.


BR Torsten 










--- End Message ---
--- Begin Message ---
off tangent slightly -
Have u looked at smarty templates
smarty.php.net
Must admit I played with ITX and a few others but smarty wins for me

pete

Torsten Rosenberger wrote:
Hello


i plan to reorganize my CMS code. The idee is to only use classes for the hole system.

There should be a Core class to handle the whole functionality
(Login, Backend, Permission, Modules)

Every Module as a class (News, Pictures ...)

the construct should be like this


class Core extends Backend { }

class Backend extends News {
}

class News {
}


if i have more modules as only one class Backend must extends News, Pictures ....

i could make a temp class to extend the Module only if the module is
called

class Backend extends Temp {
}

rquire_once 'class to inlude in case of Module'


--- file for class News ---- class Temp extends News { }

class News {
}


--- file for class Picture --- class Temp extends Picture { }

class Picture {
}


in this case I must always write the Temp class in every Module Class


maybe there is a ohter solution for this ?


I'm working with ITX_Templates, DB from PEAR and wenn i split the classes i must always assign the objects to the other classes.


BR Torsten












--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Kyle Babich [mailto:[EMAIL PROTECTED]
> Sent: 02 July 2003 00:19
> 
> I think this is short example of my problem...
> 
> <?php
> 
> $name = 'kyle';
> 
> function hello() {
>     print 'hello ' . $name;
>     $x = 1;
> }
> 
> function bye() {
>     if ($x == 1) print 'x = 1';
>     else print 'x != 1';
> }
> 
> hello();
> bye();
> 
> ?>
> 
> Right now this returns:  hello x != 1
> What do I have to do to get bye() to return 'x = 1'? I tried declaring
> the x = 1 in hello() global and I tried declaring it static.

Possibilities:

  function hello($x) {
     print 'hello ' . $name;
     $x = 1;
  }
 
  function bye($x) {
     if ($x == 1) print 'x = 1';
     else print 'x != 1';
  }
 
  hello($y);
  bye($y);

--------------

  function hello() {
     print 'hello ' . $name;
     $x = 1;
     return $x;
  }
 
  function bye($x) {
     if ($x == 1) print 'x = 1';
     else print 'x != 1';
  }
 
  $y = hello();
  bye($y);

--------------

  function hello() {
  global $x;
     print 'hello ' . $name;
     $x = 1;
  }
 
  function bye() {
  global $x;
     if ($x == 1) print 'x = 1';
     else print 'x != 1';
  }
 
  hello();
  bye();


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

--- End Message ---
--- Begin Message --- Hi,

I need to manipulate a string to insert a space 3 characters from the right end.

eg: turn 'ng23fgh' into 'ng23 fgh', or 'hfdgskfjgh23kj' into 'hfdgskfjgh2 3kj'.

Any help gratefully received.

Matt


--- End Message ---
--- Begin Message --- from the manual

Example 1. Basic substr() usage

<?php
$rest = substr("abcdef", 1);    // returns "bcdef"
$rest = substr("abcdef", 1, 3); // returns "bcd"
$rest = substr("abcdef", 0, 4); // returns "abcd"
$rest = substr("abcdef", 0, 8); // returns "abcdef"

// Accessing via curly braces is another option
$string = 'abcdef';
echo $string{0};                // returns a
echo $string{3};                // returns d
?>

If start is negative, the returned string will start at the start'th character from the end of string.

Example 2. Using a negative start

<?php
$rest = substr("abcdef", -1);    // returns "f"
$rest = substr("abcdef", -2);    // returns "ef"
$rest = substr("abcdef", -3, 1); // returns "d"
?>

have fun

Pete

Matt Macleod wrote:
Hi,

I need to manipulate a string to insert a space 3 characters from the right end.

eg: turn 'ng23fgh' into 'ng23 fgh', or 'hfdgskfjgh23kj' into 'hfdgskfjgh2 3kj'.

Any help gratefully received.

Matt



--- End Message ---
--- Begin Message ---

I currently have all my users in safe-mode to prevent them from running
shell commands via php.

I would still like for them to be able to access certain folders (i.e. PEAR,
basic_functions, etc..) that reside out of their root.

Since safe_mode prevents this, is there a way in the domain's config, to
allow access to *specific* directories when in safe_mode?


TIA



+--------------------------------------------+
Mike Yrabedra (President)
323 Incorporated 
Home of MacDock, MacAgent and MacSurfshop
+--------------------------------------------+
W: http://www.323inc.com/
P: 770.382.1195
F: 734.448.5164
E: [EMAIL PROTECTED]
I: ichatmacdock
+--------------------------------------------+
"Whatever you do, work at it with all your heart,
as working for the Lord, not for men."
~Colossians 3:23 <{{{><
+--------------------------------------------+



--- End Message ---
--- Begin Message ---
if you are on a linux system, you could always symlink the folders into the
public_html dir.

Jim Lucas
----- Original Message -----
From: "MIKE YRABEDRA" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Wednesday, July 02, 2003 5:36 AM
Subject: [PHP] Using INCLUDES in SAFE MODE


>
>
> I currently have all my users in safe-mode to prevent them from running
> shell commands via php.
>
> I would still like for them to be able to access certain folders (i.e.
PEAR,
> basic_functions, etc..) that reside out of their root.
>
> Since safe_mode prevents this, is there a way in the domain's config, to
> allow access to *specific* directories when in safe_mode?
>
>
> TIA
>
>
>
> +--------------------------------------------+
> Mike Yrabedra (President)
> 323 Incorporated
> Home of MacDock, MacAgent and MacSurfshop
> +--------------------------------------------+
> W: http://www.323inc.com/
> P: 770.382.1195
> F: 734.448.5164
> E: [EMAIL PROTECTED]
> I: ichatmacdock
> +--------------------------------------------+
> "Whatever you do, work at it with all your heart,
> as working for the Lord, not for men."
> ~Colossians 3:23 <{{{><
> +--------------------------------------------+
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--- End Message ---
--- Begin Message ---
Hello everyone,
 
I have a form that gets filled out and within this form there is a link
to add additional information in a new form. When this information is
saved I would like the browser to redirect to the previous form (this I
can do) but with all the details they have already filled out still in
the text boxes. What is the easiest way to do this using PHP?
 
Many thanks
 
Gary Ogilvie

--- End Message ---
--- Begin Message ---
[snip] 
I have a form that gets filled out and within this form there is a link
to add additional information in a new form. When this information is
saved I would like the browser to redirect to the previous form (this I
can do) but with all the details they have already filled out still in
the text boxes. What is the easiest way to do this using PHP?
 [/snip]


By maintaining the POST (assuming you're using POST)variables and
calling them into the form values when reloaded. If you go to the second
page store the POST variables in hidden form input types, then grab them
when the second page is POSTED. Does this make sense? Not enough
caffeine for me yet...

Jay

--- End Message ---
--- Begin Message ---
[snip]
By maintaining the POST (assuming you're using POST)variables and
calling them into the form values when reloaded. If you go to the second
page store the POST variables in hidden form input types, then grab them
when the second page is POSTED. Does this make sense? Not enough
caffeine for me yet...[/snip]

So basically I need to have 2 versions of the first page, is that right?
:)


--- End Message ---
--- Begin Message ---
[snip]
By maintaining the POST (assuming you're using POST)variables and
calling them into the form values when reloaded. If you go to the second
page store the POST variables in hidden form input types, then grab them
when the second page is POSTED. Does this make sense? Not enough
caffeine for me yet...[/snip]

So basically I need to have 2 versions of the first page, is that right?
:)
[/snip]

Not really, test for emptiness of the variable (isset())...if it is set
display it, if not show it as blank.

HTH!

Jay

--- End Message ---
--- Begin Message ---
[snip]
Not really, test for emptiness of the variable (isset())...if it is set
display it, if not show it as blank.

HTH!

Jay
[/snip]

You'll have to forgive me as I am unfamiliar with PHP, still a
beginner!! So if I have a page (page1.php) which is my first page with a
form. When I click a normal link within this form it takes me to
page2.php. This page has another smaller form. When the submit button in
this form is clicked it updates the database with no problems and
displays a link - linking back to page1.php (I have decided not to use
redirect). How do load the page and fill all the text boxes with the
information that was already written - because this information (from
page1.php, first form) has not been saved to the database yet.

You probably knew this anyway - but I had to go through that process to
satisfy myself!!

Many Thanks

Gary Ogilvie


--- End Message ---
--- Begin Message --- On Wed, 2 Jul 2003 14:45:27 +0100, Gary Ogilvie <[EMAIL PROTECTED]> wrote:

[snip]
By maintaining the POST (assuming you're using POST)variables and
calling them into the form values when reloaded. If you go to the second
page store the POST variables in hidden form input types, then grab them
when the second page is POSTED. Does this make sense? Not enough
caffeine for me yet...[/snip]

So basically I need to have 2 versions of the first page, is that right?
:)


No, in your first form you have code like

<?php
 if ((!isset($_POST)) || (!isset($_POST['foo']))) {
        $foo = <set default value here>;
 } else {
        $foo = $_POST['foo'];
 }
?>

<form method="post" action="form2.php">
 <input type="text" name=foo value="<?php echo $foo;?>" />
 ...
</form>

and in the second form you have:

<form method="post" action="form1.php">
 <input type="hidden" name=foo value="<?php echo $_POST['foo'];?>" />
 ...
</form>

Cheers, Greg.
--
Greg Wiley
www.wileysworld.org


--- End Message ---
--- Begin Message ---
Ah I understand that - many thanks.

-----Original Message-----
From: Greg Wiley [mailto:[EMAIL PROTECTED] 
Sent: 02 July 2003 14:59
To: Gary Ogilvie; 'PHP General'
Subject: Re: [PHP] Forms & PHP

On Wed, 2 Jul 2003 14:45:27 +0100, Gary Ogilvie
<[EMAIL PROTECTED]> 
wrote:

> [snip]
> By maintaining the POST (assuming you're using POST)variables and
> calling them into the form values when reloaded. If you go to the
second
> page store the POST variables in hidden form input types, then grab
them
> when the second page is POSTED. Does this make sense? Not enough
> caffeine for me yet...[/snip]
>
> So basically I need to have 2 versions of the first page, is that
right?
> :)
>
>
No, in your first form you have code like

<?php
  if ((!isset($_POST)) || (!isset($_POST['foo']))) {
        $foo = <set default value here>;
  } else {
        $foo = $_POST['foo'];
  }
?>

<form method="post" action="form2.php">
  <input type="text" name=foo value="<?php echo $foo;?>" />
  ...
</form>

and in the second form you have:

<form method="post" action="form1.php">
  <input type="hidden" name=foo value="<?php echo $_POST['foo'];?>" />
  ...
</form>

Cheers, Greg.
-- 
Greg Wiley
www.wileysworld.org


--- End Message ---
--- Begin Message ---
[snip]
You'll have to forgive me as I am unfamiliar with PHP, still a
beginner!! So if I have a page (page1.php) which is my first page with a
form. When I click a normal link within this form it takes me to
page2.php. This page has another smaller form. When the submit button in
this form is clicked it updates the database with no problems and
displays a link - linking back to page1.php (I have decided not to use
redirect). How do load the page and fill all the text boxes with the
information that was already written - because this information (from
page1.php, first form) has not been saved to the database yet.

You probably knew this anyway - but I had to go through that process to
satisfy myself!!
[/snip]

If you are just clicking on a link instead of submitting the information
you have not populated any variables...so no recall is available unless
the clicked link is formatted to hold the variables (a GET). For
instance

<a href = "someotherpage.php?name=Gary">Click Here</a>

$_GET['name'] is equal to "Gary"

You can do it for more than one variable...

<a href = "someotherpage.php?name=Gary&address=Chicago">Click Here</a>

$_GET['name'] is equal to "Gary"
$_GET['address'] is equal to "Chicago"


HTH!

Jay

--- End Message ---
--- Begin Message ---
Hello,

The folowing code gives an error:

print "<?xml version=\"1.0\"?>";

This is probably because I print a questionmark? How can I avoid that an
error is generated?

Besides it's not an error in the way that it gives an errorstring but it
writes the output in the error_log of apache...

Greetings,

-- 
Steven Apostolou <[EMAIL PROTECTED]>


--- End Message ---
--- Begin Message ---
Question mark's are not special or reserved in strings
like $'s are. That shouldn't be the problem.



On Wed, 2003-07-02 at 09:33, Steven Apostolou wrote:
> Hello,
> 
> The folowing code gives an error:
> 
> print "<?xml version=\"1.0\"?>";
> 
> This is probably because I print a questionmark? How can I avoid that an
> error is generated?
> 
> Besides it's not an error in the way that it gives an errorstring but it
> writes the output in the error_log of apache...
> 
> Greetings,
> 
> -- 
> Steven Apostolou <[EMAIL PROTECTED]>
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


--- End Message ---
--- Begin Message ---
[snip]
print "<?xml version=\"1.0\"?>";

This is probably because I print a questionmark? How can I avoid that an
error is generated?

Besides it's not an error in the way that it gives an errorstring but it
writes the output in the error_log of apache...
[/snip]

Search the archives of this list, the subject comes up often.

HTH!

Jay

--- End Message ---
--- Begin Message ---
Disable short open tags.

yann

On Wed, 2003-07-02 at 09:33, Steven Apostolou wrote:
> Hello,
> 
> The folowing code gives an error:
> 
> print "<?xml version=\"1.0\"?>";
> 
> This is probably because I print a questionmark? How can I avoid that an
> error is generated?
> 
> Besides it's not an error in the way that it gives an errorstring but it
> writes the output in the error_log of apache...
> 
> Greetings,
> 
> -- 
> Steven Apostolou <[EMAIL PROTECTED]>
-- 
Yann Larrivee <[EMAIL PROTECTED]>


--- End Message ---
--- Begin Message ---
you can always print like so...

print '<?xml version="1.0"?>';

Then the parser does not try to parse inside the line.  However, I dont
know what will happen when you have short_open_tags in your php.ini file
turned on...i usually turn it all of..

--
BigDog


On Wed, 2003-07-02 at 07:33, Steven Apostolou wrote:
> Hello,
> 
> The folowing code gives an error:
> 
> print "<?xml version=\"1.0\"?>";
> 
> This is probably because I print a questionmark? How can I avoid that an
> error is generated?
> 
> Besides it's not an error in the way that it gives an errorstring but it
> writes the output in the error_log of apache...
> 
> Greetings,
> 
> -- 
> Steven Apostolou <[EMAIL PROTECTED]>
> 


--- End Message ---
--- Begin Message ---
Ok never mind about what I said, brain lapse, I was
focusing so hard on the ? that I didn't realize
it was next to the > . Doh.


On Wed, 2003-07-02 at 09:43, Jay Blanchard wrote:
> [snip]
> print "<?xml version=\"1.0\"?>";
> 
> This is probably because I print a questionmark? How can I avoid that an
> error is generated?
> 
> Besides it's not an error in the way that it gives an errorstring but it
> writes the output in the error_log of apache...
> [/snip]
> 
> Search the archives of this list, the subject comes up often.
> 
> HTH!
> 
> Jay
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


--- End Message ---
--- Begin Message ---
try this

print "<\?xml version=\"1.0\"\?>";


This might fix it.    

----- Original Message ----- 
From: "Steven Apostolou" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 02, 2003 6:33 AM
Subject: [PHP] outputting xml declaration


> Hello,
> 
> The folowing code gives an error:
> 
> print "<?xml version=\"1.0\"?>";
> 
> This is probably because I print a questionmark? How can I avoid that an
> error is generated?
> 
> Besides it's not an error in the way that it gives an errorstring but it
> writes the output in the error_log of apache...
> 
> Greetings,
> 
> -- 
> Steven Apostolou <[EMAIL PROTECTED]>
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


--- End Message ---
--- Begin Message ---
If I've understood your initial email correctly another approach would be to save the 
contents of the form to your database and populate the form fields presented 
subsequently with information retrieved from the database.

You can use the header function to redirect to whatever page you wish once the 
information has been saved.

Regards,

Michael Egan



--- End Message ---
--- Begin Message ---
Wouldn't I then be saving the contents of that page twice in the
database?

-----Original Message-----
From: Michael Egan [mailto:[EMAIL PROTECTED] 
Sent: 02 July 2003 14:53
To: PHP General
Subject: RE: [PHP] Forms & PHP[Scanned]

If I've understood your initial email correctly another approach would
be to save the contents of the form to your database and populate the
form fields presented subsequently with information retrieved from the
database.

You can use the header function to redirect to whatever page you wish
once the information has been saved.

Regards,

Michael Egan



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


--- End Message ---
--- Begin Message ---
I'm trying to get the output of a shell command with PHP 

This is the command I'm Trying to execute, I also tried using system instead
of passthru

 

<?php

          passthru(ftpwho -v, $return_var);

          echo $return_var;

?>

 

Both cases "passthru" and "system" Outputed "2" but should have outputted
something like this:

 

standalone FTP daemon [17899]:

21852 geiri    [ 4h45m] (n/a) STOR /UPLOAD_HERE/moviemusic/The Soprano's -
Music from the HBO Original Series

        KB/s: 143.87

        client: client.client.de [12.2.2.3]

        server: 62.145.135.125:2121 (shiiit.serbinn.com)

        location: /MP3/ Music/

 

Any Idea about what  could be wrong


--- End Message ---
--- Begin Message ---
I don't know much about System or passthru - but doesn't it have to be
something like:

passthru(ftpwho -v, &$return_var);
echo $return_var;

Because it is a reference Parameter und without the "&" the function can't
put the value into $return_var.

Greetings

Kristin Schesonka

>
> passthru(ftpwho -v, $return_var);
> echo $return_var;
>



--- End Message ---
--- Begin Message ---
On Tue, 2003-07-01 at 16:55, Matt Palermo wrote:
> Does anyone know of any built in functions or options for the US states?
Nope no built in function for this...

> I want to make a drop down menu and some other things which have the 50
> states in it.  Is there any shortcut for this with PHP, or do I need to
> do it all manually in HTML?  Please let me know.  Thanks.
You can create your own function to build this for you.

I have always put the 50 states in a database and used that for all my
html and output requirements. You can google state abbreviations and use
that in a database or file.

--
BigDog
 



--- End Message ---
--- Begin Message ---
Thanks all,

I shall try these methods now. I may be a while - the form is pretty
large :)


--- End Message ---
--- Begin Message ---
I'm trying to get the 1st and last day of the current week.  I ty to do
this:
$startofweek = date("Y-m-d",mktime (0,0,0,date("m")
,date("d")-date("w"),date("Y")));
$endofweek = date("Y-m-d",mktime (0,0,0,date("m")
,date("d",strtotime($startofweek))+6,date("Y")));
echo $startofweek." --- ".$endofweek;

$startofweek is correct, but if you run it for a week that has it's
beginning date in an other month (like this week), the $endofweek  is in the
wrong month.  What gives?  If I change -date("w") to -1 or anything else
that stays within the current month, it works.  What do you think?  Is there
a better way to do this?

- Anthony



--- End Message ---
--- Begin Message ---
I have installed PHP numerous times using the same configuration and
this is the first time I have run into this issue.

solaris 2.8 on e3500

apache 1.3.27 ( --enable-module=so --prefix=/usr/local/apache)
php 4.3.2     ( --with-apxs
                --with-mysql
                --with-mssql=/usr/local/freetds
                --enable-ftp
                --with-mcrypt=/usr/local
                --with-pear
                --with-zlib )

mcrypt, freetds both installed fine
installation of PHP is fine

attempt to restart apache give:

Syntax error on line 205 of /usr/local/apache/conf/httpd.conf:
Cannot load /usr/local/apache/libexec/libphp4.so into server: ld.so.1:
/usr/local/apache/bin/httpd: fatal: relocation error: file
/usr/local/apache/libexec/libphp4.so: symbol ap_block_alarms: referenced
symbol not found

Google of this error returns some issues with zlib around the php 4.0 -
4.2 versions.

any thoughts would be extremely helpful.  

mike



--- End Message ---

Reply via email to