php-general Digest 1 Nov 2006 01:18:08 -0000 Issue 4433

Topics (messages 243944 through 243979):

Re: IIS Rewrite or Mod_Rewrite
        243944 by: Jochem Maas
        243948 by: Kevin

Re: PHP & Memory Allocation (checked via TOP)
        243945 by: Jon Anderson

Re: No Error Messages
        243946 by: clive
        243957 by: Richard Lynch
        243967 by: Børge Holen

Re: Imagecopyresampled creates black pictures
        243947 by: Martin Hochreiter

[ACIDIC HUMOR] Re: [PHP] IIS Rewrite or Mod_Rewrite
        243949 by: Jochem Maas
        243950 by: Stut

Re: Decide witch table within a union
        243951 by: Ed Lazor

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

Re: Run script every 30 seconds
        243953 by: Ed Lazor

Re: channels attribute value returns wrong
        243954 by: Ed Lazor

Re: Is there such a thing?
        243955 by: Rory Browne
        243956 by: Jay Blanchard
        243958 by: Ed Lazor

Sorting Multidimensional Array
        243959 by: Keith Spiller
        243966 by: Richard Lynch
        243968 by: Keith Spiller

Re: counting records in db
        243960 by: Richard Lynch
        243965 by: Robert Cummings

Re: need help with foreach
        243961 by: Richard Lynch

Re: only one at atime
        243963 by: Richard Lynch
        243970 by: Ed Lazor

Re: How do I get ini_set('output_handler', '') to work?!
        243964 by: Richard Lynch
        243978 by: Daevid Vincent

Re: PHP IMAP with Attachments!?
        243969 by: Manuel Lemos

Manually Inserted Row
        243971 by: Keith Spiller
        243975 by: Børge Holen

Remote Robot Control with PHP
        243972 by: Prathaban Mookiah
        243973 by: Dan McCullough
        243976 by: Manuel Lemos

Add buttons on the fly
        243974 by: Wang Chen
        243977 by: Chris

301 redirect returning 302 instead
        243979 by: ianevans.digitalhit.com

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 ---
Kevin wrote:
> Hi,
> 
> I have created a website which is using the iis rewrite module to write
> the following:
> 
> index.php?tn_id=5&ln_id=4 to something like
> 
> /contact/directions.html and this works fine
> 
> however I have a link at the bottom which needs to pass another variable
> through the query string before it would simply be:
> 
> index.php?tn_id=5&ln_id=4&ts=75
> 
> however if i run
> 
> /contact/directions.html?ts=75 it doesn't work and comes up with a 404
> page not found error.
> 
> Is there anyway around this?

yes Apache, are you allowed/able to use apache?

> 
> Thanks
> 
> Kevin
> 

--- End Message ---
--- Begin Message ---
Jochem Maas wrote:
Kevin wrote:
Hi,

I have created a website which is using the iis rewrite module to write
the following:

index.php?tn_id=5&ln_id=4 to something like

/contact/directions.html and this works fine

however I have a link at the bottom which needs to pass another variable
through the query string before it would simply be:

index.php?tn_id=5&ln_id=4&ts=75

however if i run

/contact/directions.html?ts=75 it doesn't work and comes up with a 404
page not found error.

Is there anyway around this?

yes Apache, are you allowed/able to use apache?

Thanks

Kevin

no only allowed to use windows server

--- End Message ---
--- Begin Message ---
Cabbar Duzayak wrote:
Hi,

I have written a simple test program to see how php allocates memory.
Test code allocates ~10 Meg of RAM in an array within a loop till it
runs out of memory as:

 $str = rand(65, 95) . rand(65, 95) . rand(65, 95) . rand(65, 95) .
rand(65, 95);
 $aa[] = str_repeat($str, 2000000);

What I don't understand here is, for every 10 Meg memory it allocates,
mem usage goes up about 19 Megs when I look at this via top.
Just looked over this really quickly, so I might have missed something, but it seems to me that you're allocating almost 20 megs...

your $str is 10 bytes long (plus terminator and PHP overhead, whatever that turns out to be...), and you're repeating it two million times. 10 bytes times 2 million is 20 million bytes. 20 000 000 divided by (1024*1024) is 19.07 -> it seems to me that you're allocating 19.07 megs, and top is showing you that it's allocating 19 megs...? Seems about right.

jon

--- End Message ---
--- Begin Message ---
Sancar Saran wrote:

If page has some errors it stop producing any error messages. Neither page nor syslog.

have you looked at the error_reporting setting in your php.ini file.

perhaps set it too E_ALL, mine was set to E_ALL & ~E_NOTICE by default on ubuntu 6.10.



--- End Message ---
--- Begin Message ---
On Tue, October 31, 2006 6:24 am, Sancar Saran wrote:
> If page has some errors it stop producing any error messages. Neither
> page nor
> syslog.
>
> I get blank page.

If it's a fatal error, or one too serious to be trapped by an error
handler, then your script will just stop.

> System
> Debian Unstable
> Apache 2
> Php 5.1.6
>
> Apc
> Memcached
> Obhandler with gzip
> and I store entire page output then printed out.

You may have installed something which does something like:
while (ob_get_level()) ob_end_flush();

> And I found if my error on first pages there was no problem, error
> message
> show in page and syslog and if that eroor is in included files. I get
> absolutely Nothing.

The included files could easily be re-setting your error handling, or
an included file *BEFORE* the one you are examining could do it:

<?php
  require 'include_file_that_resets_error_reporting.inc';
  require 'include_file_that_generates_error_you_are_worried_about.inc';
?>

PEAR error handling did this to me years ago, so I wasted more time
figuring out what was going on than it would have taken me to solve
the original problem I wanted PEAR for, and that's one of the reasons
I never use PEAR much. [shrug]

Back then, the PEAR error handler was tightly-woven into the whole
thing.  Or maybe I'm thinking of phpLib on that one...

-- 
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?

--- End Message ---
--- Begin Message ---
PHP 5.1 is broken in debian testing right now. Dunno 'bout Sid

On Tuesday 31 October 2006 18:00, Richard Lynch wrote:
> On Tue, October 31, 2006 6:24 am, Sancar Saran wrote:
> > If page has some errors it stop producing any error messages. Neither
> > page nor
> > syslog.
> >
> > I get blank page.
>
> If it's a fatal error, or one too serious to be trapped by an error
> handler, then your script will just stop.
>
> > System
> > Debian Unstable
> > Apache 2
> > Php 5.1.6
> >
> > Apc
> > Memcached
> > Obhandler with gzip
> > and I store entire page output then printed out.
>
> You may have installed something which does something like:
> while (ob_get_level()) ob_end_flush();
>
> > And I found if my error on first pages there was no problem, error
> > message
> > show in page and syslog and if that eroor is in included files. I get
> > absolutely Nothing.
>
> The included files could easily be re-setting your error handling, or
> an included file *BEFORE* the one you are examining could do it:
>
> <?php
>   require 'include_file_that_resets_error_reporting.inc';
>   require 'include_file_that_generates_error_you_are_worried_about.inc';
> ?>
>
> PEAR error handling did this to me years ago, so I wasted more time
> figuring out what was going on than it would have taken me to solve
> the original problem I wanted PEAR for, and that's one of the reasons
> I never use PEAR much. [shrug]
>
> Back then, the PEAR error handler was tightly-woven into the whole
> thing.  Or maybe I'm thinking of phpLib on that one...
>
> --
> 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?

-- 
---
Børge
Kennel Arivene 
http://www.arivene.net
---

--- End Message ---
--- Begin Message ---
Tedd, may I ask you what GD library version and php version are you using?

I am using:
php5-5.1.2
gd-2.0.32-23


All Suse 10.1 machines using that versions and on all that machines
I have the same problem ...

lg

--- End Message ---
--- Begin Message ---
Kevin wrote:
> Jochem Maas wrote:
>> Kevin wrote:
>>  
>>> Hi,
>>>
>>> I have created a website which is using the iis rewrite module to write
>>> the following:
>>>
>>> index.php?tn_id=5&ln_id=4 to something like
>>>
>>> /contact/directions.html and this works fine
>>>
>>> however I have a link at the bottom which needs to pass another variable
>>> through the query string before it would simply be:
>>>
>>> index.php?tn_id=5&ln_id=4&ts=75
>>>
>>> however if i run
>>>
>>> /contact/directions.html?ts=75 it doesn't work and comes up with a 404
>>> page not found error.
>>>
>>> Is there anyway around this?
>>>     
>>
>> yes Apache, are you allowed/able to use apache?
>>
>>  
>>> Thanks
>>>
>>> Kevin
>>>
>>>     
> no only allowed to use windows server

ah and I see your company lives off ill-managed/spent NHS-pork - i.e. the latest
bullshit multi-billion pound NHS IT overhaul with a zero net gain in efficiency 
or insight
for end users (you know, nurses, doctors, people actually practice medicine) but
plenty of new managerial posts to supervise all the fantastic (read: over 
budget and
behind schedule) new IT projects.

governments should run their core IT infrastructures on proprietary, buggy (and 
overly
expensive) software (especially not when said enterprise has been found guilt of
anti-trust violations in multiple regions)

given that I know kust enough about IIS to stay away from it I can only
recommend that you get yourself a better* job

* better as in less morally abhorent, rather better as in more money - although 
if
you can achieve both all the better for you :-)

> 

--- End Message ---
--- Begin Message ---
Jochem Maas wrote:
Kevin wrote:
Jochem Maas wrote:
yes Apache, are you allowed/able to use apache?
no only allowed to use windows server

ah and I see your company lives off ill-managed/spent NHS-pork - i.e. the latest
bullshit multi-billion pound NHS IT overhaul with a zero net gain in efficiency 
or insight
for end users (you know, nurses, doctors, people actually practice medicine) but
plenty of new managerial posts to supervise all the fantastic (read: over 
budget and
behind schedule) new IT projects.

governments should run their core IT infrastructures on proprietary, buggy (and 
overly
expensive) software (especially not when said enterprise has been found guilt of
anti-trust violations in multiple regions)

given that I know kust enough about IIS to stay away from it I can only
recommend that you get yourself a better* job

* better as in less morally abhorent, rather better as in more money - although 
if
you can achieve both all the better for you :-)

Plus, being forced to use Windows is not a reason not to use Apache!!

-Stut

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

On Oct 30, 2006, at 9:20 PM, Børge Holen wrote:

On Tuesday 31 October 2006 02:27, Ed Lazor wrote:
Someone asked what it was to be used for.
It's for combining 4 forums into one witch shows the latest
movement among
them. More like an introduction sort of...

Sounds cool.  Are you using a pre-made forum package?

No
Maby it'd been easier, I did that at first... But not much to learn using
other ppls tools.

True, a good challenge is always fun :)

-Ed

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

On Oct 30, 2006, at 11:34 PM, Google Kreme wrote:
So, do I whack up something where I just load the file into a HTML Textarea and then write it back (simple enough, though possibly rather dangerous), or is there something straightforward I should go ahead and use that might find use elsewhere on the server?

Playing Devils Advocate here, but why not store the text in a database?

The text file should be somewhat secure if you're manually reading and writing to it in PHP, making sure that you're the one controlling the file name, the file extension (file type), the file permissions, and the file size.

-Ed

--- End Message ---
--- Begin Message ---
On Tue, October 31, 2006 1:34 am, Google Kreme wrote:
> So, do I whack up something where I just load the file into a HTML
> Textarea and then write it back (simple enough, though possibly
> rather dangerous), or is there something straightforward I should go
> ahead and use that might find use elsewhere on the server?

The unanswered question is:

How many people might try to edit it at once, and what will you do to
resolve race conditions?

Whipping up a TEXTAREA for a single admin person who is in charge of
this file, and the only one to edit it under normal circumstances,
would work fine.

Doing that for a team of 100 people who have access to this file will
end up with somebody very cranky when their 1000-entry addition got
over-written by another user fixing a small typo.

Other solutions to consider:
1. Put the "file" in a database as individual (AAA) XXX-NNNN records,
and the "file" can be generated from the DB every time it changes with
a trigger, or every day or something reasonable.  Having individual
records for each line reduces the damage of the race condition to a
single entry needing to be re-done.  You can also more easily find
code to handle the race condition for the DB in a web environment.

2. Put the file into subversion or CVS, if all editors are developers.

3. Forget the web interface, because the file won't really change that
often anyway, and just use 'vi' to make the rare change. :-)

There likely *IS* a web tool "out there" just like you want...

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.

-- 
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?

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

On Oct 31, 2006, at 2:48 AM, Ahmad Al-Twaijiry wrote:

yes, I think you can call it ,semi-real-time monitoring

because we want the script when it run it should read some records in
database and update other records

That's kind of vague. I'm not able to give better advice without more information, but it does sound like you'll eventually run into some bottlenecks as system usage increases ( and fairly quickly if you're collecting data every 30 seconds).

-Ed

--- End Message ---
--- Begin Message ---
Just getting, but is there a 0, 1, 2, and 3 channel?


On Oct 31, 2006, at 3:10 AM, dhatri gmail wrote:

Hello,

using function getimagesize();

I am trying to get channels attribute value of image, it returns 3 for cmyk image actually it should return 4, can you tell me why it happens so?

regds.
dmt

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


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


Do these qualify?

http://www.roadsend.com/home/index.php?SMC=1&pageID=compiler
http://www.priadoblender.com


It would be helpful if people would read the link the OP provided, as
opposed to just the URL to that link.

The page isn't about compiling PHP source into a binary.

It's about creating a method of using web applications ( php ) without the
help of a seperate web-server.

--- End Message ---
--- Begin Message ---
[snip]
The page isn't about compiling PHP source into a binary.

It's about creating a method of using web applications ( php ) without
the
help of a seperate web-server.
[/snip]

That is an oxymoron, a web app w/o a web-server? The items mentioned
have built-in webservers which is as close to not having a separate web
server as you can get for a web app.

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

On Oct 31, 2006, at 8:25 AM, Rory Browne wrote:
It would be helpful if people would read the link the OP provided, as opposed to just the URL to that link.

The page isn't about compiling PHP source into a binary.

It's about creating a method of using web applications ( php ) without the help of a seperate web-server.

I could be wrong, because I haven't used them, but I do think that some of the links I sent do what you're looking for. For example, one of the links had information about storing the executables on CD for distributing presentations. Good news tho, if those don't work for you, odds are good that you're not going to find what you're looking for... mainly because PHP is designed to be an interpretive web language and there are other tools more suited for what you're trying to accomplish.

-Ed

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

RE:  Sorting Multidimensional Array

I'm trying to sort a multidimensional array.  The data was taken from
a mysql query:

$myrow = mysql_fetch_row($result) {
 query[] = $myrow;
}

The purpose is to retrieve the table data and manually add a record,
then sort ASC by the startdate which is the forth field...

Something like:
$test = array_multisort($query, $key = '$query[4]');

Any help would be greatly appreciated.  Thanks,


Keith

--- End Message ---
--- Begin Message ---
On Tue, October 31, 2006 11:10 am, Keith Spiller wrote:
> RE:  Sorting Multidimensional Array
>
> I'm trying to sort a multidimensional array.  The data was taken from
> a mysql query:
>
> $myrow = mysql_fetch_row($result) {
>   query[] = $myrow;
> }
>
> The purpose is to retrieve the table data and manually add a record,
> then sort ASC by the startdate which is the forth field...
>
> Something like:
>
> $test = array_multisort($query, $key = '$query[4]');
>
> Any help would be greatly appreciated.  Thanks,

Don't do that. :-)

For starters, sorting in PHP is MUCH less efficient than in a DB.

Secondly, getting multi-dimensional (sic) arrays in PHP to sort like
you want generates a ton of traffic here, so it must be hard. :-)

You can do somethig like this:

(SELECT x, y, z FROM real_data
 UNION
 SELECT 'manually', 'inserted', 'data' as z
)
ORDER BY z

And achieve MUCH better results with far less headache.

If 'z' is indexed in real_data, add another ORDER BY z right before
the UNION -- That will probably make it very fast/easy for the DB to
splice in your manually-inserted 'z' value.

-- 
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?

--- End Message ---
--- Begin Message ---
Thanks Richard,

But wouldn't "order by z" interfere with my original order by values?

My code is as follows:

  $fields1  = " ID, Title, Label, Location, Start, End, Time, ";
  $fields1 .= " Description, Organization, Department, Contact, ";
  $fields1 .= " Phone, Email, Global, Board, Committee, Status, TBD_Time ";

$command = " SELECT $fields1, TO_DAYS(End) - TO_DAYS(Start) + 1 AS Days ";
  $command .= " FROM $tablename ";
  $command .= " $WHERETXT ORDER BY $sortby $sortorder ";


I just need to add a new record, but I have to use PHP because the Start and End
dates for that record must match the current month...

If I could add the record to the Select statement as you suggest that would be wonderful.


Keith


----- Original Message ----- From: "Richard Lynch" <[EMAIL PROTECTED]>
To: "Keith Spiller" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Tuesday, October 31, 2006 10:48 AM
Subject: Re: [PHP] Sorting Multidimensional Array


On Tue, October 31, 2006 11:10 am, Keith Spiller wrote:
RE:  Sorting Multidimensional Array

I'm trying to sort a multidimensional array.  The data was taken from
a mysql query:

$myrow = mysql_fetch_row($result) {
  query[] = $myrow;
}

The purpose is to retrieve the table data and manually add a record,
then sort ASC by the startdate which is the forth field...

Something like:

$test = array_multisort($query, $key = '$query[4]');

Any help would be greatly appreciated.  Thanks,

Don't do that. :-)

For starters, sorting in PHP is MUCH less efficient than in a DB.

Secondly, getting multi-dimensional (sic) arrays in PHP to sort like
you want generates a ton of traffic here, so it must be hard. :-)

You can do somethig like this:

(SELECT x, y, z FROM real_data
UNION
SELECT 'manually', 'inserted', 'data' as z
)
ORDER BY z

And achieve MUCH better results with far less headache.

If 'z' is indexed in real_data, add another ORDER BY z right before
the UNION -- That will probably make it very fast/easy for the DB to
splice in your manually-inserted 'z' value.

--
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?

--- End Message ---
--- Begin Message ---
On Tue, October 31, 2006 4:58 am, Robin Vickery wrote:
> On 30/10/06, Robert Cummings <[EMAIL PROTECTED]> wrote:
>> On Mon, 2006-10-30 at 12:28 +0100, Robin Vickery wrote:
>> > On 30/10/06, Ivo F.A.C. Fokkema <[EMAIL PROTECTED]> wrote:
>> > > On Sun, 29 Oct 2006 23:40:47 -0600, Richard Lynch wrote:
>> > >
>> > > > On Fri, October 27, 2006 4:53 pm, Børge Holen wrote:
>> > > >> On Friday 27 October 2006 19:34, Richard Lynch wrote:
>> > > >>> And the header("Location: ...") requires a full URL.
>> > > >>
>> > > >> No it doesn't. but he's missing an ' at first glance
>> > > >
>> > > > Yes, it does:
>> > > > http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30
>> > > >
>> > > > Note the use of 'absolute' within that section.
>> > >
>> > > Although I always use a full URL as well, doesn't absolute just
>> mean
>> > > non-relative? As in:
>> > > Location: /Protocols/rfc2616/rfc2616-sec14.html#sec14.30
>> > > (absolute URI)
>> > >
>> > > Location: ./rfc2616-sec14.html#sec14.30
>> > > (relative URI)
>> >
>> > If you need contextual information to make sense of the URI (such
>> as
>> > the server name from a previous request) then it's not absolute.
>> >
>> > RFC 2396: Uniform Resource Identifiers
>> >
>> > "An absolute identifier refers to a resource independent of the
>> > context in which the identifier is used. In contrast, a relative
>> > identifier refers to a resource by describing the difference
>> within a
>> > hierarchical namespace between the current context and an absolute
>> > identifier of the resource."
>>
>> Please note you are quoting from an RFC with the following title:
>>
>>     Uniform Resource Identifiers (URI): Generic Syntax
>>
>> Pay special attention to "Generic Syntax" in the title.
>>
>> The RFC linked by Richard clearly indicates that for the Location
>> response-header that "the field value consists of a single absolute
>> URI". This currently has the final word for the Location
>> response-header
>> and therefore is the standard.

Please note that the link I posted is part of this document:
http://www.w3.org/Protocols/rfc2616/rfc2616.html

Also note that THIS section of that document:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.2.1
clearly states:
        For definitive information on URL syntax and semantics, see
        "Uniform Resource Identifiers (URI):
         Generic Syntax and Semantics,"
and provides a link to:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec17.html#bib42
which in turn links to:
http://www.ietf.org/rfc/rfc2396.txt
which is, in fact, the document cited.

Are we all on the same page now?

Is there any doubt in anybody's mind that the standards clearly
require an absoluteURI, complete with scheme (e.g., http://)?

:-) :-) :-)

I just wanted to make it clear to any newbie reader whose wishful
thinking was leading them astray that they should NOT rely on a
non-absolute URI if they want to be standards-compliant.

It is rare that one cannot take an extra few seconds and compose the
standards-compliant URI.

-- 
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?

--- End Message ---
--- Begin Message ---
On Tue, 2006-10-31 at 11:58 +0100, Robin Vickery wrote:
> On 30/10/06, Robert Cummings <[EMAIL PROTECTED]> wrote:
> > On Mon, 2006-10-30 at 12:28 +0100, Robin Vickery wrote:
> > > On 30/10/06, Ivo F.A.C. Fokkema <[EMAIL PROTECTED]> wrote:
> > > > On Sun, 29 Oct 2006 23:40:47 -0600, Richard Lynch wrote:
> > > >
> > > > > On Fri, October 27, 2006 4:53 pm, Børge Holen wrote:
> > > > >> On Friday 27 October 2006 19:34, Richard Lynch wrote:
> > > > >>> And the header("Location: ...") requires a full URL.
> > > > >>
> > > > >> No it doesn't. but he's missing an ' at first glance
> > > > >
> > > > > Yes, it does:
> > > > > http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30
> > > > >
> > > > > Note the use of 'absolute' within that section.
> > > >
> > > > Although I always use a full URL as well, doesn't absolute just mean
> > > > non-relative? As in:
> > > > Location: /Protocols/rfc2616/rfc2616-sec14.html#sec14.30
> > > > (absolute URI)
> > > >
> > > > Location: ./rfc2616-sec14.html#sec14.30
> > > > (relative URI)
> > >
> > > If you need contextual information to make sense of the URI (such as
> > > the server name from a previous request) then it's not absolute.
> > >
> > > RFC 2396: Uniform Resource Identifiers
> > >
> > > "An absolute identifier refers to a resource independent of the
> > > context in which the identifier is used. In contrast, a relative
> > > identifier refers to a resource by describing the difference within a
> > > hierarchical namespace between the current context and an absolute
> > > identifier of the resource."
> >
> > Please note you are quoting from an RFC with the following title:
> >
> >     Uniform Resource Identifiers (URI): Generic Syntax
> >
> > Pay special attention to "Generic Syntax" in the title.
> >
> > The RFC linked by Richard clearly indicates that for the Location
> > response-header that "the field value consists of a single absolute
> > URI". This currently has the final word for the Location response-header
> > and therefore is the standard.
> 
> What?
> 
> Pay special attention to what I wrote.

Seems a bit ambiguous :)

> I wasn't disagreeing with Richard, or the RFC he quoted. The OP
> expressed some confusion about what comprised an 'absolute URI' so I
> quoted the section of the RFC that defined an 'absolute URI'.
> 
> There's no question that a Location header should contain an absolute
> URI as its value.

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.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
On Tue, October 31, 2006 4:09 am, [EMAIL PROTECTED] wrote:
> I want to tell the server to do 2 things when I click on the
> "jobType" link.
>
> This is the code that I have now which displays the "art" when I
> click on "jobType"
>
> foreach($row as $jobType)
>                       {
>                       $row = mysql_fetch_array($result2,MYSQL_ASSOC);
>                       echo "<a href=client.php?art=".$row['pix']." 
> border='0'>{$row
> ['jobType']}</a>\n";

echo "<a href=\"$row[url]\">$row[url]</a>\n";

> I now want to, with the same click, also show the url if I have a url
> for that "jobType" in my database column called "url".

I'm assuming you don't mean that you want the user to see the image
and then be auto-forwarded to the 'url' from the db...

That's a fish of a different color.

-- 
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?

--- End Message ---
--- Begin Message ---
On Tue, October 31, 2006 4:50 am, Ahmad Al-Twaijiry wrote:
> we use PDO functions to connect to the database and we also made the
> tables innodb type
>
> so if we use   $dbh->beginTransaction();
>
> is it will be safe to run the script more than one in the same time ?

It should be "safe" from the standpoint of the transaction model.

But it may or may not be "safe" from the standpoint of your DB server
getting swamped and bogged down with transactions driving it to its
death in 60 seconds...

Transactions do not alter the Laws of Physics.

Your DB can only handle so many operations per second, and doing more
than that will kill it.

Actually, Transactions add SIGNIFICANT overhead, and if raw speed is
the primary goal, finding a way to avoid full-blown transactions, and
only doing the minimum necessary for your specific "transaction-like"
needs is the way to go, most likely.

-- 
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?

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

On Oct 31, 2006, at 2:29 AM, Ahmad Al-Twaijiry wrote:

We have a virtual stock exchange site (for learning purpose) we put
all the bids and offers in  a table and every minute we run the php
script to make the exchange

but my customer want to make it less than 1 minute

I can tell there's something I'm missing here. I suspect it has to do with the operation of how the bid/offer exchange process actually works. I'm assuming that the bid is the asking price for the stock, one bid will receive multiple offers, and your script "sells" the stock to the highest bidder within a given time frame. Is that right?

-Ed

--- End Message ---
--- Begin Message ---
On Mon, October 30, 2006 7:19 pm, Daevid Vincent wrote:
> Thank you for the reply Richard (and Tom).
>
> That news sucks however. Seems that the PHP pre-parser should handle
> this
> better. It's not like it's a one-pass parser (like Ruby).
>
> <?php
> ini_set('output_handler', 'mb_output_handler');
> echo "\noutput_handler => " . ini_get('output_handler') . "\n";
> ?>
>
> I suppose I could re-compile my command line version with a different
> php.ini file, but that's kind of lame that I have to have two php.ini
> files
> for what ini_set() SHOULD handle.

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.

> What other undocumented "gotchas" are there with ini_set() I wonder...

Most of these ARE documented in that PER INI DIR page on php.net

This one probably is as well.

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.

-- 
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?

--- End Message ---
--- Begin Message ---
> 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.

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

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

on 10/31/2006 01:36 PM Andy said the following:
> 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.

I think the PHP IMAP extension can do all you need, if you have it
installed. Otherwise, you can just use pure PHP IMAP client class and
the use this MIME message parser to extract the message body parts into
a string or a separate file:

http://www.phpclasses.org/mimeparser

This gets the messages without using the PHP IMAP extension:

http://www.phpclasses.org/imap


-- 

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

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

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

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?
Thanks,


Keith
--- End Message ---
--- Begin Message ---
Have a look at my (and others previous mails)
with the Topic : "Decide witch table within a union"

There you'll find my orginal post with a working union, easy to figure out how 
it works.


> Hi,
>
> 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?
> Thanks,
>
>
> Keith

-- 
---
Børge
Kennel Arivene 
http://www.arivene.net
---

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

I thought of sharing my experience of writing a controller to remotely 
control a robot through a webserver using PHP. Though I could not use PHP 
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                  

I used PHP to communicate between the Java program which I run in the 
background and the AJAX calls from the browser. This setup works fine for my 
purposes and satisifies the strict time constraints.

If someone has a better idea of implementing this thing in PHP, please do let 
me know your comments. 

There is a lot more to do in this project and I hope to make use of PHP a lot 
along the way. This is a NSF funded project and this work will be published 
in some leading journals. What I am excited about is the prospect of putting 
in a word about PHP in these journals, since as far as I know, it is not too 
well known in the academic circles.

Regards,

Prathap

--- End Message ---
--- Begin Message ---
Cool!

On 10/31/06, Prathaban Mookiah <[EMAIL PROTECTED]> wrote:
Hello List,

I thought of sharing my experience of writing a controller to remotely
control a robot through a webserver using PHP. Though I could not use PHP
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

I used PHP to communicate between the Java program which I run in the
background and the AJAX calls from the browser. This setup works fine for my
purposes and satisifies the strict time constraints.

If someone has a better idea of implementing this thing in PHP, please do let
me know your comments.

There is a lot more to do in this project and I hope to make use of PHP a lot
along the way. This is a NSF funded project and this work will be published
in some leading journals. What I am excited about is the prospect of putting
in a word about PHP in these journals, since as far as I know, it is not too
well known in the academic circles.

Regards,

Prathap

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



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

on 10/31/2006 10:54 PM Prathaban Mookiah said the following:
> I thought of sharing my experience of writing a controller to remotely 
> control a robot through a webserver using PHP. Though I could not use PHP 
> 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.

I am not sure why you have such an high delay to connect to the robot.
Anyway, you may want to take advantage of the fact that PHP supports
persistent socket connections using the pfsockopen function. This
certainly avoids the overhead of establishing a socket connection on
every request.


> So the model I used for my purpose is this:
> 
> Browser ---------> WebServer  ---------> Java  --------> Robot
>           AJAX                  PHP                  
> 
> I used PHP to communicate between the Java program which I run in the 
> background and the AJAX calls from the browser. This setup works fine for my 
> purposes and satisifies the strict time constraints.
> 
> If someone has a better idea of implementing this thing in PHP, please do let 
> me know your comments. 

For using AJAX, you may want to take a look at this forms class. It
comes with a plug-in that lets you submit forms without reloading the
current page.

It uses an AJAX approach named COMET. This may be important for your
project because in COMET applications the browser establishes a single
connection to the Web server and uses it to return multiple responses
from the server without reconnecting.

COMET is great in particular for monitoring server site activity that
may take a long time to finish. While the activity is not finished, the
server can send new messages to update the browser.

http://www.phpclasses.org/formsgeneration

There is a lot more to say about COMET based responsive PHP AJAX
applications. You may want to read about it here:

http://www.phpclasses.org/blog/post/58-Responsive-AJAX-applications-with-COMET.html


-- 

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

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

--- End Message ---
--- Begin Message ---
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.

--- End Message ---
--- Begin Message ---
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.

PHP only works server side. Once the page is generated, php's job is done.

To change anything once it's already there, you need javascript (probably an AJAX type solution so you post a question, get the answer back and decide what to do in javascript).

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

--- End Message ---
--- Begin Message ---
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();

The header checker is returning this:

#1 Server Response: oldurl
HTTP Status Code: HTTP/1.0 302 Found
Connection: close
X-Powered-By: PHP/5.1.4
Location: newurl

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.

BTW, my server is lighttpd.

-- 
Ian Evans
Chairman & Executive Producer
DigitalHit.com

--- End Message ---

Reply via email to