php-general Digest 8 Aug 2004 05:24:39 -0000 Issue 2924

Topics (messages 193089 through 193119):

looking for a solid/good basic registration/login app/script
        193089 by: bruce
        193090 by: Jason Wong
        193091 by: Robby Russell
        193094 by: Torsten Roehr

Re: Holding links in a database
        193092 by: Robby Russell

Re: SQL Join query
        193093 by: Mattias Thorslund
        193098 by: raditha dissanayake

Security Code w/o Image PHP
        193095 by: Eugene Voznesensky
        193105 by: Josh Acecool M

regex help and file question
        193096 by: PHP Gen
        193097 by: Torsten Roehr
        193100 by: PHP Gen

Flush()....go to bottom of page (might be 0T)
        193099 by: PHP Gen
        193101 by: John Holmes
        193108 by: PHP Gen

Re: Advise on parsing XML
        193102 by: Gerard Samuel

Local version works - production breaks
        193103 by: Andre Dubuc
        193104 by: Josh Acecool M
        193106 by: Robby Russell
        193107 by: Andre Dubuc
        193109 by: Justin Patrin
        193110 by: Andre Dubuc
        193111 by: Ed Lazor
        193112 by: Robby Russell
        193114 by: Andre Dubuc
        193117 by: Josh Acecool M
        193118 by: Josh Acecool M

annoying autoreplies
        193113 by: Robby Russell

Re: POST superglobal is empty [RESOLVED]
        193115 by: AJL

Re: safe_mode restriction
        193116 by: Kevin

Function Mail
        193119 by: Juan Pablo Herrera

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 ---
hi...

i'm looking for a good/solid login/registration script that's in the open
source domain.

it can have it's own db/table structure. i can always rearchitect...

i'd like it to have an admin function, and the ability to verify users via
email, etc...

anybody have a favorite/good app that they've used/implemented.

i've look through lots of scripts, and decided to check here for additional
input.

thanks

-bruce

--- End Message ---
--- Begin Message ---
On Sunday 08 August 2004 01:43, bruce wrote:

> i've look through lots of scripts, and decided to check here for additional
> input.

It would be helpful to list what you have looked at along with some notes of 
what you perceive to be their pros and cons.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Women, when they are not in love, have all the cold blood of an experienced 
attorney.
                -- Honor'e de Balzac
*/

--- End Message ---
--- Begin Message ---
On Sat, 2004-08-07 at 10:43, bruce wrote:
> hi...
> 
> i'm looking for a good/solid login/registration script that's in the open
> source domain.
> 
> it can have it's own db/table structure. i can always rearchitect...
> 
> i'd like it to have an admin function, and the ability to verify users via
> email, etc...
> 
> anybody have a favorite/good app that they've used/implemented.
> 
> i've look through lots of scripts, and decided to check here for additional
> input.
> 
> thanks
> 
> -bruce

There is Pear::Auth. I've had good experiences working with it.

http://pear.php.net/package/Auth

-Robby

-- 
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
****************************************/

--- End Message ---
--- Begin Message ---
"Robby Russell" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Sat, 2004-08-07 at 10:43, bruce wrote:
> > hi...
> >
> > i'm looking for a good/solid login/registration script that's in the
open
> > source domain.
> >
> > it can have it's own db/table structure. i can always rearchitect...
> >
> > i'd like it to have an admin function, and the ability to verify users
via
> > email, etc...
> >
> > anybody have a favorite/good app that they've used/implemented.
> >
> > i've look through lots of scripts, and decided to check here for
additional
> > input.
> >
> > thanks
> >
> > -bruce
>
> There is Pear::Auth. I've had good experiences working with it.
>
> http://pear.php.net/package/Auth
>
> -Robby

LiveUser is also worth a look:
http://pear.php.net/package/LiveUser

Regards, Torsten Roehr

--- End Message ---
--- Begin Message ---
On Sat, 2004-08-07 at 08:19, Shaun wrote:
> Hi,
> 
> I have a table in my database that holds links for individual pages on my
> site:
> 
> mysql> DESCRIBE Page_Links;
> +-----------+--------------+------+-----+---------+----------------+
> | Field     | Type         | Null | Key | Default | Extra          |
> +-----------+--------------+------+-----+---------+----------------+
> | Link_ID   | int(11)      |      | PRI | NULL    | auto_increment |
> | PHP_SELF  | varchar(100) |      |     |         |                |
> | Action    | varchar(100) |      |     |         |                |
> | Link      | varchar(255) |      |     |         |                |
> | Link_Text | varchar(100) |      |     |         |                |
> +-----------+--------------+------+-----+---------+----------------+
> 5 rows in set (0.00 sec)
> 
> The links that appear on each page depend on PHP_SELF i.e./users/index.php
> and $_GET[action] variable i.e. add_user.
> 
> This all works well until there is a problem with the form validation, for
> example if I am on the add_user.php page and I click to add a user I am
> taken back to the users list, the action is insert_user and I display the
> links accordingly. However if there is a problem with the submission i.e.
> the user leaves a field blank then they are redirected to the add_user.php
> page, the action is still insert_user but I would not want the same links to
> appear on this page.
> 
> Any help on this matter would be greatly appreciated

The method in which you described your issue is rather confusing. Can
you provide some example code and perhaps explain it a bit clearer? 

-Robby


-- 
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
****************************************/

--- End Message ---
--- Begin Message ---
Lenar Lõhmus wrote:

Anyway, instead of writing this:

SELECT pics.*, pic_comments.*, count(*) AS num_comments FROM pics, pic_comments WHERE pics.category = 1 AND pics.id = pic_comments.pic_id GROUP BY pic_comments.pic_id;

Write this:

SELECT pics.*, pic_comments.*, count(*) AS num_comments FROM pics
LEFT JOIN pic_comments ON (pic_comments.pic_id = pics.id)
WHERE pics.category = 1
GROUP BY pics.pic_id;

Lenar


Though, (regardless of SQL database platform) in a case like this, it MAY be both more straightforward and efficient to use two separate queries for the pictures and comments, given the one-to-many cardinality between them. The above statement causes redundant data to be returned - it duplicates the pics record for each new comment. If there are many large columns in the pics table and many comments to each record there's a lot of redundant data in a query like that.

Depending on the nature of your data, this may or may not outweigh the added cost of one more query to the database. The choice will obviously affect the way you have to write your PHP code (hey, now I'm on-topic).
Splitting it up, it could look like this:


SELECT *
FROM pics;

SELECT *, count(*) AS num_comments
FROM pic_comments
GROUP BY pic_id


You may want to add an ORDER BY clause to both of these. People often say it's 'good form' to enumerate your fields in the SELECT clause but benefits of that may vary between database platforms.


Mattias Thorslund
--- End Message ---
--- Begin Message ---
Lenar Lõhmus wrote:

Raditha Dissanayake wrote:



try postgres instead http://www.postgresql.org/



It's the most helpful comment I've seen for a long time.


You are most welcome.


-- Raditha Dissanayake. ------------------------------------------------------------------------ http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar.

--- End Message ---
--- Begin Message ---
How to generate and check security code in PHP w/o images (gd)?
 
Thank you.

--- End Message ---
--- Begin Message ---
You could make a few randomly named images (more = better security but wont
be very secure since the names can be put in a spam bot...) make them show
up, each name has a specific number etc...
"Eugene Voznesensky" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> How to generate and check security code in PHP w/o images (gd)?
>
> Thank you.
>

--- End Message ---
--- Begin Message ---
Hi,
I am just starting out with regex (and classes) so am
not sure how to do this...

I am seeing if a HTML file exists, if yes, I am using
file_get_contents to get the entire HTML file into a
string.

In the HTML file I already have this:

<!-- Start header -->
<html>
<body>
whatever you want comes here
<!-- End header -->

How do I use a regex to span these multiple lines and
simply cut everything (including the start..end
part)from <!-- Start header --> to <!-- End header -->

Second question:
I am using file_get_contents, is it better to use this
than file() or fread() ?

Thanks,
Mag

=====
------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)


                
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 

--- End Message ---
--- Begin Message ---
"Php Gen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> I am just starting out with regex (and classes) so am
> not sure how to do this...
>
> I am seeing if a HTML file exists, if yes, I am using
> file_get_contents to get the entire HTML file into a
> string.
>
> In the HTML file I already have this:
>
> <!-- Start header -->
> <html>
> <body>
> whatever you want comes here
> <!-- End header -->
>
> How do I use a regex to span these multiple lines and
> simply cut everything (including the start..end
> part)from <!-- Start header --> to <!-- End header -->
>
> Second question:
> I am using file_get_contents, is it better to use this
> than file() or fread() ?
>
> Thanks,
> Mag

Hi,

I can't answer your regexp question but some thoughts on file() etc.:
- file() returns the contents line by line as an array, so this makes only
sense if you need the contents in this form, e.g. for looping through each
line and applying a function or whatever
- fread() requires a file handle that you have to create with fopen(), so
file_get_contents() is kind of a shortcut for fopen()/fread()

Hope this helps.

Regards, Torsten Roehr

--- End Message ---
--- Begin Message ---
> Hi,
> 
> I can't answer your regexp question but some
> thoughts on file() etc.:
> - file() returns the contents line by line as an
> array, so this makes only
> sense if you need the contents in this form, e.g.
> for looping through each
> line and applying a function or whatever
> - fread() requires a file handle that you have to
> create with fopen(), so
> file_get_contents() is kind of a shortcut for
> fopen()/fread()
> 

Hey,

Thanks for replying and the answer to my second Q,
sounds like file_get_contents() is good for me now.

I think i found a solution for the regex too, just
have to modify some parts.

Cheers,
Mag

=====
------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)


        
                
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

--- End Message ---
--- Begin Message ---
Hi,
I am using flush() and ob_flush() in one of my scripts
and its working great.., just one problem, as it keeps
outputting xxxxx on the screen the page just stays on
top...is there anyway (I am not sure via php...but
maybe JavaScript? ) to make the browser "follow" the
output below
eg:
keep the scroll below right next to the text.

This is what i am using:

for($i=0; $i<1000;$i++)
{
echo "something<br>";
echo str_repeat(" ", 256);   flush();   ob_flush();
sleep(1);
}

Thanks,
Mag

=====
------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)


        
                
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

--- End Message ---
--- Begin Message --- PHP Gen wrote:
Hi,
I am using flush() and ob_flush() in one of my scripts
and its working great.., just one problem, as it keeps
outputting xxxxx on the screen the page just stays on
top...is there anyway (I am not sure via php...but
maybe JavaScript? ) to make the browser "follow" the
output below

Not with PHP. Use Javascript's scroll properties/methods/whatevers... :)

--

John Holmes

php|architect - The magazine for PHP professionals - http://www.phparch.com
--- End Message ---
--- Begin Message ---
--- John Holmes <[EMAIL PROTECTED]> wrote:

> PHP Gen wrote:
> > Hi,
> > I am using flush() and ob_flush() in one of my
> scripts
> > and its working great.., just one problem, as it
> keeps
> > outputting xxxxx on the screen the page just stays
> on
> > top...is there anyway (I am not sure via php...but
> > maybe JavaScript? ) to make the browser "follow"
> the
> > output below


 
> Not with PHP. Use Javascript's scroll
> properties/methods/whatevers... :)
 

Yeah, thought so. Dont know JS that well though (been
a long time) so will have to search the web.

Thanks anyway.
Mag

=====
------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)


                
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

--- End Message ---
--- Begin Message ---
On Saturday 07 August 2004 11:22 am, Jason Barnett wrote:
> I assume you are using PHP4's DOMXML functions?  If that's the case then
> you have a bit of a problem.  XML support changed between 4.0 and 5.0, we
> use libxml2 (which supports UTF-8), but the object model / methods changed
> to better conform with the DOM standard.  Also AFAIK the experimental tag
> has been dropped for PHP5.  I reckon that upgrading scripts to work with
> PHP5 and fixing any bugs that pop up is far easier than writing your own
> validating XML parser.  Hell, even libxml2 doesn't fully support XML
> Schemas yet.

Im currently using expat, http://us2.php.net/manual/en/ref.xml.php to parse 
XML files...

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

I have re-written a very basic website to use sessions (switching to https)  
for login to special areas of a site. After testing the site thoroughly 
locally, I uploaded the whole shebang to a unix server that runs Apache 1.3.x 
+ PHP 4.3.4 + mysql. 

Almost all code broke - sessions would load, but almost every page was so 
messed up that -- well, I'm flabbergasted!

I'm wondering, after reading a few threads on my local config whether the 
problem might lie with the Apache2 server I use locally (Mandrake special 
with Extranet). I also use an older version of PHP 4.3.1.

I've examined both configs for differences, but can see nothing that would 
account for such an extremely messed up site. It loads locally beautifully 
(and all admin pages work) in Opera, Galeon, Mozilla, + Konqueror. Loads with 
errors to mysql db in all others but Konqueror which does not even display 
the opening page (yet I can view source).

Maybe this isn't the forum to ask -- but seeing that all db access is through 
PHP -- I wonder whether anyone can point where i can start looking for the 
culprit(s).

Any ideas, suggestions, or advice will be greatly appreciated.

Tia,
Andre

--- End Message ---
--- Begin Message ---
Did you check the phpinfo on each server, make sure your server settings are
same as local?


"Andre Dubuc" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I have re-written a very basic website to use sessions (switching to
https)
> for login to special areas of a site. After testing the site thoroughly
> locally, I uploaded the whole shebang to a unix server that runs Apache
1.3.x
> + PHP 4.3.4 + mysql.
>
> Almost all code broke - sessions would load, but almost every page was so
> messed up that -- well, I'm flabbergasted!
>
> I'm wondering, after reading a few threads on my local config whether the
> problem might lie with the Apache2 server I use locally (Mandrake special
> with Extranet). I also use an older version of PHP 4.3.1.
>
> I've examined both configs for differences, but can see nothing that would
> account for such an extremely messed up site. It loads locally beautifully
> (and all admin pages work) in Opera, Galeon, Mozilla, + Konqueror. Loads
with
> errors to mysql db in all others but Konqueror which does not even display
> the opening page (yet I can view source).
>
> Maybe this isn't the forum to ask -- but seeing that all db access is
through
> PHP -- I wonder whether anyone can point where i can start looking for the
> culprit(s).
>
> Any ideas, suggestions, or advice will be greatly appreciated.
>
> Tia,
> Andre

--- End Message ---
--- Begin Message ---
On Sat, 2004-08-07 at 17:55, Andre Dubuc wrote:
> Hi,
> 
> I have re-written a very basic website to use sessions (switching to https)  
> for login to special areas of a site. After testing the site thoroughly 
> locally, I uploaded the whole shebang to a unix server that runs Apache 1.3.x 
> + PHP 4.3.4 + mysql. 
> 
> Almost all code broke - sessions would load, but almost every page was so 
> messed up that -- well, I'm flabbergasted!
> 
> I'm wondering, after reading a few threads on my local config whether the 
> problem might lie with the Apache2 server I use locally (Mandrake special 
> with Extranet). I also use an older version of PHP 4.3.1.
> 
> I've examined both configs for differences, but can see nothing that would 
> account for such an extremely messed up site. It loads locally beautifully 
> (and all admin pages work) in Opera, Galeon, Mozilla, + Konqueror. Loads with 
> errors to mysql db in all others but Konqueror which does not even display 
> the opening page (yet I can view source).
> 
> Maybe this isn't the forum to ask -- but seeing that all db access is through 
> PHP -- I wonder whether anyone can point where i can start looking for the 
> culprit(s).
> 
> Any ideas, suggestions, or advice will be greatly appreciated.
> 
> Tia,
> Andre

It's very doubtful that it's from Apache 2. 

Somethings that you might want to consider. 

Do you have all the libraries that you are using on your local
development machine on the production machine? Are your includes paths
pointed to the proper directories? Did you use <? instead of <?php (tsk
tsk) ?

Good luck. :-)

-Robby

-- 
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
****************************************/

--- End Message ---
--- Begin Message ---
Josh,

Aside from the differences in php versions, the only difference is thta the 
local version has register_globals=off.

I'm really stumped.

Andre

On Sunday 08 August 2004 06:07 am, Josh Acecool M wrote:
> Did you check the phpinfo on each server, make sure your server settings
> are same as local?
>
>
> "Andre Dubuc" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
> > Hi,
> >
> > I have re-written a very basic website to use sessions (switching to
>
> https)
>
> > for login to special areas of a site. After testing the site thoroughly
> > locally, I uploaded the whole shebang to a unix server that runs Apache
>
> 1.3.x
>
> > + PHP 4.3.4 + mysql.
> >
> > Almost all code broke - sessions would load, but almost every page was so
> > messed up that -- well, I'm flabbergasted!
> >
> > I'm wondering, after reading a few threads on my local config whether the
> > problem might lie with the Apache2 server I use locally (Mandrake special
> > with Extranet). I also use an older version of PHP 4.3.1.
> >
> > I've examined both configs for differences, but can see nothing that
> > would account for such an extremely messed up site. It loads locally
> > beautifully (and all admin pages work) in Opera, Galeon, Mozilla, +
> > Konqueror. Loads
>
> with
>
> > errors to mysql db in all others but Konqueror which does not even
> > display the opening page (yet I can view source).
> >
> > Maybe this isn't the forum to ask -- but seeing that all db access is
>
> through
>
> > PHP -- I wonder whether anyone can point where i can start looking for
> > the culprit(s).
> >
> > Any ideas, suggestions, or advice will be greatly appreciated.
> >
> > Tia,
> > Andre

--- End Message ---
--- Begin Message ---
On Sat, 7 Aug 2004 20:55:44 -0400, Andre Dubuc <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I have re-written a very basic website to use sessions (switching to https)
> for login to special areas of a site. After testing the site thoroughly
> locally, I uploaded the whole shebang to a unix server that runs Apache 1.3.x
> + PHP 4.3.4 + mysql.
> 
> Almost all code broke - sessions would load, but almost every page was so
> messed up that -- well, I'm flabbergasted!

Messed up how. This really doens't give us enough to help.

> 
> I'm wondering, after reading a few threads on my local config whether the
> problem might lie with the Apache2 server I use locally (Mandrake special
> with Extranet). I also use an older version of PHP 4.3.1.
> 
> I've examined both configs for differences, but can see nothing that would
> account for such an extremely messed up site. It loads locally beautifully
> (and all admin pages work) in Opera, Galeon, Mozilla, + Konqueror. Loads with
> errors to mysql db in all others but Konqueror which does not even display
> the opening page (yet I can view source).
> 
> Maybe this isn't the forum to ask -- but seeing that all db access is through
> PHP -- I wonder whether anyone can point where i can start looking for the
> culprit(s).
> 
> Any ideas, suggestions, or advice will be greatly appreciated.
> 
> Tia,
> Andre
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 



-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

--- End Message ---
--- Begin Message ---
On Saturday 07 August 2004 09:10 pm, you wrote:
> On Sat, 2004-08-07 at 17:55, Andre Dubuc wrote:
> > Hi,
> >
> > I have re-written a very basic website to use sessions (switching to
> > https) for login to special areas of a site. After testing the site
> > thoroughly locally, I uploaded the whole shebang to a unix server that
> > runs Apache 1.3.x + PHP 4.3.4 + mysql.
> >
> > Almost all code broke - sessions would load, but almost every page was so
> > messed up that -- well, I'm flabbergasted!
> >
> > I'm wondering, after reading a few threads on my local config whether the
> > problem might lie with the Apache2 server I use locally (Mandrake special
> > with Extranet). I also use an older version of PHP 4.3.1.
> >
> > I've examined both configs for differences, but can see nothing that
> > would account for such an extremely messed up site. It loads locally
> > beautifully (and all admin pages work) in Opera, Galeon, Mozilla, +
> > Konqueror. Loads with errors to mysql db in all others but Konqueror
> > which does not even display the opening page (yet I can view source).
> >
> > Maybe this isn't the forum to ask -- but seeing that all db access is
> > through PHP -- I wonder whether anyone can point where i can start
> > looking for the culprit(s).
> >
> > Any ideas, suggestions, or advice will be greatly appreciated.
> >
> > Tia,
> > Andre
>
> It's very doubtful that it's from Apache 2.
>
> Somethings that you might want to consider.
>
> Do you have all the libraries that you are using on your local
> development machine on the production machine? Are your includes paths
> pointed to the proper directories? Did you use <? instead of <?php (tsk
> tsk) ?
>
> Good luck. :-)
>
> -Robby

That's what I thought. But the differences are glaring. Seems like none of the 
code wants to work. Navigation is a nightmare: header("location:..."); 
usually brings an error message: function so and so -- include("xxx.php"); 
has already been declared -- cannot redeclare (yet locally - absolutely no 
problem!) ?? 

Oh, what a nightmare. I can handle parsing errors, and general messups -- but 
when the whole site works without a glitch locally . . . .

Also, mysql complains bitterly about a non-existent user (it's already an open 
and persistent connection, has given data previously -- go figure) -- it's 
unbelievable! And I have an existing site, developed using almost the same 
code + 340++ files working seamlessly.

The libraries appear to be the same, however, I did notice a reference to 
/usr/lib/pear. include paths point correctly, and I faithfully use <?php .... 
?>.

Sigh -- what a mess!

Andre

--- End Message ---
--- Begin Message ---
It could be that you have local error reporting set to none.  It could also
be that you're using full paths when referencing files which then breaks
when moving files to a new server.  Basically, there's a lot of
possibilities and I'm not going to have much luck helping unless you include
error messages.  My guess is that resolving a few errors will address a core
problem and everything will start working.

-Ed


> That's what I thought. But the differences are glaring. Seems like none of
> the
> code wants to work. Navigation is a nightmare: header("location:...");
> usually brings an error message: function so and so -- include("xxx.php");
> has already been declared -- cannot redeclare (yet locally - absolutely no
> problem!) ??
> 
> Oh, what a nightmare. I can handle parsing errors, and general messups --
> but
> when the whole site works without a glitch locally . . . .
> 
> Also, mysql complains bitterly about a non-existent user (it's already an
> open
> and persistent connection, has given data previously -- go figure) -- it's
> unbelievable! And I have an existing site, developed using almost the same
> code + 340++ files working seamlessly.
> 
> The libraries appear to be the same, however, I did notice a reference to
> /usr/lib/pear. include paths point correctly, and I faithfully use <?php
> ....
> ?>.
> 
> Sigh -- what a mess!
> 
> Andre
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
On Sat, 2004-08-07 at 19:00, Ed Lazor wrote:
> It could be that you have local error reporting set to none.  It could also
> be that you're using full paths when referencing files which then breaks
> when moving files to a new server.  Basically, there's a lot of
> possibilities and I'm not going to have much luck helping unless you include
> error messages.  My guess is that resolving a few errors will address a core
> problem and everything will start working.
> 
> -Ed

Yes, it's very possible that he isn't getting errors locally because his
errors aren't on. 

Andre,

You might check your error settings on your local server. You might even
consider upgrading php on your local server to the same version and
debugging. 

-Robby

-- 
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
****************************************/

--- End Message ---
--- Begin Message ---
On Saturday 07 August 2004 10:11 pm, Robby Russell wrote:
> On Sat, 2004-08-07 at 19:00, Ed Lazor wrote:
> > It could be that you have local error reporting set to none.  It could
> > also be that you're using full paths when referencing files which then
> > breaks when moving files to a new server.  Basically, there's a lot of
> > possibilities and I'm not going to have much luck helping unless you
> > include error messages.  My guess is that resolving a few errors will
> > address a core problem and everything will start working.
> >
> > -Ed
>
> Yes, it's very possible that he isn't getting errors locally because his
> errors aren't on.
>
> Andre,
>
> You might check your error settings on your local server. You might even
> consider upgrading php on your local server to the same version and
> debugging.
>
> -Robby
>
> --
> /***************************************
> * Robby Russell | Owner.Developer.Geek
> * PLANET ARGON  | www.planetargon.com
> * Portland, OR  | [EMAIL PROTECTED]
> * 503.351.4730  | blog.planetargon.com
> * PHP/PostgreSQL Hosting & Development
> ****************************************/


Robby,

I just enabled log_errors locally. No errors (as I thought). 

Since I am hacking a previously written site, the problem seems to arise most 
when accessing his pre-built functions across pages. For instance, he uses a 
'cards.php' to store all display functions -- showleft() -- showcentre() , as 
well as the connect() function. Since its a persistent connection -- he opens 
the db once, then performs various queries in it. However, since 'cards.php' 
has already been called once by a page that might require both showleft() and 
showcentre() -- it barfs and says that it cannot 'redeclare' the showleft() 
function that has already been declared??  That is really some weird -- 
particularly when it works so well (as expected) locally - and also since I'm 
not 'redeclaring' but calling it for use!

I cannot fathom why the production site would give this error. Perhaps I need 
to do absolute paths for all headers? But it doesn't make sense that a 
function cannot be called many times -- declaring it once, yes, but calling 
its use?? If that were the case, then one might as well write it out longhand 
for each use, and forget the concept of 'functions'.

I think I should look at the error logs for the site -- maybe they will clue 
me in where I should look.

Thanks,
Andre

--- End Message ---
--- Begin Message ---
That might be something, with reg globals ON, on your server, and say you
try to get $_GET['id'] and $SESSION['id'] will be the same, they might be
overwriting themselves.

Try setting register globals to OFF on your server, its also more secure.

"Andre Dubuc" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Josh,
>
> Aside from the differences in php versions, the only difference is thta
the
> local version has register_globals=off.
>
> I'm really stumped.
>
> Andre
>
> On Sunday 08 August 2004 06:07 am, Josh Acecool M wrote:
> > Did you check the phpinfo on each server, make sure your server settings
> > are same as local?
> >
> >
> > "Andre Dubuc" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >
> > > Hi,
> > >
> > > I have re-written a very basic website to use sessions (switching to
> >
> > https)
> >
> > > for login to special areas of a site. After testing the site
thoroughly
> > > locally, I uploaded the whole shebang to a unix server that runs
Apache
> >
> > 1.3.x
> >
> > > + PHP 4.3.4 + mysql.
> > >
> > > Almost all code broke - sessions would load, but almost every page was
so
> > > messed up that -- well, I'm flabbergasted!
> > >
> > > I'm wondering, after reading a few threads on my local config whether
the
> > > problem might lie with the Apache2 server I use locally (Mandrake
special
> > > with Extranet). I also use an older version of PHP 4.3.1.
> > >
> > > I've examined both configs for differences, but can see nothing that
> > > would account for such an extremely messed up site. It loads locally
> > > beautifully (and all admin pages work) in Opera, Galeon, Mozilla, +
> > > Konqueror. Loads
> >
> > with
> >
> > > errors to mysql db in all others but Konqueror which does not even
> > > display the opening page (yet I can view source).
> > >
> > > Maybe this isn't the forum to ask -- but seeing that all db access is
> >
> > through
> >
> > > PHP -- I wonder whether anyone can point where i can start looking for
> > > the culprit(s).
> > >
> > > Any ideas, suggestions, or advice will be greatly appreciated.
> > >
> > > Tia,
> > > Andre

--- End Message ---
--- Begin Message ---
Try adding
if (!function_exists("function_name")) {
    function function_name ($blah) {
        // Function Code
    }
}
for each function.

That will fix the redeclare problem which happens if you call your cards.php
file in more than 1 file..

"Andre Dubuc" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Saturday 07 August 2004 10:11 pm, Robby Russell wrote:
> > On Sat, 2004-08-07 at 19:00, Ed Lazor wrote:
> > > It could be that you have local error reporting set to none.  It could
> > > also be that you're using full paths when referencing files which then
> > > breaks when moving files to a new server.  Basically, there's a lot of
> > > possibilities and I'm not going to have much luck helping unless you
> > > include error messages.  My guess is that resolving a few errors will
> > > address a core problem and everything will start working.
> > >
> > > -Ed
> >
> > Yes, it's very possible that he isn't getting errors locally because his
> > errors aren't on.
> >
> > Andre,
> >
> > You might check your error settings on your local server. You might even
> > consider upgrading php on your local server to the same version and
> > debugging.
> >
> > -Robby
> >
> > --
> > /***************************************
> > * Robby Russell | Owner.Developer.Geek
> > * PLANET ARGON  | www.planetargon.com
> > * Portland, OR  | [EMAIL PROTECTED]
> > * 503.351.4730  | blog.planetargon.com
> > * PHP/PostgreSQL Hosting & Development
> > ****************************************/
>
>
> Robby,
>
> I just enabled log_errors locally. No errors (as I thought).
>
> Since I am hacking a previously written site, the problem seems to arise
most
> when accessing his pre-built functions across pages. For instance, he uses
a
> 'cards.php' to store all display functions -- showleft() -- showcentre() ,
as
> well as the connect() function. Since its a persistent connection -- he
opens
> the db once, then performs various queries in it. However, since
'cards.php'
> has already been called once by a page that might require both showleft()
and
> showcentre() -- it barfs and says that it cannot 'redeclare' the
showleft()
> function that has already been declared??  That is really some weird -- 
> particularly when it works so well (as expected) locally - and also since
I'm
> not 'redeclaring' but calling it for use!
>
> I cannot fathom why the production site would give this error. Perhaps I
need
> to do absolute paths for all headers? But it doesn't make sense that a
> function cannot be called many times -- declaring it once, yes, but
calling
> its use?? If that were the case, then one might as well write it out
longhand
> for each use, and forget the concept of 'functions'.
>
> I think I should look at the error logs for the site -- maybe they will
clue
> me in where I should look.
>
> Thanks,
> Andre

--- End Message ---
--- Begin Message ---
To all those who have auto-replys set for their email, please turn them
off. ;-)

We shouldn't have to opt-in to 3 different peoples spam email sites so
that we can post to the list. heh.

-Robby

-- 
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | [EMAIL PROTECTED]
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
****************************************/

--- End Message ---
--- Begin Message ---
Hi All,
I finally found the problem: It was the mod_bandwidth module in
Apache.  I was tipped off to this from bug report:
http://bugs.php.net/bug.php?id=16595
I disabled the module (commented the LoadModule and AddModule lines in
httpd.conf) and $_POST is populated as expected now.

The faq for mod_bandwidth at:
http://www.cohprog.com/v3/bandwidth/faq-en.html
indicates that if configured incorrectly, CGI may stop working.

FYI: Regarding my other questions:
The code below shows an example of reading data from stdin.  If POST
data is read properly by php, there will be nothing on stdin.
However, if you set post_max_size to a (very) small value, there will
be something on stdin and the code below will read and display it.
You will also get a warning that CONTENT_LENGTH is greater than
post_max_size.  The code compares the values of CONTENT_LENGTH and
post_max_size and warns if post_max_size is smaller.

Hope this helps all of you out there who are having similar problems.

--
Andy

On Thu, Aug 05, 2004 at 03:47:35PM -0500, AJL wrote:
> I tried the C code below and I get post data from Apache fine.
> 
> Now I tried to test that php gets data on stdin and that appears to
> fail.  Maybe I tested wrong, can anyone verify if this test should
> work?
> 
> Step 1: Set 'post_max_size = 1' in php.ini
> 
> Step 2: Send html form post to this code:
> <?php
>     if($_ENV['REQUEST_METHOD'] == 'POST')
>     {
>         if (strcasecmp($_ENV['REQUEST_METHOD'], 'POST') == 0)
>         {
>             $cl = $_ENV['CONTENT_LENGTH'];
>             $stdin = fopen('php://stdin', 'r');
>             if(!$stdin) {print('Error opening stdin'); exit(1);}
>             $raw_data = fgets($stdin, $cl);
>             fclose($stdin);
>             print("STDIN<br>STRLEN = ".strlen($raw_data));
>             print('<pre>');
>             print($raw_data);
>             print('</pre>');
>         }
>     }
>     print('<hr>ENV<pre>');
>     print_r($_ENV);
>     print('</pre>');
> ?>
> 
> 
> ENV variables all look correct.  stdin ($raw_data) appears to be
> empty, strlen returns 0.  The CONTENT_LENGTH environment variable is
> reported correctly and changes according to how much data is posted.
> 
> Is fopen('php://stdin', 'r'); the correct way to read from stdin?
> 
> Are there any other ways to read from stdin?
> 
> Is post_max_size = 1 a valid setting?
> 
> --
> Andy
> 
> 
> On Wed, Aug 04, 2004 at 11:18:26PM -0500, AJL wrote:
> > 
> > Yeah, I would expect a 50x response for a Deny from all.  I tried 
> > adding the Limit directive to .htacces in both the cgi directory and
> > the www directory, no luck:
> > <Limit POST>
> >     Order Allow,Deny
> >     Allow from all
> > </Limit>
> > 
> > I found this C code:
> > ftp://ftp.ncsa.uiuc.edu/Web/httpd/Unix/ncsa_httpd/cgi/cgi-src/post-query.c
> > 
> > and compiled it and redirected my sample code (posted earlier) and I
> > get the posted form variables fine.  So maybe Apache CGI setup is
> > working okay.
> > 
> > The next logical step seems to be to see what php is getting on stdin
> > and what environment variables are set.  I know I can check the
> > environment variables with $_ENV.  Anyone know how I can get an exact
> > copy of the data that was passed on stdin?
> > 
> > --
> > Andy
> > 
> > On Thu, Aug 05, 2004 at 03:20:23AM +0000, Curt Zirzow wrote:
> > > * Thus wrote AJL:
> > > > On Wed, Aug 04, 2004 at 02:55:16PM -0700, Justin Patrin wrote:
> > > > > 
> > > > > Sounds like Apache just isn't passing in POST data. Are you *sure*
> > > > > there's Apache directive for this?
> > > > Yeah, that's what I'm thinking more and more, apache not passing it in
> > > > or in a way that php is not understanding.
> > > > 
> > > > Anyone know of possible apache settings/directives that affect how CGI
> > > > programs are invoked and/or how data is passed to them?
> > > 
> > > <Location /cgi-bin> # or similar
> > >   <Limit POST>
> > >     Order deny,allow
> > >     Deny from all
> > >   </Limit>
> > > </Location>
> > > 
> > > But, you technically should get a 50x error with that.
> > > 
> > > 
> > > Curt
> > > -- 
> > > First, let me assure you that this is not one of those shady pyramid schemes
> > > you've been hearing about.  No, sir.  Our model is the trapezoid!
> > > 
> > > -- 
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Permissions are set to 0777.

"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Saturday 07 August 2004 20:17, Kevin wrote:
>
> > I am able to make first two directories i.e 'full1/1' and 'thumb/1'.
Script
> > do not allow me to make 'full1/1/1' and 'thumb/1/1' too. I also have
tried
> > removing umask function.
>
> What are the permissions on the directories that you are able to make?
>
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> Paul's Law:
> You can't fall off the floor.
> */

--- End Message ---
--- Begin Message ---
Hi everybody,
I have a cuestion about the features on function mail. I think that it
send the email one to one address. Is it ok?.
Regards,
Juan Pablo

--- End Message ---

Reply via email to