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 30 Sep 2003 11:37:34 -0000 Issue 2327

php-general-digest-helplists.php.net
Date: Tue Sep 30 2003 - 06:37:34 CDT


php-general Digest 30 Sep 2003 11:37:34 -0000 Issue 2327

Topics (messages 164321 through 164380):

Re: Cleaning up my messy code
        164321 by: Chris L
        164328 by: Robert Cummings
        164332 by: andu
        164337 by: olinux
        164342 by: Cristian Lavaque

Re: captcha WAS Please visit my php program
        164322 by: Ryan A
        164347 by: Veniamin Goldin
        164358 by: David T-G

date() is hours behind
        164323 by: PHP Webmaster
        164324 by: Vail, Warren
        164325 by: Jon Kriek
        164326 by: Jon Kriek
        164352 by: PHP Webmaster

Re: Central authentication for multiple sites
        164327 by: Mike Migurski

WebDAV help
        164329 by: Oscar F
        164365 by: Marek Kilimajer

Templating system (was Re: [PHP] Cleaning up my messy code)
        164330 by: Brad Pauly

newbie about passing value
        164331 by: Ben Johnson
        164367 by: Marek Kilimajer

Change cell colour with selection from a drop down menu
        164333 by: irinchiang.justeducation.com
        164335 by: Cristian Lavaque
        164338 by: Cristian Lavaque
        164374 by: Marek Kilimajer

Re: Does the AOL browser break any standards?
        164334 by: Joe Pemberton

Re: How many Mondays in a month?
        164336 by: Cristian Lavaque
        164350 by: Greg Wiley

Re: How can I auto upload a file to the server?
        164339 by: Raditha Dissanayake
        164340 by: Raditha Dissanayake

Re: PHP coders spare time [OT}
        164341 by: Curt Zirzow

Re: Initial Value for Input Box
        164343 by: Cristian Lavaque
        164344 by: Martin Towell

PNGs & PHP feedback
        164345 by: Joe Harman
        164346 by: Eugene Lee

function mail()
        164348 by: hiaer.azrael.sk

Form Actions
        164349 by: Shaun
        164351 by: Greg Wiley

Re: $_SESSION stuffs that come with php.ini
        164353 by: esctoday.com | Wouter van Vliet

Output data repeatedly more than once
        164354 by: irinchiang.justeducation.com
        164371 by: Marek Kilimajer
        164375 by: Jay Blanchard
        164377 by: Jason Wong

Re: Checking mail with `mail`
        164355 by: esctoday.com | Wouter van Vliet

Page cannot be displayed
        164356 by: Olivier Simah
        164357 by: Martin Clarke
        164359 by: Olivier Simah
        164376 by: Jay Blanchard
        164380 by: Burhan Khalid

PHP Imagemagick
        164360 by: Cameron Metzke
        164361 by: David T-G

Sending parameters
        164362 by: Shaun
        164368 by: Jason Wong

Re: regexp: 'a correctly parenthesized substring advanced'
        164363 by: Jaaboo

Re: download queue
        164364 by: Marek Kilimajer
        164369 by: Marek Kilimajer

fsockopen()
        164366 by: Phil Ewington - 43 Plc
        164370 by: Cameron Metzke
        164372 by: Jason Wong

file_exists on different server...
        164373 by: Tristan.Pretty.risk.sungard.com
        164378 by: Jason Wong
        164379 by: Tristan.Pretty.risk.sungard.com

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:


robertinterjinn.com (Robert Cummings) wrote in
news:1064878415.9370.6.camelblobule.suds:

 
> *heh* I like being able to look at project 2 and say to myself, hmm
> needs an authentication just like project 1, but with a different
> look. Or wants a news feed, like project 1, buyt the data source is
> different, I'll just re-use the renderer and logic and recode the data
> retriever. I guess it depends on preference. I find I can do fully
> customized management projects from scratch with serious backend and
> front end functionality in very short time (weeks). And when I can
> re-use a component or module, I just shave off more time. The nice
> thing about re-using components and modules too, is that I know it
> works, the testing has been done, let alone the coding.
>
> Cheers,
> Rob.

I like that idea too-- I just don't like having to learn what amounts to a
third language to do it. Does one have to have a templating engine in order
to achieve this?

I find reusability to be, largely, a theoretical mantra, templates or not.
In general, between applications, so much changes that even the same basic
idea means that the most reusable part are SQL queries and such, and I
already keep THOSE separate.

And I've been looking for good examples of code on the web-- examples that
exemplify forethought and reusability. I must be looking in the wrong
places :)

c

attached mail follows:


On Mon, 2003-09-29 at 20:27, Chris L wrote:
> robertinterjinn.com (Robert Cummings) wrote in
> news:1064878415.9370.6.camelblobule.suds:
>
>
> > *heh* I like being able to look at project 2 and say to myself, hmm
> > needs an authentication just like project 1, but with a different
> > look. Or wants a news feed, like project 1, buyt the data source is
> > different, I'll just re-use the renderer and logic and recode the data
> > retriever. I guess it depends on preference. I find I can do fully
> > customized management projects from scratch with serious backend and
> > front end functionality in very short time (weeks). And when I can
> > re-use a component or module, I just shave off more time. The nice
> > thing about re-using components and modules too, is that I know it
> > works, the testing has been done, let alone the coding.
> >
> > Cheers,
> > Rob.
>
> I like that idea too-- I just don't like having to learn what amounts to a
> third language to do it. Does one have to have a templating engine in order
> to achieve this?
>
> I find reusability to be, largely, a theoretical mantra, templates or not.
> In general, between applications, so much changes that even the same basic
> idea means that the most reusable part are SQL queries and such, and I
> already keep THOSE separate.
>
> And I've been looking for good examples of code on the web-- examples that
> exemplify forethought and reusability. I must be looking in the wrong
> places :)

Well an example I'm experiencing right now with my template system which
is making my life so much easier and saving me oodles of time -- is
creating a PDF version of my site. To do this doing a few things:

1. creating a new site configuration (actually a copy of the
   InterJinn site configuration with a few changes)

2. Creating a new set of template patterns for this configuration
   (2 to be exact)

3. Creating one new layout template for the PDF version.

4. Creating one master source file which provides a chapter
   mechanism for the InterJinn site's sections.

5. extending the original jinnDoc tag compiler to provide support
   for a <jinnDoc:chapter/> and <jinnDoc:subChapter/> tag and to
   reduce the <h?/> tag ranks for the current <jinnDoc:title/>,
   <jinnDoc:subTitle/>, etc. tags.

6. Compiling the new site patterns.

7. running htmldoc on the output.

So in 7 fairly easy steps (once you know the framework) I've converted
my InterJinn site into an easily downloadable PDF for offline reading.
Total time invested: 3 hours. later I'll add support for
<jinnDoc:pdfOnly/> and <jinnDoc:webOnly/> tags to properly separate out
content that makes no sense in the website or vice versa.

The nice thing about this was I hadn't even planned on doing a PDF till
someone requested it via a comment on the website. I'll probably release
interJinn-0.9.2 next weekend, so you can see the code then if you want
since I include the InterJinn site as it's own example :) As is you can
see the non PDF stuff if you download the current version.

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:


On 29 Sep 2003 21:08:40 -0400
Robert Cummings <robertinterjinn.com> wrote:

> > I like that idea too-- I just don't like having to learn what amounts to a
> > third language to do it. Does one have to have a templating engine in order
> > to achieve this?
> >
> > I find reusability to be, largely, a theoretical mantra, templates or not.
> > In general, between applications, so much changes that even the same basic
> > idea means that the most reusable part are SQL queries and such, and I
> > already keep THOSE separate.
> >
> > And I've been looking for good examples of code on the web-- examples that
> > exemplify forethought and reusability. I must be looking in the wrong
> > places :)
>
> Well an example I'm experiencing right now with my template system which
> is making my life so much easier and saving me oodles of time -- is
> creating a PDF version of my site. To do this doing a few things:
>
> 1. creating a new site configuration (actually a copy of the
> InterJinn site configuration with a few changes)
>
> 2. Creating a new set of template patterns for this configuration
> (2 to be exact)
>
> 3. Creating one new layout template for the PDF version.
>
> 4. Creating one master source file which provides a chapter
> mechanism for the InterJinn site's sections.
>
> 5. extending the original jinnDoc tag compiler to provide support
> for a <jinnDoc:chapter/> and <jinnDoc:subChapter/> tag and to
> reduce the <h?/> tag ranks for the current <jinnDoc:title/>,
> <jinnDoc:subTitle/>, etc. tags.
>
> 6. Compiling the new site patterns.
>
> 7. running htmldoc on the output.
>
> So in 7 fairly easy steps (once you know the framework)

That's the key, what better way then rolling your own. I think frameworks develop
on their own with experience. That's not to say that looking at other people's
solutions isn't part of the experience.

>I've converted
> my InterJinn site into an easily downloadable PDF for offline reading.
> Total time invested: 3 hours. later I'll add support for
> <jinnDoc:pdfOnly/> and <jinnDoc:webOnly/> tags to properly separate out
> content that makes no sense in the website or vice versa.
>
> The nice thing about this was I hadn't even planned on doing a PDF till
> someone requested it via a comment on the website. I'll probably release
> interJinn-0.9.2 next weekend, so you can see the code then if you want
> since I include the InterJinn site as it's own example :) As is you can
> see the non PDF stuff if you download the current version.
>
> 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. |
> `------------------------------------------------------------'
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

____
Regards, Andu Novac

attached mail follows:


Try out smarty (its quite simple). You will get some
ideas on how to structure. I learned that its *ok* to
have some *display logic* in your templates (i.e.
repeating rows). (yes, some will adamantly disagree)

Another thing i learned when using smarty is I like
using arrays to keep things organized.
 
i.e.
$article['id'], $article['title'],
$article['publish_date'], $article['author'],
$article['content']
rather than
$id, $title, $publish_date, $author, $content

olinux

--- Chris <chrisl_akhotmail.com> wrote:
> I am working on a fairly large scale (for myself
> anyway) project using PHP
> and MySQL. I am victim of teaching myself to
> program, not separating
> presentation from my code-- all the things that lead
> to masses of spaghetti
> code so atrocious even I can't figure out what I was
> doing an hour ago.
>
> I'm not looking for an IDE or code generator so much
> as some practical
> advice for organization and framework when
> developing a larger app. I know
> of PHP Fusebox, having programmed with Cold Fusion
> fusebox for a while, but
> it seems like that might be too much. Maybe I just
> need a sensical,
> practical approach to application layout. What do
> you all do? How can I
> learn to be a better PHP programmer in this regard?
>
> c

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

attached mail follows:


olinux wrote:
> Try out smarty (its quite simple). You will get some
> ideas on how to structure. I learned that its *ok* to
> have some *display logic* in your templates (i.e.
> repeating rows). (yes, some will adamantly disagree)
>
> Another thing i learned when using smarty is I like
> using arrays to keep things organized.
>
> i.e.
> $article['id'], $article['title'],
> $article['publish_date'], $article['author'],
> $article['content']
> rather than
> $id, $title, $publish_date, $author, $content
>
> olinux

I agree here. I'm new to this templating system thing, so I'm
studying on it and have found the smarty concept better. I also
found this article that I liked and gives a simple solution to
implement in few steps to get started:

http://www.sitepoint.com/article/1218

Cristian

attached mail follows:


Hey,

/*
Exactly what is the purpose of this? Let me clarify. I know that it's
supposed to prevent computers from submitting forms automatically
because they cannot read the graphic, but what I don't understand is in
what cases this is useful?
*/
Its more of a hassle and requires the entity who is submitting the form to
be human as computers cant 100% be sure of whats in the picture, they cant
"see" it 100% of the time even with todays OCR technoligy while humans can
make it out in a fraction of a second...mostly.

/*
And specifically Ryan, where will you be using this?
*/
Am using this on a voteing form at bestwebhosters.com which will be opened
in 2-5 days.
This idea was suggested to me by a few guys on this very list...the first
names that come to mind are john & chris.

/*
I'm trying to gauge whether or not this would be worthwhile for a
project I'm working on right now.
*/
Ok, i like it coz it adds a bit of the "fancy" element to the same old
boring forms but it has much more serious uses of course.

/*
Thanks,
Chris.
*/

No problem, tell me if you have any more q's although my replies may be a
little long in the coming.

HTH.

Cheers,
-Ryan

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

attached mail follows:


Do somebody has any snipet for this stuff ?

----- Original Message -----
From: "Ryan A" <ryancoinpass.com>
To: "Chris W. Parker" <cparkerswatgear.com>
Cc: <php-generallists.php.net>
Sent: Tuesday, September 30, 2003 1:46 AM
Subject: Re: [PHP] captcha WAS Please visit my php program

> Hey,
>
> /*
> Exactly what is the purpose of this? Let me clarify. I know that it's
> supposed to prevent computers from submitting forms automatically
> because they cannot read the graphic, but what I don't understand is in
> what cases this is useful?
> */
> Its more of a hassle and requires the entity who is submitting the form to
> be human as computers cant 100% be sure of whats in the picture, they cant
> "see" it 100% of the time even with todays OCR technoligy while humans can
> make it out in a fraction of a second...mostly.
>
> /*
> And specifically Ryan, where will you be using this?
> */
> Am using this on a voteing form at bestwebhosters.com which will be opened
> in 2-5 days.
> This idea was suggested to me by a few guys on this very list...the first
> names that come to mind are john & chris.
>
> /*
> I'm trying to gauge whether or not this would be worthwhile for a
> project I'm working on right now.
> */
> Ok, i like it coz it adds a bit of the "fancy" element to the same old
> boring forms but it has much more serious uses of course.
>
> /*
> Thanks,
> Chris.
> */
>
> No problem, tell me if you have any more q's although my replies may be a
> little long in the coming.
>
> HTH.
>
> Cheers,
> -Ryan
>
> --
> 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:


Hi, all --

...and then Ryan A said...
%
% Hey,

Hiya!

%
% /*
% Exactly what is the purpose of this? Let me clarify. I know that it's
...
% */
% Its more of a hassle and requires the entity who is submitting the form to

A hassle is right. What about your visitors who use a text-only browser
(or surf with images turned off) or who depend on text-to-speech readers?

This sort of thing is, IMNSHO, unnecessary and the wrong approach; it
makes the web harder to use without making it a safer place. The form
should be designed correctly and safely in the first place. We don't use
this sort of approach to prevent buffer overflow attacks and it shouldn't
be used anywhere else, either.

HTH & HAND

:-D
--
David T-G * There is too much animal courage in
(play) davidtgjustpickone.org * society and not sufficient moral courage.
(work) davidtgworkjustpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE/eVVKGb7uCXufRwARArbpAKC8jer59WUf1lOMc8sxQuRxU978nQCgvANa
p34FRuAqaZm1S6MFXq5XIuU=
=iCjh
-----END PGP SIGNATURE-----

attached mail follows:


Hi all,

I currently use:

date("l jS F Y, g:i A");

To format the current date/time to my personal preference.

However, at 12:19 AM on my machine, date("l jS F Y, g:i A"); shows 4:19PM...
8 hours slow :(

Any ideas on how to correct this? Am I right in saying that there is a
timezone problem?

Any ideas appreciated.

attached mail follows:


Sounds like your server is set to GMT, that is, if you are located in PDT timezone.

Warren Vail

-----Original Message-----
From: PHP Webmaster [mailto:phpwadminphpwebmaster.co.uk]
Sent: Monday, September 29, 2003 4:23 PM
To: php-generallists.php.net
Subject: [PHP] date() is hours behind

Hi all,

I currently use:

date("l jS F Y, g:i A");

To format the current date/time to my personal preference.

However, at 12:19 AM on my machine, date("l jS F Y, g:i A"); shows 4:19PM...
8 hours slow :(

Any ideas on how to correct this? Am I right in saying that there is a
timezone problem?

Any ideas appreciated.

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

attached mail follows:


See the putenv() function. For example to get the correct Eastern Standard
Time

http://www.php.net/putenv

<?php
    putenv('TZ=US/Eastern');
    echo 'Last modified: ' . date('d/m/y H:i', getlastmod());
?>

--
Jon Kriek
http://phpfreaks.com

"Php Webmaster" <phpwadminphpwebmaster.co.uk> wrote in message
news:20030929232143.99386.qmailpb1.pair.com...
> Hi all,
>
> I currently use:
>
> date("l jS F Y, g:i A");
>
> To format the current date/time to my personal preference.
>
> However, at 12:19 AM on my machine, date("l jS F Y, g:i A"); shows
4:19PM...
> 8 hours slow :(
>
> Any ideas on how to correct this? Am I right in saying that there is a
> timezone problem?
>
> Any ideas appreciated.

attached mail follows:


Well I meant just

putenv('TZ=US/Eastern');

But you get the idea.

--
Jon Kriek
http://phpfreaks.com

"Jon Kriek" <kriekphpfreaks.com> wrote in message
news:20030930010110.5151.qmailpb1.pair.com...
> See the putenv() function. For example to get the correct Eastern Standard
> Time
>
> http://www.php.net/putenv
>
> <?php
> putenv('TZ=US/Eastern');
> echo 'Last modified: ' . date('d/m/y H:i', getlastmod());
> ?>
>
> --
> Jon Kriek
> http://phpfreaks.com
>
> "Php Webmaster" <phpwadminphpwebmaster.co.uk> wrote in message
> news:20030929232143.99386.qmailpb1.pair.com...
> > Hi all,
> >
> > I currently use:
> >
> > date("l jS F Y, g:i A");
> >
> > To format the current date/time to my personal preference.
> >
> > However, at 12:19 AM on my machine, date("l jS F Y, g:i A"); shows
> 4:19PM...
> > 8 hours slow :(
> >
> > Any ideas on how to correct this? Am I right in saying that there is a
> > timezone problem?
> >
> > Any ideas appreciated.

attached mail follows:


"Jon Kriek" <kriekphpfreaks.com> wrote in message
news:20030930010342.10158.qmailpb1.pair.com...
> Well I meant just
>
> putenv('TZ=US/Eastern');
>
> But you get the idea.
>
> --
> Jon Kriek
> http://phpfreaks.com
>
> "Jon Kriek" <kriekphpfreaks.com> wrote in message
> news:20030930010110.5151.qmailpb1.pair.com...
> > See the putenv() function. For example to get the correct Eastern
Standard
> > Time
> >
> > http://www.php.net/putenv
> >
> > <?php
> > putenv('TZ=US/Eastern');
> > echo 'Last modified: ' . date('d/m/y H:i', getlastmod());
> > ?>
> >
> > --
> > Jon Kriek
> > http://phpfreaks.com
> >
> > "Php Webmaster" <phpwadminphpwebmaster.co.uk> wrote in message
> > news:20030929232143.99386.qmailpb1.pair.com...
> > > Hi all,
> > >
> > > I currently use:
> > >
> > > date("l jS F Y, g:i A");
> > >
> > > To format the current date/time to my personal preference.
> > >
> > > However, at 12:19 AM on my machine, date("l jS F Y, g:i A"); shows
> > 4:19PM...
> > > 8 hours slow :(
> > >
> > > Any ideas on how to correct this? Am I right in saying that there is a
> > > timezone problem?
> > >
> > > Any ideas appreciated.

I'm in London and and my timezone is GMT, so what should I use?

attached mail follows:


>Does anyone know of a way to authenticate a person on one site and have
>that authentication carried through to multiple sites?
>
>Basically I'd like to have someone login on www.domain1.com and then have
>their login be valid on www.domain2.com and www.domain3.com ... the
>domain name is different so I don't see how I could use a common cookie.
>
>The 3 sites in question are hosted on a common server with a common user
>database if that helps but still the domain names that people access the
>sites with are unique.

Microsoft performed some crafty redirects to address this issue with
passport. I seem to recall them getting a ton of heat for it two or so
years ago. Not sure if they still do it.

I believe the procedure involved integrating the session data between
passport.com and (e.g.) expedia.com, such that a request to the latter
would return a redirect to the former, and that in turn would generate a
subsequent redirect back to the latter, this time with the Passport ID in
the URL. In this way, microsoft was able to synchronize your ID between
affiliated sites in a reasonably transparent way. It was pretty elegant,
but still struck me as creepy and manipulative. Go figure.

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

attached mail follows:


Hello all,

I'm having a problem with PHP/WebDAV. Here's my problem:

I am working on a system that keeps track of documents. The documents
are stores based on document ids, and the filename is saved on the
database along with the document id and file type/size, and the file is
renamed to just the id number.

Now I need to use webdav to let user edit files as it is normally done
with webbad, with the problem that the files have no name/extension so I
have to recreate them with php. I created a couple of php files, that
capture the GET, PROPFINDS, PUTs, etc. The idea is that the user opens
the php file specifying the file id, and the php file looks up the name,
retrieves the content of the file and sends it to the client (this is
currently being done without problem, when the php script sees a GET, it
looks for the file and send it). I need the php script to be able to
capture PUT as well and when it gets one, it takes the data and saves it
to the file that has the id. The problem is, I open the .php file and I
get the data of the file, but when I save, my php code is replaced with
the actual text of the file as if the file they're editing is the php file.

Any help or advise you could provide me about this would be really
appreciated. Thanks.

O.-

attached mail follows:


http://sk.php.net/manual/en/features.file-upload.put-method.php

Oscar F wrote:

> Hello all,
>
> I'm having a problem with PHP/WebDAV. Here's my problem:
>
> I am working on a system that keeps track of documents. The documents
> are stores based on document ids, and the filename is saved on the
> database along with the document id and file type/size, and the file is
> renamed to just the id number.
>
> Now I need to use webdav to let user edit files as it is normally done
> with webbad, with the problem that the files have no name/extension so I
> have to recreate them with php. I created a couple of php files, that
> capture the GET, PROPFINDS, PUTs, etc. The idea is that the user opens
> the php file specifying the file id, and the php file looks up the name,
> retrieves the content of the file and sends it to the client (this is
> currently being done without problem, when the php script sees a GET, it
> looks for the file and send it). I need the php script to be able to
> capture PUT as well and when it gets one, it takes the data and saves it
> to the file that has the id. The problem is, I open the .php file and I
> get the data of the file, but when I save, my php code is replaced with
> the actual text of the file as if the file they're editing is the php file.
>
> Any help or advise you could provide me about this would be really
> appreciated. Thanks.
>
> O.-
>

attached mail follows:


On Mon, 2003-09-29 at 17:07, Curt Zirzow wrote:

> I wonder if now is a place to introduce my new templating system.

Definitely! I'd be interested in seeing it.

> I have the same difficulties in letting just joe blow executing php
> code within templates, sometimes smarty is just to smart for
> certain applications.

I haven't used smarty for anything significant. I like it, but it does
more than I need.

- Brad

attached mail follows:


Hi,

   Why is the product_details.php is not getting the id value
properly.
In the URL it is showing id=1 with along with the correction
location and file name. But the page is not getting displayed.

<table cellspacing=1 cellpadding=5>
<tr bgcolor=#cccccc>
         <td class=label nowrap>On-Special</td>
</tr>
<tr bgcolor=#cccccc>
         <td class=normal>
                 <? while ($r = db_fetch_object($qid)) { ?>
                         <p><b><a
href="<?=$CFG->wwwroot?>/shopping/product_details.php?id=<?=$r->id?>"><?=$r->name?></a></b>
                         <br><?=$r->description?>
                         <br>$<?=$r->price?>
                         <br>[<a
href="<?=$CFG->wwwroot?>/shopping/cart_add.php?id=<?=$r->id?>">+
Add to cart</a>]
                 <? } ?>
         </td>
</tr>
</table>

   But when I hard coded the id as $id=1 in product_details.php
the page with item displayed correctly. Please help

   I am on W2k with PHP 4.3.2, MySql and Apache 1.X

Thank you

Ben
___________________________________________________
Art meets Anesthesia; Shefali Weds Dr. Raman.
Rediff Matchmaker strikes another interesting match !!
Visit http://matchmaker.rediff.com?1

attached mail follows:


register_globals off?
What if you hardcode

$id=$_GET['id'];

??

Ben Johnson wrote:

> Hi,
>
> Why is the product_details.php is not getting the id value properly.
> In the URL it is showing id=1 with along with the correction location
> and file name. But the page is not getting displayed.
>
>
> <table cellspacing=1 cellpadding=5>
> <tr bgcolor=#cccccc>
> <td class=label nowrap>On-Special</td>
> </tr>
> <tr bgcolor=#cccccc>
> <td class=normal>
> <? while ($r = db_fetch_object($qid)) { ?>
> <p><b><a
> href="<?=$CFG->wwwroot?>/shopping/product_details.php?id=<?=$r->id?>"><?=$r->name?></a></b>
>
> <br><?=$r->description?>
> <br>$<?=$r->price?>
> <br>[<a
> href="<?=$CFG->wwwroot?>/shopping/cart_add.php?id=<?=$r->id?>">+ Add to
> cart</a>]
> <? } ?>
> </td>
> </tr>
> </table>
>
>
>
> But when I hard coded the id as $id=1 in product_details.php the page
> with item displayed correctly. Please help
>
> I am on W2k with PHP 4.3.2, MySql and Apache 1.X
>
> Thank you
>
> Ben
> ___________________________________________________
> Art meets Anesthesia; Shefali Weds Dr. Raman.
> Rediff Matchmaker strikes another interesting match !!
> Visit http://matchmaker.rediff.com?1
>

attached mail follows:


Hi all,
       I would like to create a dynamic kinda "Timetable" whereby I can add,
del, and modify the data contained in each cell. Besides that, each cell in the
table should have its unique colour in which this unique colour can be modified
anytime to a different colour through an interface, most probably to be able to
change the cell colour with selection from a drop down menu. ( This is the part
where I really need some help. )How can this be done?
Technology used are: PHP & MySQL

Regards,
Irin.

attached mail follows:


irinchiangjusteducation.com wrote:
> Hi all,
> I would like to create a dynamic kinda "Timetable"
whereby I
> can add, del, and modify the data contained in each cell.
Besides
> that, each cell in the table should have its unique colour in
which
> this unique colour can be modified anytime to a different
colour
> through an interface, most probably to be able to change the
cell
> colour with selection from a drop down menu. ( This is the part
where
> I really need some help. )How can this be done?
> Technology used are: PHP & MySQL
>
> Regards,
> Irin.

You'd use CSS for that. Create a class for each color you want to
give as options. In each cell tag add a var that'll be the class
for that cell, like "<td class=<?=cell01;?>>" and you'd assign
the color to that variable using the dropdown menu. To select the
cells, you could probably put a checkbox in each cell, so that
the checked cells will be the ones assigned the color you choose.
I think it could work, never done it myself yet, though ;)

Cristian

attached mail follows:


Cristian Lavaque wrote:
>
> You'd use CSS for that. Create a class for each color you want
to
> give as options. In each cell tag add a var that'll be the
class
> for that cell, like "<td class=<?=cell01;?>>" and you'd assign
> the color to that variable using the dropdown menu. To select
the
> cells, you could probably put a checkbox in each cell, so that
> the checked cells will be the ones assigned the color you
choose.
> I think it could work, never done it myself yet, though ;)
>
> Cristian

sorry, I wrote that code wrong, missed the $

<td class=<?=$cell01;?>>

Cristian

attached mail follows:


irinchiangjusteducation.com wrote:

> Hi all,
> I would like to create a dynamic kinda "Timetable" whereby I can add,
> del, and modify the data contained in each cell. Besides that, each cell in the
> table should have its unique colour in which this unique colour can be modified
> anytime to a different colour through an interface, most probably to be able to
> change the cell colour with selection from a drop down menu. ( This is the part
> where I really need some help. )How can this be done?
> Technology used are: PHP & MySQL
If you don't want your users to wait for server responce each time they
touch something, use javascript.

<select onchange="changeColor(this.value);">
<option value="Blue">Blue</option>
<option value="Red">Red</option>
</select>

changeColor(c) {
        var e;
        e = (document.all ? document.all.elementId :
document.getElementById('elementId'));
        e.style.backgroundColor = c;
}

>
> Regards,
> Irin.
>

attached mail follows:


Fyi, I can read the site fine in ie 6

-----Original Message-----
From: Jason Wong [mailto:php-generalgremlins.biz]
Sent: Monday, September 29, 2003 10:56 AM
To: php-generallists.php.net
Subject: Re: [PHP] Does the AOL browser break any standards?

On Tuesday 30 September 2003 01:33, Dan Anderson wrote:
> > Aside from it being OT, how can you expect anyone to help, if even
you
> > don't know (can't describe) what the problem is?
>
> Well I was mostly looking for known issues. For instance IE has some
> problems if you try and do certain things, so I figured AOL's browser
> might do the same. For instance, a problem with CSS, HTML 4, XHTML,
or
> something like that.

Seems like you're going about this the wrong way.

What's the point in indulging in idle speculation about what *could* go
wrong,
when you should be asking your users what really *is* going wrong.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Noncombatant: A dead Quaker.
-- Ambrose Bierce
*/

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

attached mail follows:


Burhan Khalid wrote:
> Greg Wiley wrote:
>> Funny you should ask this because I've been meaning to share
some
>> code that I wrote a few months ago that does exactly this for
any
>> day of the week.
>>
>> Please feel free to use this and make changes. I'd appreciate
any
>> changes/bug fixes being sent back to me though.
>>
> [ snip ]
>> function num_days ($day, $month, $year)
>> {
> [ snip ]
>
> One tip that I would add is that instead of using individual
> arguments, you might want to consider using an array as an
argument.
> This prevents people from inserting the arguments in the wrong
order,
> which would not yield the correct results.
>
> Function call would be :
>
> $my_date = array();
> $my_date['day'] = "Mon";
> $my_date['month'] = "Jan";
> $my_date['year'] = "2003";
>
> num_days($my_date);
>
> Of course the indexes could be in any order, as long as they
have day,
> month, year as keys.
>
> Just a thought, good work though :)
>
> --
> Burhan Khalid
> phplist[at]meidomus[dot]com
> http://www.meidomus.com

You could also put the input values in dropdown menus, at least
day and month. That way you make sure the input to the funtion is
correct everytime.

Cristian

attached mail follows:


> -----Original Message-----
> From: Cristian Lavaque [mailto:webdesignanguz.net]
>
> You could also put the input values in dropdown menus, at
> least day and month. That way you make sure the input to the
> funtion is correct everytime.
>

The code is just a function it's not a "page" in itself. I use it
in a form that display checkboxes for each Sunday in a month.
Someone else may use it by providing the arguments via a form in
the manner you suggest. The function, however, is just that, a
function.

Cheers, Greg.
--
Greg Wiley
http://wileysworld.org/

------------------------------------------------------------
Mail was checked for spam by the Freeware Edition of No Spam Today!
The Freeware Edition is free for personal and non-commercial use.
You can remove this notice by purchasing a full license! To order
or to find out more please visit: http://www.no-spam-today.com

attached mail follows:


CPT John W. Holmes wrote:

>From: "Raditha Dissanayake" <jabberraditha.com>
>
>
>>My Impression from Jane's mail was that she was thinking of using a PHP
>>script on the client side and not the server side. Am i correct jane? If
>>so there would not be security concerns. Obviously as john has so
>>rightly pointed out php on the server side cannot access local files.
>>
>>
>
>True, kind of, and that's how I understood it also. But, as we all know, PHP
>doesn't run client side, so she'd have to turn her computer into a web
>server or run PHP from the command line. There still isn't a way to
>automatically submit a file over HTTP using either method, though.
>
>FTP would work, though...
>
>---John Holmes...
>
>
Sorry about the late reply, i have been out of town. One further
assumption that i made was that jane would have the php command line
version installed. Then php would indeed run on the client side.

--
http://www.radinks.com/upload
Drag and Drop File Uploader.

attached mail follows:


Hi John,
Yops you are very right, this is only a few lines of visual basic or
java code.

John W. Holmes wrote:

> Mike Migurski wrote:
>
>>> The only part i am having trouble with is making the remote script
>>> automatically look into the local computer's hard drive and grab the
>>> .txt
>>> file.
>>
>>
>>
>> <snip>
>>
>>> The problem with the code above is the path to the file does not
>>> show up
>>> in the <input type='file'>, and the user would still need to click
>>> on the
>>> 'submit button' to upload the file.
>>
>>
>>
>> You're out of luck - for security reasons, the file input widget is
>> intentionally resistant to scripting/styling.
>
>
> Like I said, find another method. Try writing a batch file that will
> FTP them to your server and have a cron script process them.
>

--
http://www.radinks.com/upload
Drag and Drop File Uploader.

attached mail follows:


* Thus wrote Curt Zirzow (php-generalzirzow.dyndns.org):
> * Thus wrote Chris Shiflett (shiflettphp.net):
> > --- Curt Zirzow <php-generalzirzow.dyndns.org> wrote:
> > > http://zirzow.dyndns.org/html/mlists/php_general/
> >
> > There's also this:
> >
> > http://www.zend.com/cgi-bin/m_stats.pl?list=php-general&date=200309
> >
> > What would be really interesting is to see a page like yours that offers
> > statistics for "all time" in addition to specific months. I'd like to know how
> > many posts John Holmes has had, for example. :-)
>
> And whats really scary is I'm tempted to do that :) I can easily
> read all the 164194 messages sitting on the news server (since May
> 2000) and then build a summary poster summary page.

I'm on message 163194 and counting down to zero at this point :)

Added a little person-> month summary too.

Curt
--
"I used to think I was indecisive, but now I'm not so sure."

attached mail follows:


Matt Palermo wrote:
> I have a form that a user can fill out. In the text input
field I
> allow them to insert HTML tags with their input data. They can
then
> submit the form for processing. The problem is that later on
when
> they go to edit their inputs (I initialize the text input with
their
> previously submitted input) and they have HTML tags with double
> quotes, the it will only put characters up to the first double
quote
> inside the input box and the rest will go outside of it. I
would
> like the text box to contain everything they previously
submitted to
> be displayed there. Does anyone know of an easy way to allow
the
> double quotes to be initially inserted into the input box?
Please let
> me know.
>
> Thanks,
>
> Matt

Does the same problem occur with a textarea? Have you tried
escaping the double quotes?

Cristian

attached mail follows:


Hiya,

Replace " with &quot;

Martin

-----Original Message-----
From: Cristian Lavaque [mailto:webdesignanguz.net]
Sent: Tuesday, 30 September 2003 5:09 PM
To: [PHP]
Subject: Re: [PHP] Initial Value for Input Box

Matt Palermo wrote:
> I have a form that a user can fill out. In the text input
field I
> allow them to insert HTML tags with their input data. They can
then
> submit the form for processing. The problem is that later on
when
> they go to edit their inputs (I initialize the text input with
their
> previously submitted input) and they have HTML tags with double
> quotes, the it will only put characters up to the first double
quote
> inside the input box and the rest will go outside of it. I
would
> like the text box to contain everything they previously
submitted to
> be displayed there. Does anyone know of an easy way to allow
the
> double quotes to be initially inserted into the input box?
Please let
> me know.
>
> Thanks,
>
> Matt

Does the same problem occur with a textarea? Have you tried
escaping the double quotes?

Cristian

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
__________ Information from NOD32 1.518 (20030925) __________

This message was checked by NOD32 for Exchange e-mail monitor.
http://www.nod32.com

attached mail follows:


Hello,

I am looking for some guidance... I am using PHP to make dynamic
buttons... Is the PNG image format a pretty safe thing to go with...
Standard wise?

Thanks for your input.
Joe

attached mail follows:


On Tue, Sep 30, 2003 at 02:40:42AM -0400, Joe Harman wrote:
:
: I am looking for some guidance... I am using PHP to make dynamic
: buttons... Is the PNG image format a pretty safe thing to go with...
: Standard wise?

PNG support in M$ IE is still shaky.

attached mail follows:


I use mail() function in php, but there's no living mail from my system.
MUST be mail() function turn on in some special place (ini file, &...)
??

THANKS.

attached mail follows:


Hi,

I have a number of forms on my site, and each form can be accessed from a
number of different pages. Can anyone suggest a way I can monitor this so
that when the submit button is pressed the user is returned to the page they
were on before. This is also complicated by the fact that I have a system
that returns the user to the same page if there are errors on the form...

Thanks for your help

attached mail follows:


> -----Original Message-----
> From: Shaun [mailto:shaunmania.plus.com]
>
> Hi,
>
> I have a number of forms on my site, and each form can be
> accessed from a number of different pages. Can anyone suggest
> a way I can monitor this so that when the submit button is
> pressed the user is returned to the page they were on before.
> This is also complicated by the fact that I have a system
> that returns the user to the same page if there are errors on
> the form...
>
I do this by passing a hidden value in the post. The value can
identify anything you like, on mine it identifies the domain the
form was submitted from (though thinking about this now I can do
this without a hidden value, but you get the idea!).

The problem with this is that it means you have to have a separate
copy of each form unless you can construct the hidden input value
using other variables.

Cheers, Greg.
--
Greg Wiley
http://wileysworld.org/

------------------------------------------------------------
Mail was checked for spam by the Freeware Edition of No Spam Today!
The Freeware Edition is free for personal and non-commercial use.
You can remove this notice by purchasing a full license! To order
or to find out more please visit: http://www.no-spam-today.com

attached mail follows:


Hmm .. I haven't been on the list for a while so it took me some time to
answer ;).. Anyways, what I believe is a possible cause for your problem is
that there simply ain't no session started. Maybe the "always start session
before the php page request" setting was On if not configured, but is now
Off in your ini file.

    783 ; Initialize session on request startup.
    784 session.auto_start = 0

Might wants to be changed to

    783 ; Initialize session on request startup.
    784 session.auto_start = 1

Also check this one

    773 ; Whether to use cookies.
    774 session.use_cookies = 1

In combination with

    850 ; trans sid support is disabled by default.
    851 ; Use of trans sid may risk your users security.
    852 ; Use this option with caution.
    853 ; - User may send URL contains active session ID
    854 ; to other person via. email/irc/etc.
    855 ; - URL that contains active session ID may be stored
    856 ; in publically accessible computer.
    857 ; - User may access your site with the same session ID
    858 ; always using URL stored in browser's history or bookmarks.
    859 session.use_trans_sid = 0

If both are set to "0", sessions simply won't work since PHP cannot know
about the session id. If session.use_cookies is enabled, and
session.use_trans_sid is not than you should have Cookies enabled in your
browser for sessions to work.

Or if you're on Windows, pay special attention to

    771 session.save_path = /tmp

Which should then be changed to smth like c:\temp

That's pretty much what I can say about it .. If neither of those work, just
read the entire [Session] section in the php.ini file.

Wouter

-----Original Message-----
From: Scott Fletcher [mailto:scottabcoa.com]
Sent: Friday, September 26, 2003 9:26 PM
To: php-generallists.php.net
Subject: [PHP] $_SESSION stuffs that come with php.ini

I have been building the website for 6 months with everything and I didn't
have hte php.ini on it. Just didn't realize it, so I create the php.ini
that come from php.ini_dist that came with php source code. Now the
$_SESSION doesn't work. I'm not able to make the php.ini to be like the one
that php work without it. So, anyone know what is the default session
configuration?

Thanks...

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

attached mail follows:


Hi all,
       I am creating a simple receipt system whereby user will enter relevant
info
via a text form and using echo method to output and print the receipt data. I've
used CSS as the front-end . My question is, is it possible to output the receipt
information more than once on a single page (Browser)???? as I would need to
print out the receipt thrice for the different department as required.

Regards,
Irin

attached mail follows:


Yes, you can. But would not it be smarter to increase the number of
copies in the print dialog?

irinchiangjusteducation.com wrote:

>
> Hi all,
> I am creating a simple receipt system whereby user will enter relevant
> info
> via a text form and using echo method to output and print the receipt data. I've
> used CSS as the front-end . My question is, is it possible to output the receipt
> information more than once on a single page (Browser)???? as I would need to
> print out the receipt thrice for the different department as required.
>
> Regards,
> Irin
>

attached mail follows:


[snip]
My question is, is it possible to output the receipt information more
than once on a single page (Browser)???? as I would need to print out
the receipt thrice for the different department as required.
[/snip]

wrap the output in a for loop
for($i = 0; $i < 3; $i++){
        output receipt
}

attached mail follows:


On Tuesday 30 September 2003 18:59, Marek Kilimajer wrote:
> Yes, you can. But would not it be smarter to increase the number of
> copies in the print dialog?

But that would be environmentally unfriendly because it uses more paper ;-)

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
        "Do you believe in intuition?"
        "No, but I have a strange feeling that someday I will."
*/

attached mail follows:


By advising you something like this

      2 <?php
      3 exec('echo "p 1" | mail', $Lines);
      4
      5 foreach($Lines as $Line) {
      6 print '> '.$Line."\n";
      7 };
      8 ?>

Would I apply for the bonus points? It would generate output similar to

> Mail version 8.1 6/6/93. Type ? for help.
> "/var/spool/mail/wouter": 6 messages 6 unread
> >U 1 wouterbrandtstraat. Tue Sep 30 11:17 24/786 "test"
> U 2 wouterbrandtstraat. Tue Sep 30 11:17 24/786 "test"
> U 3 wouterbrandtstraat. Tue Sep 30 11:17 24/786 "test"
> U 4 wouterbrandtstraat. Tue Sep 30 11:17 24/786 "test"
> U 5 wouterbrandtstraat. Tue Sep 30 11:17 24/786 "test"
> U 6 wouterbrandtstraat. Tue Sep 30 11:17 24/786 "test"
> Message 1:
> From wouterbrandtstraat.mine.nu Tue Sep 30 11:17:32 2003
> Date: Tue, 30 Sep 2003 11:17:31 +0200
> From: Wouter van Vliet <wouterbrandtstraat.mine.nu>
> To: wouterbrandtstraat.mine.nu
> Subject: test
>
> #!/usr/bin/php -q
> <?php
> exec('echo "p 1" | mail', $Lines);
>
> foreach($Lines as $Line) {
> print '> '.$Line."\n";
> };
> ?>
>
> Saved 1 message in mbox
> Held 5 messages in /var/spool/mail/wouter

(in this test, I mailed the contents of my script to myself)

Hope it helps ya,
Wouter

-----Original Message-----
From: Dan Phiffer [mailto:danphiffer.com]
Sent: Friday, September 26, 2003 1:05 AM
To: php-generallists.php.net
Subject: [PHP] Checking mail with `mail`

Is it practical to check for new mail from PHP using the UNIX mail utility?
This would mainly be used to check for bounces from large mailings. Bonus
points for anyone who can find me an article explaining the technique.

Thanks!
-Dan

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

attached mail follows:


Hi,
I have just installed PHP 4.3.3, Apache 2.0.47 and MySQL 4.0.15a under
Windows XP.
When I try to see a HTML pages, everything is ok but when it comes to PHP
pages nothing works
I have this message with IE : "The page cannot be displayed"
with Opera 7, Mozilla : nothing

HELP

Thanks
Olivier

attached mail follows:


On Tue, Sep 30, 2003 at 11:56:23AM +0200, Olivier Simah wrote:
> Hi,
> I have just installed PHP 4.3.3, Apache 2.0.47 and MySQL 4.0.15a under
> Windows XP.
> When I try to see a HTML pages, everything is ok but when it comes to PHP
> pages nothing works
> I have this message with IE : "The page cannot be displayed"
> with Opera 7, Mozilla : nothing
>
anything useful in the apache logs? (error.log?) ?

Martin.

--
"Real Programmers don't document -
if it was hard to write is should
be hard to understand.."

attached mail follows:


The problem is that I do not have the log right now, I send you an answer
tonight
Thanks

"Martin Clarke" <prolixredbrick.dcu.ie> wrote in message
news:20030930100052.GA28344carbon.redbrick.dcu.ie...
> On Tue, Sep 30, 2003 at 11:56:23AM +0200, Olivier Simah wrote:
> > Hi,
> > I have just installed PHP 4.3.3, Apache 2.0.47 and MySQL 4.0.15a under
> > Windows XP.
> > When I try to see a HTML pages, everything is ok but when it comes to
PHP
> > pages nothing works
> > I have this message with IE : "The page cannot be displayed"
> > with Opera 7, Mozilla : nothing
> >
> anything useful in the apache logs? (error.log?) ?
>
> Martin.
>
>
> --
> "Real Programmers don't document -
> if it was hard to write is should
> be hard to understand.."

attached mail follows:


[snip]
I have just installed PHP 4.3.3, Apache 2.0.47 and MySQL 4.0.15a under
Windows XP.
When I try to see a HTML pages, everything is ok but when it comes to
PHP
pages nothing works
I have this message with IE : "The page cannot be displayed"
with Opera 7, Mozilla : nothing
[/snip]

Did you add the php info in the httpd.conf?

attached mail follows:


Olivier Simah wrote:

> Hi,
> I have just installed PHP 4.3.3, Apache 2.0.47 and MySQL 4.0.15a under
> Windows XP.
> When I try to see a HTML pages, everything is ok but when it comes to PHP
> pages nothing works
> I have this message with IE : "The page cannot be displayed"
> with Opera 7, Mozilla : nothing

Try this http://www.meidomus.com/node/view/3

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com

attached mail follows:


i have a script where people upload an image it is then renamed and is
supposed to be cripped according to the values they submit but i cant seem
to get it to crop it uploads and is renamed fine though. also i wish to use
a static name so when another picture is uploaded the old one is overwritten
that is why the input path and output path is the same.
-------------Code----------
exec($path_imagemagick."convert -crop 0x100+0+0 $imagepath.$filename
$imagepath.$filename");
---------End Code----------
any ideas why this wont work?

attached mail follows:


Cameron --

...and then Cameron Metzke said...
%
...
% a static name so when another picture is uploaded the old one is overwritten
% that is why the input path and output path is the same.
% -------------Code----------
% exec($path_imagemagick."convert -crop 0x100+0+0 $imagepath.$filename
% $imagepath.$filename");
% ---------End Code----------

To change an image rather than make a new version of it, just use
mogrify.

% any ideas why this wont work?

Start there and let us know how you do.

HTH & HAND

:-D
--
David T-G * There is too much animal courage in
(play) davidtgjustpickone.org * society and not sufficient moral courage.
(work) davidtgworkjustpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE/eVgcGb7uCXufRwARAqyAAKDMBGVJG7MKhUazO7gFg4ERKHRn7ACfVpYp
shbJhIixfqLWSpbGiOdagOQ=
=3RtU
-----END PGP SIGNATURE-----

attached mail follows:


Hi,

I need to send the following link

view_day.php?mysql_date=2003-09-23&user_id=35&set_form_actions=true&new_user
=yes&user_name=Kate%20Dickie&link_text=diary&link_action=availability.php?ne
w_user=yes&user_name=Kate%20Dickie.

This may seem strange that I have 2 ?'s in the link but the point here is
that I need everything after the 2nd ? to be used as a link on the following
page - which is actually held in a session.

However when I try to do this, the link_action held is
'availability.php?new_user=yes', how can I get everything after the 2nd ? to
be held in the session var?

Thanks for your help

attached mail follows:


On Tuesday 30 September 2003 18:20, Shaun wrote:

> I need to send the following link
>
> view_day.php?mysql_date=2003-09-23&user_id=35&set_form_actions=true&new_use
>r
> =yes&user_name=Kate%20Dickie&link_text=diary&link_action=availability.php?n
>e w_user=yes&user_name=Kate%20Dickie.
>
> This may seem strange that I have 2 ?'s in the link but the point here is
> that I need everything after the 2nd ? to be used as a link on the
> following page - which is actually held in a session.
>
> However when I try to do this, the link_action held is
> 'availability.php?new_user=yes', how can I get everything after the 2nd ?
> to be held in the session var?

urlencode() or rawurlencode() the value of 'link_action'.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
He thinks the Gettysburg Address is where Lincoln lived.
                -- Wanda, "A Fish Called Wanda"
*/

attached mail follows:


I give an wrong example. Here is a better one

<?php

$txt = "func1($par1," 100 (euro)", func2($par2,"(c) by nobody"))";

if (preg_match_all('

/

([a-zA-Z]\w*?)

\s*

(

\(

(

(?>.*?)|

.*?(?R)*

)

\)

)+

/x

', $txt, $m)){

print_r($m);

} else {

echo "no match";

}

echo "\n";

?>

This must result in :

First call: func1($par1," 100 (euro)", func2($par2,"(c) by nobody"))
Second call with the inner part $par1," 100 (euro)", func2($par2,"(c) by
nobody")
must result in : func2($par2,"(c) by nobody")

Please visit www.regexp.org there is an open thread of this question.

thanx

attached mail follows:


I would do it this way. Output your files and update bandwith usage:

while($out=fread($file, 4096)) {
        echo $out;
        UPDATE bandwith_usage SET bandwith_usage = bandwith_usage+1 WHERE
second = UNIX_TIMESTAMP() LIMIT 1
        if(mysql_affected_rows()==0) { // if this is the first output in this
second
                INSERT bandwith_usage SET bandwith_usage = 1, second = UNIX_TIMESTAMP()
        }
}

When you are about to start a download, check the bandwith usage first,
in this case for the last minute:

SELECT AVG(bandwith_usage) usage FROM bandwith_usage WHERE second >
UNIX_TIMESTAMP() - 60

usage * 4096 gives you usage in bytes per second. If it exceeds your
limit, output a html page (sorry...), else open the file and start the
above loop.

You might want to change 4096 to a higher value. You should also
implement a garbage collector that will remove old bandwith usage data,
the collector can make usage statistics too.

Alex wrote:
> I'm considering start up a small download site with the large amount of
> excess bandwith I have on my site, however I thought it would be cool to
> put some sort of download queue up (you know, so all my bandwith doesn't
> get eaten up when 500 random people suddenly decide to download a 500meg
> file i've put up.
>
> In any case, I'm once again to the point where I know what I want, but
> the logic of it escapes me. If anyone has ever done this before, seen
> the code behind this before, or knows basically how this would be done,
> I'd be more than happy if you would share your wisdom with me.
>

attached mail follows:


25 queries a second? No problem.

But you calculations are still wrong:

500 kb/s = 62.5 kB/s
62.5 kB/s * 100 users = 6 250 MB/s
6 250 MB/s / 4 kB (4096 B) = 1562.5 queries per second

Well that's too much. At this load 4096 can be increased to 409600, the
database load would be only 15.625 queries per second.

Nathan Taylor wrote:

> Actually, correct that, 200 queries every 8 seconds! It won't just explode, it will create a mushroom cloud while it's at it!
> ----- Original Message -----
> From: Marek Kilimajer
> To: Alex
> Cc: php-generallists.php.net
> Sent: Tuesday, September 30, 2003 6:32 AM
> Subject: Re: [PHP] download queue
>
>
> I would do it this way. Output your files and update bandwith usage:
>
> while($out=fread($file, 4096)) {
> echo $out;
> UPDATE bandwith_usage SET bandwith_usage = bandwith_usage+1 WHERE
> second = UNIX_TIMESTAMP() LIMIT 1
> if(mysql_affected_rows()==0) { // if this is the first output in this
> second
> INSERT bandwith_usage SET bandwith_usage = 1, second = UNIX_TIMESTAMP()
> }
> }
>
> When you are about to start a download, check the bandwith usage first,
> in this case for the last minute:
>
> SELECT AVG(bandwith_usage) usage FROM bandwith_usage WHERE second >
> UNIX_TIMESTAMP() - 60
>
> usage * 4096 gives you usage in bytes per second. If it exceeds your
> limit, output a html page (sorry...), else open the file and start the
> above loop.
>
> You might want to change 4096 to a higher value. You should also
> implement a garbage collector that will remove old bandwith usage data,
> the collector can make usage statistics too.
>
> Alex wrote:
> > I'm considering start up a small download site with the large amount of
> > excess bandwith I have on my site, however I thought it would be cool to
> > put some sort of download queue up (you know, so all my bandwith doesn't
> > get eaten up when 500 random people suddenly decide to download a 500meg
> > file i've put up.
> >
> > In any case, I'm once again to the point where I know what I want, but
> > the logic of it escapes me. If anyone has ever done this before, seen
> > the code behind this before, or knows basically how this would be done,
> > I'd be more than happy if you would share your wisdom with me.
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


Hi All,

I am having problems with fsockopen() and wondered if anyone else has
encountered this behaviour. My problem is that when connecting to an invalid
domain I cannot trap the errors.

I have tried setting a variable then testing the value, which prints a
warning to the screen...

$sck_handle = fsockopen($hostname, $port, $errno, $errstr, $timeout);
if (!$sck_handle)
{
        // socket could not be opened.
        $http_statuscode = "Error:" . $errno . "-" . $errstr;
}
else
{
        ...
}

How can I get $errno & $errstr, are these for read/write errors rather than
socket initialisation? I need to know why the socket could not be opened so
I can give an appropriate error message.

TIA

Phil Ewington - Technical Director
----------------------------------
43 Plc
35 Broad Street, Wokingham
Berkshire RG40 1AU
T: +44 (0)118 978 9500
F: +44 (0)118 978 4994
E: mailto:phil.ewington43plc.com
W: http://www.43plc.com

attached mail follows:


Ima having problems myself with this, i dont seem to get errors when
entering an invalid .com or .net name i put it down to verisign hijacking
invalid somains?? could this be your problem?
"Phil Ewington - 43 Plc" <phil.ewington43plc.com> wrote in message
news:CMEGJANHOICDLIHPAJBCMELDEFAA.phil.ewington43plc.com...
> Hi All,
>
> I am having problems with fsockopen() and wondered if anyone else has
> encountered this behaviour. My problem is that when connecting to an
invalid
> domain I cannot trap the errors.
>
> I have tried setting a variable then testing the value, which prints a
> warning to the screen...
>
> $sck_handle = fsockopen($hostname, $port, $errno, $errstr, $timeout);
> if (!$sck_handle)
> {
> // socket could not be opened.
> $http_statuscode = "Error:" . $errno . "-" . $errstr;
> }
> else
> {
> ...
> }
>
> How can I get $errno & $errstr, are these for read/write errors rather
than
> socket initialisation? I need to know why the socket could not be opened
so
> I can give an appropriate error message.
>
> TIA
>
>
> Phil Ewington - Technical Director
> ----------------------------------
> 43 Plc
> 35 Broad Street, Wokingham
> Berkshire RG40 1AU
> T: +44 (0)118 978 9500
> F: +44 (0)118 978 4994
> E: mailto:phil.ewington43plc.com
> W: http://www.43plc.com

attached mail follows:


On Tuesday 30 September 2003 18:46, Phil Ewington - 43 Plc wrote:

> I am having problems with fsockopen() and wondered if anyone else has
> encountered this behaviour. My problem is that when connecting to an
> invalid domain I cannot trap the errors.

Have you checked that it is really an invalid domain and not simply been
hijacked by Versign:

  http://www.techweb.com/tech/network/20030926_network

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
H. L. Mencken's Law:
        Those who can -- do.
        Those who can't -- teach.

Martin's Extension:
        Those who cannot teach -- administrate.
*/

attached mail follows:


I'm referencing an image on a different server, and it keeps changing
URL's
Very odd, but t get round that, I tried...

if (file_exists("http://www.othersite.com/image_1.gif")) {
        $image_show="http://www.othersite.com/image_1.gif";
} else {
        $image_show="http://www.mysite.com/image_1.gif";
}

but it always seems to do the else command, even though I know the file
DOES exist...

Just for the record, this problem exists from our parent website to one of
the subsideries, we're not referencing anything we shouldn't... ;-)

Any work arounds?

*********************************************************************
The information contained in this e-mail message is intended only for
the personal and confidential use of the recipient(s) named above.
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is
strictly prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original message.
***********************************************************************

attached mail follows:


On Tuesday 30 September 2003 19:00, Tristan.Prettyrisk.sungard.com wrote:
> I'm referencing an image on a different server, and it keeps changing
> URL's
> Very odd, but t get round that, I tried...
>
> if (file_exists("http://www.othersite.com/image_1.gif")) {
> $image_show="http://www.othersite.com/image_1.gif";
> } else {
> $image_show="http://www.mysite.com/image_1.gif";
> }
>
> but it always seems to do the else command, even though I know the file
> DOES exist...

RTFM

Try fopen() or similar instead.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
If you are over 80 years old and accompanied by your parents, we will
cash your check.
*/

attached mail follows:


RTFM?
(Sorry, very newbie question)

Jason Wong <php-generalgremlins.biz>
30/09/2003 12:26
Please respond to
php-generallists.php.net

To
php-generallists.php.net
cc

Subject
Re: [PHP] file_exists on different server...

On Tuesday 30 September 2003 19:00, Tristan.Prettyrisk.sungard.com wrote:
> I'm referencing an image on a different server, and it keeps changing
> URL's
> Very odd, but t get round that, I tried...
>
> if (file_exists("http://www.othersite.com/image_1.gif")) {
> $image_show="http://www.othersite.com/image_1.gif";
> } else {
> $image_show="http://www.mysite.com/image_1.gif";
> }
>
> but it always seems to do the else command, even though I know the file
> DOES exist...

RTFM

Try fopen() or similar instead.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
If you are over 80 years old and accompanied by your parents, we will
cash your check.
*/

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

*********************************************************************
The information contained in this e-mail message is intended only for
the personal and confidential use of the recipient(s) named above.
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is
strictly prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original message.
***********************************************************************