OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 2 Nov 2006 03:03:00 -0000 Issue 4435

php-general-digest-helplists.php.net
Date: Wed Nov 01 2006 - 21:03:00 CST


php-general Digest 2 Nov 2006 03:03:00 -0000 Issue 4435

Topics (messages 244014 through 244078):

Re: why so slow?
        244014 by: Dave Goodchild
        244015 by: Mel
        244030 by: M.Sokolewicz
        244038 by: John Nichel
        244039 by: Frank Arensmeier
        244040 by: Richard Lynch
        244074 by: Mel

Changing the Action attribute of Form
        244016 by: sues
        244017 by: João Cândido de Souza Neto
        244018 by: Roman Neuhauser
        244020 by: Edward Kay
        244021 by: Edward Kay
        244022 by: Ed Lazor
        244024 by: Dave Goodchild
        244025 by: David Giragosian
        244036 by: Richard Lynch
        244037 by: Richard Lynch

Re: 301 redirect returning 302 instead
        244019 by: Kris Leech
        244026 by: ianevans.digitalhit.com
        244031 by: Ed Lazor
        244043 by: Richard Lynch
        244065 by: ianevans.digitalhit.com
        244071 by: Curt Zirzow
        244077 by: ianevans.digitalhit.com

Re: php.ini & ini_set
        244023 by: Ed Lazor
        244042 by: Richard Lynch

Directory name
        244027 by: Sugrue, Sean
        244035 by: Richard Lynch
        244049 by: Ed Lazor

Microsoft Partners With Zend
        244028 by: Daevid Vincent
        244029 by: Robert Cummings
        244032 by: Ed Lazor
        244033 by: Richard Lynch
        244034 by: Ed Lazor
        244048 by: Sancar Saran
        244051 by: Robert Cummings
        244052 by: Ed Lazor
        244054 by: Kevin Waterson
        244058 by: tg-php.gryffyndevelopment.com
        244066 by: Daevid Vincent
        244067 by: Jay Blanchard
        244069 by: ray.hauge.americanstudentloan.com
        244070 by: ray.hauge.americanstudentloan.com
        244072 by: steve
        244073 by: Curt Zirzow

Re: Stupid question of the day (Editing text file in $HOME via web)
        244041 by: Richard Lynch

Re: Add buttons on the fly
        244044 by: Richard Lynch

Re: Remote Robot Control with PHP
        244045 by: Richard Lynch
        244068 by: Prathaban Mookiah

OO website/program doubt
        244046 by: Meghdad Azriel
        244050 by: Ed Lazor
        244053 by: Richard Lynch
        244057 by: bruce
        244063 by: Ed Lazor
        244064 by: Kevin Waterson
        244078 by: Chris

Re: Manually Inserted Row
        244047 by: Richard Lynch

Re: How do I get ini_set('output_handler', '') to work?!
        244055 by: Richard Lynch
        244060 by: Ed Lazor

Closing a connection to browser without exiting the script
        244056 by: David Négrier
        244061 by: Ed Lazor

Re: PHP IMAP with Attachments!?
        244059 by: WeberSites LTD

Re: Job Opening
        244062 by: WeberSites LTD

Form verification
        244075 by: Ron Piggott (PHP)
        244076 by: Joe Wollard

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

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

attached mail follows:


Take out the comment before the DOCTYPE. There should be nothing before it.

attached mail follows:


I have

this is the page I am working on right now and it is valid html 4.01

http://www.squareinch.net/client_testing_html401.php

On Nov 1, 2006, at 5:32 AM, Dave Goodchild wrote:

> Take out the comment before the DOCTYPE. There should be nothing
> before it.

attached mail follows:


No you have not, otherwise we would not be seeing:
<!-- ************************* start header -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>

when we SHOULD be seeing
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>

- tul

Mel wrote:
> I have
>
> this is the page I am working on right now and it is valid html 4.01
>
> http://www.squareinch.net/client_testing_html401.php
>
> On Nov 1, 2006, at 5:32 AM, Dave Goodchild wrote:
>
>> Take out the comment before the DOCTYPE. There should be nothing
>> before it.
>
>

attached mail follows:


Mel wrote:
> I have
>
> this is the page I am working on right now and it is valid html 4.01
>
> http://www.squareinch.net/client_testing_html401.php
>

Bzzzzzzttttttt. No, it isn't.

The people here have been pretty accommodating of you so far, but if you
continue to *not* do any research yourself, continue to *not* understand
the basics of what you are trying to do, the accommodation will end quickly.

Buy a book. Read some online manuals. Google. Learn how to troubleshoot.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
jnicheldotcomholdingsofbuffalo.com

attached mail follows:


In fact, validator.w3.org validates the hmtl page at http://
www.squareinch.net/client_testing_html401.php as valid 4.01 html. So
obviously, html comments are allowed before the doctype declaration.

Anyway, the page contains almost one hundred (haven't count them)
totally unnecessary empty anchor tags ( <span class='navText'><a
href='client_testing_html401.php?art='></a></span> ) which shouldn't
be there at all.

Once again - I can't see how the original problem is related to PHP.

/frank

1 nov 2006 kl. 20.45 skrev M.Sokolewicz:

> No you have not, otherwise we would not be seeing:
> <!-- ************************* start header -->
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
>
> <html>
> <head>
>
> when we SHOULD be seeing
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
>
> <html>
> <head>
>
>
> - tul
>
> Mel wrote:
>> I have
>> this is the page I am working on right now and it is valid html 4.01
>> http://www.squareinch.net/client_testing_html401.php
>> On Nov 1, 2006, at 5:32 AM, Dave Goodchild wrote:
>>> Take out the comment before the DOCTYPE. There should be nothing
>>> before it.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


On Wed, November 1, 2006 2:55 am, Mel wrote:
> Could you think of why my site loads so slowly?
>
> http://www.squareinch.net/home.php

Install Firefox and an HTML Validator.

Look at your "View Source"

Your <!doctype isn't even the first line! :-)

That urchintracker() stuff will probably kill performance too, and I
doubt they provide anything you can't get from Analog or Webalizer or
just rolling your own PHP (or some combo of all that).

Ten successive tries of:
time wget http://www.squareinch.net/home.php
were all over the map in timings.

From respectable 0.1s to 10s with no discernible pattern.

I'd suggest you try timing it with a static HTML file (.htm) and no
PHP in the picture to eliminate PHP as the culprit.

Then you'd take this off to the Apache list, after searching their
bugs database for something similar, assuming your header is correct:
Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) PHP/5.1.2

Or, if it is PHP 5.1.2 which is messing you up, then try
upgrading/downgrading to see if that helps.

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


Your advice is well taken and thank you.

I do have a book with the help of which I made this site and I have
been working on it for many many weeks. (ashamed to say exactly how
many!) Remember your first ever php site?

I truly do appreciate all the help I got and it did lead me to
validate my html, change my links ...

I am sure there are things even you don't know or understand and that
you can use help from other more experienced and generous people who
are willing to share.

On Nov 1, 2006, at 12:20 PM, John Nichel wrote:

> Mel wrote:
>> I have
>> this is the page I am working on right now and it is valid html 4.01
>> http://www.squareinch.net/client_testing_html401.php
>>
>
> Bzzzzzzttttttt. No, it isn't.
>
> The people here have been pretty accommodating of you so far, but
> if you continue to *not* do any research yourself, continue to
> *not* understand the basics of what you are trying to do, the
> accommodation will end quickly.
>
> Buy a book. Read some online manuals. Google. Learn how to
> troubleshoot.
>
> --
> John C. Nichel IV
> Programmer/System Admin (ÜberGeek)
> Dot Com Holdings of Buffalo
> 716.856.9675
> jnicheldotcomholdingsofbuffalo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


I need to pass control of a form to either a page that accesses our
database, and displays the data, OR to a page that contains static content.
The ACTION attribute will then depend on the contents of 1 of the input
fields in the form, which is a SELECT type of input. Here is an example of
what the form looks like:

<form id="test" action="some_page.php" method="get" name="test">
 <select name="test_item" size="1">
      <option value="1">Item 1</option>
      <option value="2">Item 2</option>
</select>
<input type="submit" name="submit" value="submit" />
</form>

If "Item 1" is selected, I want to go to a certain page (some_page.php), and
if "Item 2" is selected I want to go to a different page. Is there a way to
handle this using PHP or JavaScript? Any help would be greatly appreciated!

Thanks!

attached mail follows:


<scipt language="javascript">
    function change_action(obj) {
        if (obj.test_item.value="1") obj.action="page_1.php";
        if (obj.test_item.value="2") obj.action="page_2.php";
        return true;
    }
</script>
 <form name="test" action="some_page.php" method="get" name="test">
 <select name="test_item" size="1" onchange="return
change_action(document.teste);">
      <option value="1">Item 1</option>
      <option value="2">Item 2</option>
 </select>
 <input type="submit" name="submit" value="submit" />
 </form>

""sues"" <skot1twcny.rr.com> escreveu na mensagem
news:02.4E.30579.92BB8454pb1.pair.com...
>I need to pass control of a form to either a page that accesses our
>database, and displays the data, OR to a page that contains static content.
>The ACTION attribute will then depend on the contents of 1 of the input
>fields in the form, which is a SELECT type of input. Here is an example of
>what the form looks like:
>
> <form id="test" action="some_page.php" method="get" name="test">
> <select name="test_item" size="1">
> <option value="1">Item 1</option>
> <option value="2">Item 2</option>
> </select>
> <input type="submit" name="submit" value="submit" />
> </form>
>
> If "Item 1" is selected, I want to go to a certain page (some_page.php),
> and if "Item 2" is selected I want to go to a different page. Is there a
> way to handle this using PHP or JavaScript? Any help would be greatly
> appreciated!
>
> Thanks!

attached mail follows:


# skot1twcny.rr.com / 2006-11-01 10:20:07 -0500:
> I need to pass control of a form to either a page that accesses our
> database, and displays the data, OR to a page that contains static content.
> The ACTION attribute will then depend on the contents of 1 of the input
> fields in the form, which is a SELECT type of input. Here is an example of
> what the form looks like:
>
> <form id="test" action="some_page.php" method="get" name="test">
> <select name="test_item" size="1">
> <option value="1">Item 1</option>
> <option value="2">Item 2</option>
> </select>
> <input type="submit" name="submit" value="submit" />
> </form>
>
> If "Item 1" is selected, I want to go to a certain page (some_page.php), and
> if "Item 2" is selected I want to go to a different page. Is there a way to
> handle this using PHP or JavaScript?

    Javascript: Have the submit button call a JS function which would
    check the state of the select and set the action appropriately
    before submitting the form.

    PHP: submit the result to a dispatcher script that'll redirect to
    one of the targets based on what has arrived in the data (you'll
    lose the ability to POST though).

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

attached mail follows:


Set the action attribute to be the same page as the form (or a separate
'handler' PHP page). This script can then examine the input supplied by the
submission and then redirect the user to the appropriate page with an HTTP
header.

I'd avoid using JavaScript for this sort of thing. It can be easily tampered
with plus users without JS/JS turned off won't be able to use your site.

Edward

> -----Original Message-----
> From: sues [mailto:skot1twcny.rr.com]
> Sent: 01 November 2006 15:20
> To: php-generallists.php.net
> Subject: [PHP] Changing the Action attribute of Form
>
>
> I need to pass control of a form to either a page that accesses our
> database, and displays the data, OR to a page that contains
> static content.
> The ACTION attribute will then depend on the contents of 1 of the input
> fields in the form, which is a SELECT type of input. Here is an
> example of
> what the form looks like:
>
> <form id="test" action="some_page.php" method="get" name="test">
> <select name="test_item" size="1">
> <option value="1">Item 1</option>
> <option value="2">Item 2</option>
> </select>
> <input type="submit" name="submit" value="submit" />
> </form>
>
> If "Item 1" is selected, I want to go to a certain page
> (some_page.php), and
> if "Item 2" is selected I want to go to a different page. Is
> there a way to
> handle this using PHP or JavaScript? Any help would be greatly
> appreciated!
>
> Thanks!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>

attached mail follows:


No problem.

A simple script to do what you want could be:

<?php

if (isset($_REQUEST['test_item']) {
  $test_item = $_REQUEST['test_item'];

  $redirect_page = '';
  switch ($test_item) {
    case '1':
      $redirect_page = 'page1.php';
      break;
    case '2':
      $redirect_page = 'page2.php';
      break;
    default:
      // Handle undefined value of test_item
  }

  $redirect_url = 'http://www.example.com/path/to/' . $redirect_page;
  header('Location:'.$redirect_url);
  exit();
}
// Handle bad form data here
?>

The key is to ensure your script doesn't output anything before the header
function call. This includes and HTML tags or even blank lines. Doing so
will result in a PHP error saying that the headers have already been sent.

A bit more info: http://php.about.com/od/learnphp/ht/phpredirection.htm

Edward

> -----Original Message-----
> From: Sue Kot [mailto:skot1twcny.rr.com]
> Sent: 01 November 2006 15:47
> To: Edward Kay
> Subject: Re: [PHP] Changing the Action attribute of Form
>
>
> Edward,
>
> Thank-you so much for responding to my question. I am new to PHP and I'm
> lost as to how you would redirect users using an HTTP header.
> Any examples
> or references that you can provide would be great. Thanks again!
>
> Sue
>
> ----- Original Message -----
> From: "Edward Kay" <edwardlabhut.com>
> To: "sues" <skot1twcny.rr.com>
> Sent: Wednesday, November 01, 2006 10:28 AM
> Subject: RE: [PHP] Changing the Action attribute of Form
>
>
> > Set the action attribute to be the same page as the form (or a separate
> > 'handler' PHP page). This script can then examine the input supplied by
> > the
> > submission and then redirect the user to the appropriate page
> with an HTTP
> > header.
> >
> > I'd avoid using JavaScript for this sort of thing. It can be easily
> > tampered
> > with plus users without JS/JS turned off won't be able to use your site.
> >
> > Edward
> >
> >> -----Original Message-----
> >> From: sues [mailto:skot1twcny.rr.com]
> >> Sent: 01 November 2006 15:20
> >> To: php-generallists.php.net
> >> Subject: [PHP] Changing the Action attribute of Form
> >>
> >>
> >> I need to pass control of a form to either a page that accesses our
> >> database, and displays the data, OR to a page that contains
> >> static content.
> >> The ACTION attribute will then depend on the contents of 1 of the input
> >> fields in the form, which is a SELECT type of input. Here is an
> >> example of
> >> what the form looks like:
> >>
> >> <form id="test" action="some_page.php" method="get" name="test">
> >> <select name="test_item" size="1">
> >> <option value="1">Item 1</option>
> >> <option value="2">Item 2</option>
> >> </select>
> >> <input type="submit" name="submit" value="submit" />
> >> </form>
> >>
> >> If "Item 1" is selected, I want to go to a certain page
> >> (some_page.php), and
> >> if "Item 2" is selected I want to go to a different page. Is
> >> there a way to
> >> handle this using PHP or JavaScript? Any help would be greatly
> >> appreciated!
> >>
> >> Thanks!
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >>
> >>
> >
>
>
>
>

attached mail follows:


> Javascript: Have the submit button call a JS function which would
> check the state of the select and set the action appropriately
> before submitting the form.
>
> PHP: submit the result to a dispatcher script that'll redirect to
> one of the targets based on what has arrived in the data (you'll
> lose the ability to POST though).

I'd chose the javascript route personally. You could use PHP's curl
functions to rePOST the data, but that seems like more work than is
necessary.

My .02 cents. :)

-Ed

attached mail follows:


Example HTTP redirect:

header('Location: http://www.google.com");

attached mail follows:


Wasn't there a thread recently about a webpage having multiple forms on it,
each of course with its own action attribute? Might be another solution
here.

David

On 11/1/06, Dave Goodchild <buddhamagnetgmail.com> wrote:
>
> Example HTTP redirect:
>
> header('Location: http://www.google.com");
>
>

attached mail follows:


2On Wed, November 1, 2006 9:20 am, sues wrote:
> I need to pass control of a form to either a page that accesses our
> database, and displays the data, OR to a page that contains static
> content.
> The ACTION attribute will then depend on the contents of 1 of the
> input
> fields in the form, which is a SELECT type of input. Here is an
> example of
> what the form looks like:
>
> <form id="test" action="some_page.php" method="get" name="test">
> <select name="test_item" size="1">
> <option value="1">Item 1</option>
> <option value="2">Item 2</option>
> </select>
> <input type="submit" name="submit" value="submit" />
> </form>
>
> If "Item 1" is selected, I want to go to a certain page
> (some_page.php), and
> if "Item 2" is selected I want to go to a different page. Is there a
> way to
> handle this using PHP or JavaScript? Any help would be greatly
> appreciated!

The exact way YOU describe it, it happens *LONG* after PHP is finished
running on the server, it can't be PHP.

So it must be JavaScript.

Which means it will maybe sorta work, unless I turned off JavaScript,
which I probably did.

Perhaps, instead, you could have your script do more like this:

<?php
  switch($_REQUEST['test_item']){
    case '1': require "static_page.htm"; break;
    case '2': require "dynamic_stuff.php"; break;
    default:
      error_log("Probably hack attempt $_REQUEST[test_item]");
      exit;
    break;
  }
?>

In this solution, you don't rely on flaky JavaScript being there, or
not, or maybe working, or not.

Plus, this solution is actually on-topic. :-)

YMMV

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


On Wed, November 1, 2006 10:09 am, Edward Kay wrote:
> $redirect_url = 'http://www.example.com/path/to/' . $redirect_page;
> header('Location:'.$redirect_url);
> exit();

Rant #43

I will never understand why one would waste bandwidth and bounce the
server/user/browser/user/browser/server back and for with a
header("Location: $x"); when require $x; will work just as well...

I just don't get it.

You chew up HTTP connections and bandwidth and end back up in the
exact same spot as if you just include() the file, if your application
is well-constructed.

Plus, cookies (and hence cookie-based sessions) and Location: headers
tend not to play well with each other, unless you strew your code with
sesssion_write_close() before each header("Location: ")... This
starts to get real counter-intuitive and difficult to track, at least
for my tired old brain.

:-)

PS
In either case, be careful *NOT* to have a wide-open variable in the
destination/include path.
Avoid this scenario:
http://example.com/page=../../../../../../../../etc/passwd
leading to:
<?php require $page; ?>

[lawyer voice-over]
(data left un-urlencoded for demo purposes)

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


I think Stut is right, you only need the one header!

Stut wrote:
> ianevansdigitalhit.com wrote:
>> Having a problem here trying to redirect some old pages.
>>
>> I've recently noticed using a server header check that my 301
>> redirects in
>> PHP are returning 302 instead.
>>
>> I'm using the following code:
>>
>> header('HTTP/1.1 301 Moved Permanently');
>> header('Location: newurl');
>> exit();
>>
>> Any reason why we're getting a 302 instead of a 301? This is keeping the
>> pages in Google instead of removing them and using the new location.
>>
>
> Just a shot in the dark, but it's possible that providing a "Location"
> header resets the status response. Try swapping your two header calls.
>
> -Stut
>

attached mail follows:


> Just a shot in the dark, but it's possible that providing a "Location"
> header resets the status response. Try swapping your two header calls.

Stut:
Flipping the headers doesn't work, unfortunately, running wget still shows
a 302 being returned.

Kris:
You need both headers. Just giving the Location would give a 302, when a
301 is the goal.

Just to add more info: We're running php as fastcgi under lighttpd. Doing
a little searching I see that there is some weirdness with http headers
when PHP is run as a CGI, but I can't seem to see any solutions out there.
Obviously I can't be the ONLY person running this way, so there has to be
a solution out there.

--
Ian Evans
Chairman & Executive Producer
DigitalHit.com

attached mail follows:


Have the lighttpd guys come up with any ideas?

On Nov 1, 2006, at 10:24 AM, ianevansdigitalhit.com wrote:

>> Just a shot in the dark, but it's possible that providing a
>> "Location"
>> header resets the status response. Try swapping your two header
>> calls.
>
> Stut:
> Flipping the headers doesn't work, unfortunately, running wget
> still shows
> a 302 being returned.
>
> Kris:
> You need both headers. Just giving the Location would give a 302,
> when a
> 301 is the goal.
>
> Just to add more info: We're running php as fastcgi under lighttpd.
> Doing
> a little searching I see that there is some weirdness with http
> headers
> when PHP is run as a CGI, but I can't seem to see any solutions out
> there.
> Obviously I can't be the ONLY person running this way, so there has
> to be
> a solution out there.
>
> --
> Ian Evans
> Chairman & Executive Producer
> DigitalHit.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


On Wed, November 1, 2006 12:24 pm, ianevansdigitalhit.com wrote:
>> Just a shot in the dark, but it's possible that providing a
>> "Location"
>> header resets the status response. Try swapping your two header
>> calls.
>
> Stut:
> Flipping the headers doesn't work, unfortunately, running wget still
> shows
> a 302 being returned.
>
> Kris:
> You need both headers. Just giving the Location would give a 302, when
> a
> 301 is the goal.
>
> Just to add more info: We're running php as fastcgi under lighttpd.
> Doing
> a little searching I see that there is some weirdness with http
> headers
> when PHP is run as a CGI, but I can't seem to see any solutions out
> there.
> Obviously I can't be the ONLY person running this way, so there has to
> be
> a solution out there.

First, determine if it's PHP or lighthttpd (?) that is doing it wrong.

Write a quick-hack Perl script to just do a 301 and Location and see
if Perl+lighthttpd gets you a 302 or a 301. We're talking a 5-minute
Google copy-paste for this, almost for sure. (Just make sure the
browser re-directs so it's "working" before you assume it is just from
wget output...)

If it's PHP only, then submit a bug report at http://bugs.php.net as,
to this naive reader, this is a pretty clear-cut bug.

If it's both PHP and Perl, odds are real good you need to take this up
with the lighthttpd folks, really, as there ain't much we can do about
it here...

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


> Write a quick-hack Perl script to just do a 301 and Location and see
> if Perl+lighthttpd gets you a 302 or a 301.

Did as you suggested and perl+lighttpd produces the 301 as expected.

So the unwanted 302 is just lighttpd+php.

This seems to be connected to http://bugs.php.net/bug.php?id=36705

--
Ian Evans
Chairman & Executive Producer
DigitalHit.com

attached mail follows:


On 11/1/06, ianevansdigitalhit.com <ianevansdigitalhit.com> wrote:
> > Just a shot in the dark, but it's possible that providing a "Location"
> > header resets the status response. Try swapping your two header calls.
>
>
> Just to add more info: We're running php as fastcgi under lighttpd. Doing
> a little searching I see that there is some weirdness with http headers
> when PHP is run as a CGI, but I can't seem to see any solutions out there.
> Obviously I can't be the ONLY person running this way, so there has to be
> a solution out there.

what version of php?

Curt.

attached mail follows:


> what version of php?

PHP 5.1.4 (cgi-fcgi)

attached mail follows:


I think that's what he's trying, but he's missing the fact that he
needs to include the actual "From: " that you've specified.

In other words, I think he's doing:

mail("someoneoverthere.com", "Subject", "Body", "someonehere.com");

instead of:

mail("someonesomewhere.com", "Subject", "Body",
"From:webmasterhere.com");

On Oct 31, 2006, at 10:55 PM, M.Sokolewicz wrote:

> Why can't you just add a
> From: Registrar <registrarmycompany.ca>
> header? =/
>
> - tul
>
> Chris wrote:
>> Beauford wrote:
>>> That doesn't work.
>>>
>>> Here is what I have.
>>>
>>> mail($email,$subject,$body,$from);
>>> Which is (senders address, the subject, the body of the message,
>>> and the
>>> from address)
>>>
>>> The from address is taken from this, and I added the -f in front
>>> of it.
>>> define("regaddress", "-fregistrartotalcomputercare.ca");
>>>
>>> It still says it comes from:
>>> Nobody [nobodyhost.hosting.com]; on behalf of; Registrar
>>> [-fregistrarmycompany.ca]
>> That's something different entirely to what your original email said.
>> Your mail server is adding that, it's not a php setting you can
>> change.
>> If you look at the mail source, it will have an extra header in
>> there (can't remember what it is but check against this email -
>> something like "Sender" or "Sender-Address").
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


On Tue, October 31, 2006 8:59 pm, Beauford wrote:
> That doesn't work.
>
> Here is what I have.
>
> mail($email,$subject,$body,$from);
>
> Which is (senders address, the subject, the body of the message, and
> the
> from address)
>
> The from address is taken from this, and I added the -f in front of
> it.
> define("regaddress", "-fregistrartotalcomputercare.ca");
>
> It still says it comes from:
> Nobody [nobodyhost.hosting.com]; on behalf of; Registrar
> [-fregistrarmycompany.ca]

You're confusing the 4th and 5th parameters, partially because Chris
has misled you :-)

4th: Regular headers like "From: registrartotalcomputercare.ca" and
"Reply-to: registrartotalcomputercare.ca"

5th: Args to sendmail, if your PHP user is a trusted user for sendmail
(unlikely in a shared-host environment with no php.ini) so you can
hack the "-f" which really truly forges the "sender" rather than
kinda/sorta forging it.

They are quite different, and serve different purposes.

You probably only *need* the 4th at this point, but need to construct
valid email headers (see 4th above) and not valid sendmail command
line flags (what you are trying to do now).

Note that spam filters will "catch" the forgery in 4th and penalize
you for it, so do everything else you can to make your email not look
like spam. Unless it is spam, in which case you want to be sure to
use HTML enhanced (cough, cough) email, and lots of USELESS CAPS and
plenty of explamation points!!! and be sure to attach a couple GIF
images, and embed a reader-tracking GIF and...

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


I'm trying retrieve a directory name and a filename with a form. I want
to use input type file so the user can browse for the file but keep the
whole directory name.
Any help
Sean

attached mail follows:


On Wed, November 1, 2006 12:50 pm, Sugrue, Sean wrote:
> I'm trying retrieve a directory name and a filename with a form. I
> want
> to use input type file so the user can browse for the file but keep
> the
> whole directory name.

I don't think you *can* get a directory name out of standard HTML inputs.

This is a big-time security/privacy issue -- It's none of your damn
business where I keep my files in my hard drive, thank you very much.
:-)

There may be some kind of badly-broken insecure ActiveX thingie to let
you do that...

The browser/OS already is configurable by the user to re-use their
last directory, or always start in "My Documents" (ugh!) or whatever
directory any other app. happened to use or whatever is suitable for
that OS. Don't try to dink with that. It's not within your pervue.

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


I don't think web browsers are going to send you the name of the
directory the file comes from.

On Nov 1, 2006, at 10:50 AM, Sugrue, Sean wrote:

> I'm trying retrieve a directory name and a filename with a form. I
> want
> to use input type file so the user can browse for the file but keep
> the
> whole directory name.
> Any help
> Sean
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


No comments?

http://it.slashdot.org/it/06/10/31/2047209.shtml

Personally I'm unsure. I would like to think that Zend is smart enough to
realize M$ tactics of embrace/extend and will not allow that to happen. But
everyone has a price, and you through enough money at something and you can
make "things happen" (as M$ knows all to well).

I also would NEVER (by choice) use M$ for a web server, not due to any
anti-M$ sentiment (I use XP as my desktop), but just b/c I feel LAMP is just
so integrated and works so well for this task, why fix what isn't broken. So
personally I could give a shit if PHP works well on IIS.

ÐÆ5ÏÐ

attached mail follows:


On Wed, 2006-11-01 at 11:37 -0800, Daevid Vincent wrote:
> No comments?
>
> http://it.slashdot.org/it/06/10/31/2047209.shtml
>
> Personally I'm unsure. I would like to think that Zend is smart enough to
> realize M$ tactics of embrace/extend and will not allow that to happen.

I'm not worried, you can't kill open source with that tactic.

Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

attached mail follows:


It's great to see Microsoft be so supportive of PHP. Go Andi! :)

> Personally I'm unsure. I would like to think that Zend is smart
> enough to
> realize M$ tactics of embrace/extend and will not allow that to
> happen. But
> everyone has a price, and you through enough money at something and
> you can
> make "things happen" (as M$ knows all to well).
> I also would NEVER (by choice) use M$ for a web server, not due to any
> anti-M$ sentiment (I use XP as my desktop), but just b/c I feel
> LAMP is just
> so integrated and works so well for this task, why fix what isn't
> broken. So
> personally I could give a shit if PHP works well on IIS.

attached mail follows:


On Wed, November 1, 2006 1:37 pm, Daevid Vincent wrote:
> http://it.slashdot.org/it/06/10/31/2047209.shtml

I think MS and PHP Devs have met before, in the hopes of getting
better integration and performance.

I'm sure this is a boon and a feather in their cap for Zend, but,
ultimately, I don't see it making a huge difference in PHP, other than
improving it a tiny bit for Windows users.

Hopefully this boils down to somebody at Zend getting a crack at
Longhorn/Vista/Whatever source to find optimizations.

And maybe submit a patch or ten back to MS to fix some long-standing
Windows issues.

Perhaps even to tailor the Windows builds with even more #ifdef to get
better performance/stability.

But, again, with the millions of non-Windows users as the big install
base, I don't changing much.

Some Windows users will leave the dark side once they realize they can.

Some Linux users may migrate back to Windows to keep tighter
integration with other software, if Windows was actually finally
stable.

I'm predicting a "tie" in this race from that perspective :-)

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


ps... I wonder if .NET will ever support PHP *GRIN*

On Nov 1, 2006, at 11:59 AM, Ed Lazor wrote:

> It's great to see Microsoft be so supportive of PHP. Go Andi! :)
>
>> Personally I'm unsure. I would like to think that Zend is smart
>> enough to
>> realize M$ tactics of embrace/extend and will not allow that to
>> happen. But
>> everyone has a price, and you through enough money at something
>> and you can
>> make "things happen" (as M$ knows all to well).
>> I also would NEVER (by choice) use M$ for a web server, not due to
>> any
>> anti-M$ sentiment (I use XP as my desktop), but just b/c I feel
>> LAMP is just
>> so integrated and works so well for this task, why fix what isn't
>> broken. So
>> personally I could give a shit if PHP works well on IIS.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


On Wednesday 01 November 2006 21:37, Daevid Vincent wrote:
> No comments?
>
> http://it.slashdot.org/it/06/10/31/2047209.shtml
>
Well once upon a time one of great M$ exec say "We can write better software
than OSS). After more than 3 or 4 years we still waiting better Browser, Web
Server etc.

I do not expect from M$ learn someting from ZEND and put into ASP.NET or
someting like that. Php was already opensourced. If M$ wants to steal
someting, code already there.

In worst scenario, because of windows user base and windows based income ZEND
may degraded Linux support or we may see new options or performance
enhancements for windows only.

so We will see that...

Don't be afraid, GPL licence was uber protection for us.

And thats why M$ execs calls it 'cancer'. Theri EEE tactics does not work
aginst GPL.

And writing windows native applications with php under Visual Studio may be
interesting...

Regards

Sancar

attached mail follows:


On Wed, 2006-11-01 at 23:08 +0200, Sancar Saran wrote:
> On Wednesday 01 November 2006 21:37, Daevid Vincent wrote:
> > No comments?
> >
> > http://it.slashdot.org/it/06/10/31/2047209.shtml
> >
> Well once upon a time one of great M$ exec say "We can write better software
> than OSS). After more than 3 or 4 years we still waiting better Browser, Web
> Server etc.
>
> I do not expect from M$ learn someting from ZEND and put into ASP.NET or
> someting like that. Php was already opensourced. If M$ wants to steal
> someting, code already there.
>
> In worst scenario, because of windows user base and windows based income ZEND
> may degraded Linux support or we may see new options or performance
> enhancements for windows only.
>
> so We will see that...
>
> Don't be afraid, GPL licence was uber protection for us.
>
> And thats why M$ execs calls it 'cancer'. Theri EEE tactics does not work
> aginst GPL.
>
> And writing windows native applications with php under Visual Studio may be
> interesting...

PHP isn't GPL, it's free without the viral aspect.

Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

attached mail follows:


> And writing windows native applications with php under Visual
> Studio may be
> interesting...

I use RealBasic a lot for cross-platform development... it would be
cool if PHP were the base language, instead of Basic *grin*

-Ed

attached mail follows:


This one time, at band camp, Ed Lazor <edlazoryahoo.com> wrote:

> ps... I wonder if .NET will ever support PHP *GRIN*

or perhaps something to counter php-gtk... win32php

that would would be interesting

Kevin

--
"Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb contesting the vote."

attached mail follows:


http://www.winbinder.com

much better than GTK if you work on Windows platforms and want standalone PHP apps :)

And I can't find it now, but a few years ago when I was dipping my toe into the ASP.NET world to try to be compliant with "Existing standards" in a company I worked for (before abandoning it and just forcing them to allow me to use PHP :) I swear I saw something about PHP for .NET.

-TG

= = = Original message = = =

This one time, at band camp, Ed Lazor <edlazoryahoo.com> wrote:

> ps... I wonder if .NET will ever support PHP *GRIN*

or perhaps something to counter php-gtk... win32php

that would would be interesting

Kevin

--
"Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb contesting the vote."

___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

attached mail follows:


> -----Original Message-----
> From: Ed Lazor [mailto:edlazoryahoo.com]
> Sent: Wednesday, November 01, 2006 12:05 PM
> Cc: Daevid Vincent; PHP General
> Subject: Re: [PHP] Microsoft Partners With Zend
>
> ps... I wonder if .NET will ever support PHP *GRIN*

I guess that's sorta what I'm afraid of... PHP#
(like the did to Java -> J++ -> C# )

Don't get me wrong. C# is a great language (probably one of the few things
that M$ did right), and I'd LOOOOOVE to use a real IDE like Visual Studio to
dev in...

But I'm also terrified they'll pervert PHP.

DÆVID

attached mail follows:


[snip]
I guess that's sorta what I'm afraid of... PHP#
(like the did to Java -> J++ -> C# )

Don't get me wrong. C# is a great language (probably one of the few
things
that M$ did right), and I'd LOOOOOVE to use a real IDE like Visual
Studio to
dev in...

But I'm also terrified they'll pervert PHP.
[/snip]

Please NO.... PHP.NET === ACCCKKKKKKKKKKKKKKKKKKKKKKK

attached mail follows:


I don't think there's anything to worry about MS making any changes with
PHP. I'm at the Zend conference righ t now, and they've had some talks
about working with MS. Mostly they're trying to fix a lot of the
segfaults and performance issues that PHP has on theh Win32 platform.
You might see some changes in the future that pertain to Active
Directory integration for single sign-on (other than ldap) and a few
other Win32 based technologies.

For Zend... you get more people using PHP, because now they can use PHP
with confidence and ditch ASP if they need to ;)

Ray

> -------- Original Message --------
> Subject: RE: [PHP] Microsoft Partners With Zend
> From: "Jay Blanchard" <jblanchardpocket.com>
> Date: Wed, November 01, 2006 3:23 pm
> To: "Daevid Vincent" <daeviddaevid.com>, "PHP General"
> <php-generallists.php.net>
>
> [snip]
> I guess that's sorta what I'm afraid of... PHP#
> (like the did to Java -> J++ -> C# )
>
> Don't get me wrong. C# is a great language (probably one of the few
> things
> that M$ did right), and I'd LOOOOOVE to use a real IDE like Visual
> Studio to
> dev in...
>
> But I'm also terrified they'll pervert PHP.
> [/snip]
>
> Please NO.... PHP.NET === ACCCKKKKKKKKKKKKKKKKKKKKKKK
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

attached mail follows:


I don't think there's anything to worry about MS making any changes with
PHP. I'm at the Zend conference righ t now, and they've had some talks
about working with MS. Mostly they're trying to fix a lot of the
segfaults and performance issues that PHP has on theh Win32 platform.
You might see some changes in the future that pertain to Active
Directory integration for single sign-on (other than ldap) and a few
other Win32 based technologies.

For Zend... you get more people using PHP, because now they can use PHP
with confidence and ditch ASP if they need to ;)

Ray

> -------- Original Message --------
> Subject: RE: [PHP] Microsoft Partners With Zend
> From: "Jay Blanchard" <jblanchardpocket.com>
> Date: Wed, November 01, 2006 3:23 pm
> To: "Daevid Vincent" <daeviddaevid.com>, "PHP General"
> <php-generallists.php.net>
>
> [snip]
> I guess that's sorta what I'm afraid of... PHP#
> (like the did to Java -> J++ -> C# )
>
> Don't get me wrong. C# is a great language (probably one of the few
> things
> that M$ did right), and I'd LOOOOOVE to use a real IDE like Visual
> Studio to
> dev in...
>
> But I'm also terrified they'll pervert PHP.
> [/snip]
>
> Please NO.... PHP.NET === ACCCKKKKKKKKKKKKKKKKKKKKKKK
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

attached mail follows:


On 11/1/06, Daevid Vincent <daeviddaevid.com> wrote:
> Personally I'm unsure. I would like to think that Zend is smart enough to
> realize M$ tactics of embrace/extend and will not allow that to happen.

MS added a FastCGI module to IIS. Thats the big thing.

The real question is, why doesn't Apache have FastCGI as a core
module? FastCGI does even compile with the general release of Apache
anymore, without hacking the defines yourself. Little sites may be
fine with php as cgi or as a module, but neither scales well like
FastCGI. God help us all if FastCGI on Windows becomes the best (or
only) supported way of doing FastCGI!

-s

attached mail follows:


On 11/1/06, steve <iamstevergmail.com> wrote:
> On 11/1/06, Daevid Vincent <daeviddaevid.com> wrote:
> > Personally I'm unsure. I would like to think that Zend is smart enough to
> > realize M$ tactics of embrace/extend and will not allow that to happen.
>
> MS added a FastCGI module to IIS. Thats the big thing.

They demo'd it at the zend conference with IIS7 on vista (installed on
a macbook pro), there is also a bunch of work zend has done to improve
speed.. the non improved php5 version benched like 30 requests/sec,
the zend patched version did over 100 requests/sec.

Then they demo'd the kernel cache; 6500 requests/sec. (and no i didn't
typo and add an extra zero).

Curt.

attached mail follows:


On Tue, October 31, 2006 9:42 pm, Google Kreme wrote:
>> My first guess would be to check out the various "panel" solutions
>> for
>> having a web interface that webhosts provide to edit what is
>> essentially a simple text file, which configures the web server,
>> mail
>> server, ftp server, etc. These all have all the exact same issues
>> you
>> will face, so there might be one that fits your needs.
>
> Any specific recommendations? The only one of these I am familiar
> with is the absurdly expensive cpanel.

Sorry.

My "cpanel" is called "vi" :-)

Google is your friend on this one. There are only a few thousand
OpenSource "panels" out there, I'll bet...

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


On Tue, October 31, 2006 3:46 pm, Wang Chen wrote:
> I would like to add two buttons on a page form infomation
> confirmation,
> however, the html code in php nest can not be known by browser if I
> put
> <form xxxxxxx> <input xxxxxxxxxx> </form> into there.
> Besically, there is a mail form to enter iterm infomaiton, if it exist
> before, prompt its iterm id., if it is new, query a next available
> inerm id
> for it, then, show a page to ask such as, "do you accept this id?",
> two
> buttons below this question, yes and no.
>
> Is there any fountion in php which can make it? Thanks.

PHP lives and runs, eats and breathes, lives and dies, ONLY on your
web-server.

You want something to happen in real-time with the user interaction,
almost-for-sure PHP is not going to be involved, at least not for your
first attempt at this.

You may end up going down the AJAX-y route, and having PHP back in the
picture for suggesting the next potential iterm id (whatever that is)
but it will just be a tiny little PHP script to pick the next ID, not
anything to do with how it's presented to the user or showing/hiding
form elements in real-time -- that's all JavaScript. Or Java applet.
Or even Flash (blech).

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


On Tue, October 31, 2006 2:54 pm, Prathaban Mookiah wrote:
> alone to do the entire job due the high delay it takes to connect to
> the
> telnet port on the robot, (I adopted the PHPTelnet class written by
> Antone
> Roundy - http://www.geckotribe.com/php-telnet/), I could not resist
> using it
> for some part of the application.
>
> So the model I used for my purpose is this:
>
> Browser ---------> WebServer ---------> Java --------> Robot
> AJAX PHP

As cool as this might be, and as much as I love PHP, I have to suggest
that PHP has little "Added Value" here, other than as an academic
exercise, as you have presented it...

I think you would want to express what your perceived added value of
PHP in the process is, as I would expect that you'd just have AJAX
talking to Java, or Java applets or whatever, with no PHP, and achieve
the same output with less overhead.

So what's the compelling added value of PHP here?

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


I totally agree with your view. PHP does not bring in any "added value" into
this project. The primary impetus behind me using PHP was my personal liking
towards PHP. But this is a good point to ponder upon - what benefits does PHP
offer to the academic community over traditional cgi tools.

One thing is the ease of configuration and deployment of PHP. As someone
doing research, I do not want to get bogged up with the overwhelming
intricacies involved with installing and configuring a servlet or
configurting a .net environment. At least I find them too complex. PHP on the
other hand saves so much time, that I can just concentrate on writing the
scirpt and generating the result instead of googling on how to troubleshoot a
misbehaving cgi program.

And I kind of disagree with you about the overhead issue. I did try a servlet
running on a TomCat and I could say PHP on a Apache was not too bad at all.
And applets are a big security headache.

Besides I am not sure if there are any licensing issues involved with Java.

Any other inputs for the list? I can use some ideas for my papers. ha ha..

Cheers,

Prathap

---------- Original Message -----------
From: "Richard Lynch" <ceol-i-e.com>
To: "Prathaban Mookiah" <prathapee.pdn.ac.lk>
Cc: php-generallists.php.net
Sent: Wed, 1 Nov 2006 14:50:11 -0600 (CST)
Subject: Re: [PHP] Remote Robot Control with PHP

> On Tue, October 31, 2006 2:54 pm, Prathaban Mookiah wrote:
> > alone to do the entire job due the high delay it takes to connect to
> > the
> > telnet port on the robot, (I adopted the PHPTelnet class written by
> > Antone
> > Roundy - http://www.geckotribe.com/php-telnet/), I could not resist
> > using it
> > for some part of the application.
> >
> > So the model I used for my purpose is this:
> >
> > Browser ---------> WebServer ---------> Java --------> Robot
> > AJAX PHP
>
> As cool as this might be, and as much as I love PHP, I have to
> suggest that PHP has little "Added Value" here, other than as an academic
> exercise, as you have presented it...
>
> I think you would want to express what your perceived added value of
> PHP in the process is, as I would expect that you'd just have AJAX
> talking to Java, or Java applets or whatever, with no PHP, and
> achieve the same output with less overhead.
>
> So what's the compelling added value of PHP here?
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some starving artist.
> http://cdbaby.com/browse/from/lynch
> Yeah, I get a buck. So?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
------- End of Original Message -------

attached mail follows:


Hello,

The objects in an OO website/program is always alive in the session, or they
die at the end of the execution of each page?

and what about making something like this:
"front-building-engine" in javascript
AJAX tells to PHP the events
AJAX request and load data from PHP
PHP sends "front-layout-specification"

--
View this message in context: http://www.nabble.com/OO-website-program-doubt-tf2555845.html#a7122248
Sent from the PHP - General mailing list archive at Nabble.com.

attached mail follows:


No variable is part of session data, unless you specifically add it
yourself.

Sorry, can't answer to AJAX, haven't had time to play with it.

On Nov 1, 2006, at 12:50 PM, Meghdad Azriel wrote:

>
> Hello,
>
> The objects in an OO website/program is always alive in the
> session, or they
> die at the end of the execution of each page?
>
>
> and what about making something like this:
> "front-building-engine" in javascript
> AJAX tells to PHP the events
> AJAX request and load data from PHP
> PHP sends "front-layout-specification"
>
>
> --
> View this message in context: http://www.nabble.com/OO-website-
> program-doubt-tf2555845.html#a7122248
> Sent from the PHP - General mailing list archive at Nabble.com.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


On Wed, November 1, 2006 2:50 pm, Meghdad Azriel wrote:
> The objects in an OO website/program is always alive in the session,
> or they
> die at the end of the execution of each page?

They die and are resurrected like zombies on the next page.

The Resurrection is slightly more complicated than that described in
the Bible, however, requiring some serious gnarly timing issues in
your loading of the class definitions before you attempt to use the
objects...

Probably best to load all your class definitions before you do
session_start() from that perspective, though I don't know as I never
use OOP much in PHP.

You *could* write a daemon in PHP to have long-lived objects, however,
if you want to keep them around for a long shelf life.

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


yo rich (or others)...

does php provide the ability to store objects in a session var????

-----Original Message-----
From: Richard Lynch [mailto:ceol-i-e.com]
Sent: Wednesday, November 01, 2006 1:16 PM
To: Meghdad Azriel
Cc: php-generallists.php.net
Subject: Re: [PHP] OO website/program doubt

On Wed, November 1, 2006 2:50 pm, Meghdad Azriel wrote:
> The objects in an OO website/program is always alive in the session,
> or they
> die at the end of the execution of each page?

They die and are resurrected like zombies on the next page.

The Resurrection is slightly more complicated than that described in
the Bible, however, requiring some serious gnarly timing issues in
your loading of the class definitions before you attempt to use the
objects...

Probably best to load all your class definitions before you do
session_start() from that perspective, though I don't know as I never
use OOP much in PHP.

You *could* write a daemon in PHP to have long-lived objects, however,
if you want to keep them around for a long shelf life.

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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

attached mail follows:


Yes. Check the mailing list archive. We just had a discussion about
2 weeks ago that talked about this and gave a few examples.

On Nov 1, 2006, at 1:30 PM, bruce wrote:

> yo rich (or others)...
>
> does php provide the ability to store objects in a session var????
>
>
>
> -----Original Message-----
> From: Richard Lynch [mailto:ceol-i-e.com]
> Sent: Wednesday, November 01, 2006 1:16 PM
> To: Meghdad Azriel
> Cc: php-generallists.php.net
> Subject: Re: [PHP] OO website/program doubt
>
>
> On Wed, November 1, 2006 2:50 pm, Meghdad Azriel wrote:
>> The objects in an OO website/program is always alive in the session,
>> or they
>> die at the end of the execution of each page?
>
> They die and are resurrected like zombies on the next page.
>
> The Resurrection is slightly more complicated than that described in
> the Bible, however, requiring some serious gnarly timing issues in
> your loading of the class definitions before you attempt to use the
> objects...
>
> Probably best to load all your class definitions before you do
> session_start() from that perspective, though I don't know as I never
> use OOP much in PHP.
>
> You *could* write a daemon in PHP to have long-lived objects, however,
> if you want to keep them around for a long shelf life.
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some starving artist.
> http://cdbaby.com/browse/from/lynch
> Yeah, I get a buck. So?
>
> --
> 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
>

attached mail follows:


This one time, at band camp, "bruce" <bedouglasearthlink.net> wrote:

 
> does php provide the ability to store objects in a session var????

yes
http://phpro.org/tutorials/Introduction-to-PHP-Sessions.html#8

Kevin

--
"Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb contesting the vote."

attached mail follows:


bruce wrote:
> yo rich (or others)...
>
> does php provide the ability to store objects in a session var????

You just need to make sure you load the class before the session:

include('user_class.php');
...

session_start();

otherwise you get "incomplete class" errors.

--
Postgresql & php tutorials
http://www.designmagick.com/

attached mail follows:


On Tue, October 31, 2006 1:20 pm, Keith Spiller wrote:
> RE: Manually Inserted Row
>
> I'm using PHP to retrieve the values for the manual insert... I
> originally
> tried using
> an array created from the mysql query and adding one row manaually and
> then
> sorting the multidimensional array.
>
> As Richard pointed out, sorting using the database would be much more
> efficient.
>
> So here I am. Stuck again...
>
> (SELECT ID, Title, Label, Location, Start, End, Time, Description,
> Organization,
> Department, Contact, Phone, Email, Global, Board, Committee, Status,
> TBD_Time ,
> TO_DAYS(End) - TO_DAYS(Start) + 1 AS Days
> FROM site_calendar_v2
> UNION
> SELECT '99999', 'No events exist for this month...', '', '', '',
> '0000-00-00', '00:00:00',
> '', '', '', '', '', '', '1', 'BOX', 'EOG', '', '',
> as z )
> WHERE Board='BOX' AND Committee='EOG'
> ORDER BY z
>
>
> This fails. Any ideas how I can fix this manually inserted row?

Dunno why if fails, but don't do that. :-)

Just do the select you want in the first place. Then:

<?php
  if (mysql_num_rows($result) === 0){
    echo "No events exist for this month...";
  }
  while (list($id, $title, blah blah blah) = mysql_fetch_row($result)){
    echo "$id $title blah blah blah<br />n";
  }
?>

MUCH simpler!

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


On Tue, October 31, 2006 6:22 pm, Daevid Vincent wrote:
>> There is nothing to "re-compile" here.
>> The command line has an existing flag for you to specify the php.ini
>> file, or to override any setting[s] within the php.ini file.
>
> Mebbe so, but that's equally obnoxious to pass this command line
> parameter
> to a lot of existing scripts. It's just easier to re-compile and
> 'globally'
> set the output_handler in a different php.ini file to what it used to
> be
> before we optimized. This script issue has just started to rear it's
> ugly
> head as we used to just use the default handler till recently. Our web
> pages
> work great (obviously), but we've noticed strangeness with the CLI
> stuff.
> Hence this dilemna.

I just don't get this...

You're going to recompile all of PHP to embed a string into the
executable to point to a different "php.ini" instead of just putting
that in your shell script somewhere?

Okay.
[shrug]

Have at it.

>> Bottom line, you can't step in the same river twice, and if php.ini
>> tells PHP to set up an ob_* handler before your script runs, it's
>> impossible to "undo" that just because you changed a setting that's
>> already been acted upon.
>
> I would agree if PHP used a one-pass parser. But there is a
> pre-parsing to
> lint check and other 'setup' stuff. Seems that could utilize and
> prepare the
> set_ini() for the second pass which runs the actual script.
>
> Nothing is "impossible". It's just not implemented.

But many set_ini() are meant to be changed in real-time with the
execution of the script!

So you'd have to parse for only the set_ini() that has your particular
setting.

Plus, there's no law that the args to set_ini() can't be from a
database, or other dynamic data in a variable. So you'd have to
execute the whole program to find out what the values are in some
cases.

Unless you want to pre-parse set_ini() for constants differently than
set_ini() for variables. [shudder]

If you think this should be implemented, feel free to take it up with
-internals or just submit a patch...

But I honestly think you haven't really examined this in enough detail
to understand why you're just not making sense here... :-)

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


> Unless you want to pre-parse set_ini() for constants differently than
> set_ini() for variables. [shudder]

It sounds like we just need support for pre-parser commands. You end
up with one set of variables, but now you have the opportunity to
change attributes of the environment before script processing
begins. Then again, there's probably problems related to doing
something like this. Any idea of what they would be?

-Ed

attached mail follows:


Hello there,

I'm having a somewhat unusual question here, and I cannot find any way
to solve it.

I have a PHP page that displays a message, and then, performs a very
long operation. Note that it displays the message first.
I do not intend to give some feedback to the user when the operation is
done.

I've seen I can use ignore_user_abort() to prevent the user from
stopping the ongoing operation, but that solves only part of my problem.
Because as long as the page is not fully loaded, the mouse cursor in the
user's browser is showing a watch.

So ideally, what I would like is to be able to close the connection from
the server-side, but without using the exit() function, so my script
keeps running afterwards.

I know I could use a system() call to launch another process to do the
processing, but I would like to avoid doing that, because there are many
variables in the context that I cannot easily pass in parameter.

I also tried to use the register_shutdown_function() to perform my
operation after the page is displayed but since PHP 4.1.0, the
connection is closed after the function is called....

Would any of you have an idea on how I could close that connection?

Thanks a lot,
David
www.thecodingmachine.com

attached mail follows:


dejavu!

This thread was just on the mailing list recently... check the
mailing list archives.

-Ed

On Nov 1, 2006, at 1:24 PM, David Négrier wrote:

> Hello there,
>
> I'm having a somewhat unusual question here, and I cannot find any
> way to solve it.
>
> I have a PHP page that displays a message, and then, performs a
> very long operation. Note that it displays the message first.
> I do not intend to give some feedback to the user when the
> operation is done.
>
> I've seen I can use ignore_user_abort() to prevent the user from
> stopping the ongoing operation, but that solves only part of my
> problem. Because as long as the page is not fully loaded, the mouse
> cursor in the user's browser is showing a watch.
>
> So ideally, what I would like is to be able to close the connection
> from the server-side, but without using the exit() function, so my
> script keeps running afterwards.
>
> I know I could use a system() call to launch another process to do
> the processing, but I would like to avoid doing that, because there
> are many variables in the context that I cannot easily pass in
> parameter.
>
> I also tried to use the register_shutdown_function() to perform my
> operation after the page is displayed but since PHP 4.1.0, the
> connection is closed after the function is called....
>
> Would any of you have an idea on how I could close that connection?
>
> Thanks a lot,
> David
> www.thecodingmachine.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Maybe this can help

PHP MIME Decoder. This class decodes Mime Encoded email message. Attachments
are stored in a directory.
Works with Multipart/alternative, multipart/mixed etc.

http://www.weberdev.com/get_example-1607.html

 

-----Original Message-----
From: Andy [mailto:frumar-sd.net]
Sent: Tuesday, October 31, 2006 1:37 PM
To: php-generallists.php.net
Subject: [PHP] PHP IMAP with Attachments!?

Hi to all,

I need a class that reads emails from a server and reads the attachments
from the mail.

The mailservers is an IMAP for mail reading.

The attachment types can be: images/pdf/text documents.

Any suggestions?

On phpclasses.org did not find any which works well.

Regards,
Andy.

attached mail follows:


You should also post here :

PHP MySQL Jobs and Projects :
http://www.weberforums.com/forum20.html

-----Original Message-----
From: Larry Garfield [mailto:larrygarfieldtech.com]
Sent: Thursday, October 26, 2006 5:16 AM
To: php-generallists.php.net
Subject: [PHP] Job Opening

Well since the consensus seemed to be to allow job postings, I'll make one.
:-)

My company is looking for a few good PHP programmers.

We are a Chicago-area web consulting firm developing web sites and web
applications for a variety of clients, including several large academic
institutions.  We are looking for skilled PHP developers to join our team.
(Sorry, that means yes, you'd have to work with me.)  It's a small but
growing company of less than 10 people, all fairly young and geeky. :-)
Experience with PHP (although not necessarily prior work experience) is a
must.  

If interested, contact me OFF-LIST for more information.  Note: I am NOT in
a hiring position, so do NOT send me your resume. :-)  I'm just going to
pass you on to the person who is.

--
Larry Garfield AIM: LOLG42
larrygarfieldtech.com ICQ: 6817012

"If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an idea,
which an individual may exclusively possess as long as he keeps it to
himself; but the moment it is divulged, it forces itself into the possession
of every one, and the receiver cannot dispossess himself of it." -- Thomas
Jefferson

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

attached mail follows:


I am wondering if any of you know what it is called when letters come up
for the user to key in for
form entry verification. Ron

attached mail follows:


Captcha
http://en.wikipedia.org/wiki/Captcha

On 11/1/06, Ron Piggott (PHP) <ron.phpactsministries.org> wrote:
> I am wondering if any of you know what it is called when letters come up
> for the user to key in for
> form entry verification. Ron
>
>