|
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 15 Jul 2004 04:20:00 -0000 Issue 2877
php-general-digest-help
lists.php.net
Date: Wed Jul 14 2004 - 23:20:00 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 15 Jul 2004 04:20:00 -0000 Issue 2877
Topics (messages 190494 through 190558):
Re: PHP on MAC
190494 by: Jeff Williams
190497 by: Geethanandh Kandasamy
using Cc: with mail()
190495 by: Amanda Hemmerich
190500 by: Curt Zirzow
190501 by: Richard Davey
190502 by: Eric Schwartz
190551 by: Manuel Lemos
190554 by: Curt Zirzow
190555 by: Manuel Lemos
Re: MCAL Function
190496 by: Harlequin
190498 by: Torsten Roehr
190503 by: Harlequin
190504 by: Torsten Roehr
190528 by: Harlequin
Re: Opinion: PHP Sessions or Cookies
190499 by: Justin Patrin
190509 by: Ed Lazor
190511 by: Torsten Roehr
Re: Anyone knows when PHP5 is released?
190505 by: abrea
PHP5 for Fedora Core 2
190506 by: C.F. Scheidecker Antunes
example to give privs on packages instead of give privs directly on table to user to be better DB Security
190507 by: Raúl Castro
php .vs cgi app..
190508 by: bruce
190516 by: Vail, Warren
190524 by: Ciprian Constantinescu
Limitation to URL params on Include()?
190510 by: Alex Hogan
190513 by: James Harrell
190517 by: Alex Hogan
190521 by: James Harrell
190525 by: Alex Hogan
problem with forms
190512 by: Luká¹ Moravec - PTV Servis
190515 by: Torsten Roehr
shuffle
190514 by: Edward Peloke
190519 by: Torsten Roehr
190533 by: Edward Peloke
190534 by: Edward Peloke
190535 by: Torsten Roehr
190538 by: Edward Peloke
190540 by: Curt Zirzow
Google question
190518 by: Brian Dunning
190523 by: bruce
190530 by: Greg Donald
190532 by: Brian Dunning
190537 by: Greg Donald
190547 by: Manuel Lemos
190556 by: raditha dissanayake
[mysql]Problem with PHP5
190520 by: Ciprian Constantinescu
190526 by: Ben Ramsey
Re: Detecting if browser is using a HTTP or HTTPS connection to view the page
190522 by: Jamie
Re: PHP JAVA Error on linux
190527 by: Alawi albaity
190550 by: Alawi albaity
Re: using the mssql functions on a linux server
190529 by: Skippy
190531 by: Michael Sims
Site Planning
190536 by: EE
Re: DAYLIGHT SAVINGS TIME OR NOT
190539 by: Chirag Shukla
New object model
190541 by: Troy S
190542 by: Ben Ramsey
upload an image and store it in mysql
190543 by: Five
190544 by: John W. Holmes
[Q] PHP 101 -- How to check for session existence?
190545 by: Michael T. Peterson
190546 by: Justin Patrin
Re: Simple POP3 mailbox checker script
190548 by: Manuel Lemos
Companies using PHP
190549 by: Theisen, Gary
190552 by: Chris Shiflett
190553 by: Theisen, Gary
PHP5 Windows not built with Soap Enabled?
190557 by: Sean Malloy
Dynamic to Static
190558 by: Ed Lazor
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
> PHP is already installed. If you want the latest 4.x series, use the
> entropy installer. If you want PHP 5 you will have to build it
> yourself from source. I have recently done that, I found this article
> useful in doing so:
>
> http://www.phpmac.com/articles.php?view=177
Any idea why the HFS and Rendezvous modules had to be commented out in
order for PHP to work?
"If you have only used the PHP that came with OS X before:
You may need to comment (place a # at the start of the line) the
following lines in your Apache Configuration (/etc/httpd/httpd.conf)
file:
LoadModule hfs_apple_module libexec/httpd/mod_hfs_apple.so
AddModule mod_hfs_apple.c
LoadModule rendezvous_apple_module libexec/httpd/mod_rendezvous_apple.so
AddModule mod_rendezvous_apple.c"
attached mail follows:
You should not comment, if you do so you cant start apache at all
I wonder why the tutorial say that
attached mail follows:
Ok, I am trying to fix a bug on a site I didn't write, and I looked for
examples on www.php.net and couldn't find what I needed.
Here is the line of code in question:
mail($email, "XXX - Conference Registration Confirmation", $message,
"From: confirmations
XXX.com\r\n" . "Cc:linda
XXX.com;
info
XXX.com");
The Cc isn't working, and it looks strange to me. I want to find an
example of mail() using Cc: so I can see if it's using the correct syntax
and everything. Plus I want to change everything to variables, but I can
do that once it is working correctly.
Can anyone direct me to a good example or tell me what's wrong?
Thanks!
Amanda
attached mail follows:
* Thus wrote Amanda Hemmerich:
> Ok, I am trying to fix a bug on a site I didn't write, and I looked for
> examples on www.php.net and couldn't find what I needed.
>
> Here is the line of code in question:
>
> mail($email, "XXX - Conference Registration Confirmation", $message,
> "From: confirmations
XXX.com\r\n" . "Cc:linda
XXX.com;
> info
XXX.com");
>
> ...
>
> Can anyone direct me to a good example or tell me what's wrong?
>
Try using something like:
CC: linda
xxx.com, info
xxx.com
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!
attached mail follows:
Amanda Hemmerich wrote:
> Ok, I am trying to fix a bug on a site I didn't write, and I looked for
> examples on www.php.net and couldn't find what I needed.
>
> Here is the line of code in question:
>
> mail($email, "XXX - Conference Registration Confirmation", $message,
> "From: confirmations
XXX.com\r\n" . "Cc:linda
XXX.com;
> info
XXX.com");
I would have thought it needs a space after Cc: and before the email
address. Look at the example code here:
http://uk.php.net/manual/en/function.mail.php
--
http://www.launchcode.co.uk - PHP Development Services
"I am not young enough to know everything." - Oscar Wilde
attached mail follows:
On Wed, 14 Jul 2004 10:55:18 -0500 (EST), Amanda Hemmerich
<amccomb
indiana.edu> wrote:
> Ok, I am trying to fix a bug on a site I didn't write, and I looked for
> examples on www.php.net and couldn't find what I needed.
>
> Here is the line of code in question:
>
> mail($email, "XXX - Conference Registration Confirmation", $message,
> "From: confirmations
XXX.com\r\n" . "Cc:linda
XXX.com;
> info
XXX.com");
>
> The Cc isn't working, and it looks strange to me. I want to find an
> example of mail() using Cc: so I can see if it's using the correct syntax
> and everything. Plus I want to change everything to variables, but I can
> do that once it is working correctly.
>
> Can anyone direct me to a good example or tell me what's wrong?
>
> Thanks!
> Amanda
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Look into the additional headers.
http://us3.php.net/manual/en/function.mail.php
attached mail follows:
Hello,
On 07/14/2004 12:55 PM, Amanda Hemmerich wrote:
> Ok, I am trying to fix a bug on a site I didn't write, and I looked for
> examples on www.php.net and couldn't find what I needed.
>
> Here is the line of code in question:
>
> mail($email, "XXX - Conference Registration Confirmation", $message,
> "From: confirmations
XXX.com\r\n" . "Cc:linda
XXX.com;
> info
XXX.com");
>
> The Cc isn't working, and it looks strange to me. I want to find an
> example of mail() using Cc: so I can see if it's using the correct syntax
> and everything. Plus I want to change everything to variables, but I can
> do that once it is working correctly.
This looks like a bug of the mail() function. Have you tried separating
the recipients in Cc: with , instead of ; and also add a space between
Cc: and the first address?
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
attached mail follows:
* Thus wrote Manuel Lemos:
> Hello,
>
> On 07/14/2004 12:55 PM, Amanda Hemmerich wrote:
> >Ok, I am trying to fix a bug on a site I didn't write, and I looked for
> >examples on www.php.net and couldn't find what I needed.
> >
> >Here is the line of code in question:
> >
> >mail($email, "XXX - Conference Registration Confirmation", $message,
> >"From: confirmations
XXX.com\r\n" . "Cc:linda
XXX.com;
> >info
XXX.com");
> >
> >The Cc isn't working, and it looks strange to me. I want to find an
> >example of mail() using Cc: so I can see if it's using the correct syntax
> >and everything. Plus I want to change everything to variables, but I can
> >do that once it is working correctly.
>
> This looks like a bug of the mail() function. Have you tried separating
> the recipients in Cc: with , instead of ; and also add a space between
> Cc: and the first address?
This is *not* a bug of the mail() function, please change your
template for these replied messages.
';' is not a proper seperator for addresses. see rfc2822
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!
attached mail follows:
Hello,
On 07/14/2004 10:02 PM, Curt Zirzow wrote:
>>>Ok, I am trying to fix a bug on a site I didn't write, and I looked for
>>>examples on www.php.net and couldn't find what I needed.
>>>
>>>Here is the line of code in question:
>>>
>>>mail($email, "XXX - Conference Registration Confirmation", $message,
>>>"From: confirmations
XXX.com\r\n" . "Cc:linda
XXX.com;
>>>info
XXX.com");
>>>
>>>The Cc isn't working, and it looks strange to me. I want to find an
>>>example of mail() using Cc: so I can see if it's using the correct syntax
>>>and everything. Plus I want to change everything to variables, but I can
>>>do that once it is working correctly.
>>
>>This looks like a bug of the mail() function. Have you tried separating
>>the recipients in Cc: with , instead of ; and also add a space between
>>Cc: and the first address?
>
>
> This is *not* a bug of the mail() function, please change your
> template for these replied messages.
>
> ';' is not a proper seperator for addresses. see rfc2822
I did not say that is the bug of the mail() function. In case you are
not aware, the mail function has many different bugs depending on the
PHP version and the system it is used in.
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
attached mail follows:
OK, OK "on-line"...!
--
-----------------------------
Michael Mason
Arras People
www.arraspeople.co.uk
-----------------------------
"Harlequin" <michael.mason
arraspeople.co.uk> wrote in message
news:20040714153632.75983.qmail
pb1.pair.com...
> It appears that PHP can create on-pine calendars...?
>
> I'm looking for tutorials but no joy. Can anyone point me in the right
> direction...?
>
> --
> -----------------------------
> Michael Mason
> Arras People
> www.arraspeople.co.uk
> -----------------------------
attached mail follows:
"Harlequin" <michael.mason
arraspeople.co.uk> wrote in message
news:20040714155632.79770.qmail
pb1.pair.com...
> OK, OK "on-line"...!
>
> --
> -----------------------------
> Michael Mason
> Arras People
> www.arraspeople.co.uk
> -----------------------------
> "Harlequin" <michael.mason
arraspeople.co.uk> wrote in message
> news:20040714153632.75983.qmail
pb1.pair.com...
> > It appears that PHP can create on-pine calendars...?
> >
> > I'm looking for tutorials but no joy. Can anyone point me in the right
> > direction...?
PEAR has an excellent calendar package - if this is what you are looking
for:
http://pear.php.net/package/Calendar
Regards, Torsten Roehr
attached mail follows:
I'll have a look at that Torsten, thanks.
Can a "user" create their own entries then...?
--
-----------------------------
Michael Mason
Arras People
www.arraspeople.co.uk
-----------------------------
"Torsten Roehr" <roehr
zilleon.com> wrote in message
news:20040714155846.90881.qmail
pb1.pair.com...
> "Harlequin" <michael.mason
arraspeople.co.uk> wrote in message
> news:20040714155632.79770.qmail
pb1.pair.com...
> > OK, OK "on-line"...!
> >
> > --
> > -----------------------------
> > Michael Mason
> > Arras People
> > www.arraspeople.co.uk
> > -----------------------------
> > "Harlequin" <michael.mason
arraspeople.co.uk> wrote in message
> > news:20040714153632.75983.qmail
pb1.pair.com...
> > > It appears that PHP can create on-pine calendars...?
> > >
> > > I'm looking for tutorials but no joy. Can anyone point me in the right
> > > direction...?
>
> PEAR has an excellent calendar package - if this is what you are looking
> for:
> http://pear.php.net/package/Calendar
>
> Regards, Torsten Roehr
attached mail follows:
"Harlequin" <michael.mason
arraspeople.co.uk> wrote in message
news:20040714161631.88178.qmail
pb1.pair.com...
> I'll have a look at that Torsten, thanks.
>
> Can a "user" create their own entries then...?
I guess you'll have to create the admin frontend/backend yourself. The
package is mostly for presenting/displaying calender data.
Take a look at the package description for its intended use and features.
Regards, Torsten
attached mail follows:
I've been trying to do that all afternoon Torsten.
Had the browser page sat there for a few hours now, only just got time to
read it.
--
-----------------------------
Michael Mason
Arras People
www.arraspeople.co.uk
-----------------------------
"Torsten Roehr" <roehr
zilleon.com> wrote in message
news:20040714162132.9205.qmail
pb1.pair.com...
> "Harlequin" <michael.mason
arraspeople.co.uk> wrote in message
> news:20040714161631.88178.qmail
pb1.pair.com...
> > I'll have a look at that Torsten, thanks.
> >
> > Can a "user" create their own entries then...?
>
> I guess you'll have to create the admin frontend/backend yourself. The
> package is mostly for presenting/displaying calender data.
>
> Take a look at the package description for its intended use and features.
>
> Regards, Torsten
>
attached mail follows:
......sessions are easier IMHO....
On Wed, 14 Jul 2004 16:40:33 +0100, Harlequin
<michael.mason
arraspeople.co.uk> wrote:
> I am using PHP sessions for my site. Have done the numbers and have to agree
> that although cookies make life easier for the developer the whole reason
> for cookies is to make life easier for the browser.
>
> We have to accept that not all users can interrogate a cookie download and
> verify if the site is safe, so sessions it is :)
>
> --
> -----------------------------
> Michael Mason
> Arras People
> www.arraspeople.co.uk
> -----------------------------
> "Ed Lazor" <Ed.Lazor
d20News.com> wrote in message
> news:php.general-190398
news.php.net...
> > I'm using PHP sessions for user tracking. My host provider's server is
> > dropping session data. He swears it's my scripts and says I should be
> using
> > cookies for better security. That goes completely opposite to my
> > understanding, so I'd like to run it by you guys. Which is more secure:
> > PHP sessions or cookies?
> >
> >
> >
> > In case you're curious, more details on the specifics of the problem I'm
> > experiencing:
> >
> >
> >
> > I have a prepend file that executes start_session. The script assumes the
> > user is a guest if $_SESSION["UserID"] is not set. All guests route to
> the
> > login screen. Successful authentication sets $_SESSION["UserID"] and
> sends
> > you to the original requested page.
> >
> >
> >
> > It seems fairly straight forward to me. People are able to login and
> start
> > using the site, but the login screen displays randomly after they've
> already
> > authenticated successfully.
> >
> >
> >
> > It sounds like PHP session data is being lost on the server. I've also
> seen
> > error messages on web pages that report PHP / MySQL as having trouble
> > reading from the temp directory. Here's the extact message: ERRORError
> > writing file '/tmp/MYiYcf7q' (Errcode: 28).
> >
> >
> >
> > Anyway, those are the details. I look forward to hearing what you think.
> >
> >
> >
> > -Ed
> >
> >
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> !DSPAM:40f55213116972033915540!
>
>
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--
attached mail follows:
> -----Original Message-----
> have you tried storing your session data in a database? Storing session
> data
> in a database has some advances over the standard file based solution,
> mainly data security und comfort. For example, if you want to get the
> number
> of the active sessions just do a simple "select count(*) from sessions".
I'm not storing sessions into the database right now, but I have before and
I'll probably do it again =)
-Ed
attached mail follows:
> > -----Original Message-----
> > have you tried storing your session data in a database? Storing session
> > data
> > in a database has some advances over the standard file based solution,
> > mainly data security und comfort. For example, if you want to get the
> > number
> > of the active sessions just do a simple "select count(*) from sessions".
>
> I'm not storing sessions into the database right now, but I have before
and
> I'll probably do it again =)
I'm doing it with the help of PEAR::DB and PEAR::HTTP_Session - really
simple! Are you interested in sample code?
Regards, Torsten
attached mail follows:
Congratulations and good luck to the PHP 5.0.0 team!!
Alberto Brea
-----Original Message-----
From: "John W. Holmes" <holmes072000
charter.net>
To: Ben Ramsey <lists
benramsey.com>
Cc: php-general
lists.php.net
Date: Tue, 13 Jul 2004 18:44:06 -0400
Subject: Re: [PHP] Re: Anyone knows when PHP5 is released?
> Ben Ramsey wrote:
>
> > Aidan Lister wrote:
> >
> >> "When it's ready"
> >>
> >> Hopefully we'll see the stable release in the next 24 hours.
> >
> >
> > There was a post to the internals
list yesterday. Andi announced a
> > test roll of 5.0.0 saying that he would release PHP 5 within the next
> 24
> > hours "if all goes well." Keep your fingers crossed.
> >
> > Refer to: http://www.phpdeveloper.org/index/2279
> >
>
> www.php.net says PHP 5.0.0 is released now. I'm sure there'll be an
> annoucement soon...
>
> --
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals – www.phparch.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Hello all,
Are there any pre compiled rpm packages from Fedora Core 2 yet?
If not, I will most likely built it myself.
Thanks.
attached mail follows:
In Oracle, a stored procedure executes under the owners identity, not under the identity of the caller. Therefore I have knowed that many applications use packages to execute insert, update, select, delete statements instead of give user privileges directly on table. I'm creating a web application using php and Oracle, but I want to use this programing method, I would like to have some example to help me to understand, do you have one? This method is suitable on web applications?
attached mail follows:
hi..
a really general/basic question... what is the difference between a "cgi"
app and a php app.. does it really come down to where the app is being run
from..
i mean within apache, if i specify that php/perl/etc... app resides at a
given location, and that files with a certain extension are to be handled by
the perl/php/etc app, then i can handle the processing of the file by the
interpreter anywhere within my site that i grant access to. is there
anything/any reason to have a "cgi-bin" portion of my app, other than good
design practice...
clarification would be useful!!!
thanks..
-bruce
attached mail follows:
This is one of those questions that will get lot's of different answers
depending on your responders perspective. This is my view;
PHP can be executed as a CGI or as a MOD by Apache (or most web servers).
This means that Apache can load a fresh copy of PHP with each browser
request to the server (CGI), or it can load PHP on startup, or first request
(MOD) and can continue to use that version for each subsequent browser
request to the server (on .php files only, of course). Interestingly
enough, I believe Perl can be executed by Apache in either fashion as well.
Apache gets config parameters, when PHP is available, that tells it where to
find the PHP modules, and will load them from there in either case. The
server also has a "Base Directory" where it expects to find it's
html/php/perl/etc documents and will make sure the appropriate interpreter
is used based on the document file type. There was a time when the first
line of the script (beginning with a splash/bang; i.e. #!/usr/local/bin/perl
) determined the interpreter, and this may still be available in Apache. It
should still be possible to even write "C" programs and execute the compiled
binary as a "CGI", which means in this case no interpreter is required and
form input is read from stdin and html is sent to the browser via stdout (if
you are familiar with C). While C may produce the fastest code, you should
find PHP is much more suited for developing web applications than almost any
other option.
Just to add to the confusion, PHP can be executed from the command line of a
telnet session, or more commonly by a "cron" timer program, which I have
also heard referred to as running PHP as a "cgi". The syntax for that is;
/path/to/php /path/to/php/script.php
Hope this helps a bit,
Warren Vail
-----Original Message-----
From: bruce [mailto:bedouglas
earthlink.net]
Sent: Wednesday, July 14, 2004 10:36 AM
To: php-general
lists.php.net
Subject: [PHP] php .vs cgi app..
hi..
a really general/basic question... what is the difference between a "cgi"
app and a php app.. does it really come down to where the app is being run
from..
i mean within apache, if i specify that php/perl/etc... app resides at a
given location, and that files with a certain extension are to be handled by
the perl/php/etc app, then i can handle the processing of the file by the
interpreter anywhere within my site that i grant access to. is there
anything/any reason to have a "cgi-bin" portion of my app, other than good
design practice...
clarification would be useful!!!
thanks..
-bruce
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
As I know, if you run PHP as a module for Apache is faster than running
as CGI. Also Python scripts can be run as a module(faster) or as CGI. The
main disadvantage for Python as a module is that you don't get all the
facilities of CGI.
attached mail follows:
Hi All,
Is there a limit to the number of url parameters(other than the 256
limit) that you can have on a file that you are including?
I have a file that I'm calling..,
include('http://mydomain.com/block_display.php?id=1&ttl=1011&cnt=268&lnk
=129&prv=202');
where the parameter values are record sets.
What happens is that I get the first three params and then nothing.
Any ideas?
alex hogan
*************************************************************************************
The contents of this e-mail and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom it is addressed. The
views stated herein do not necessarily represent the view of the company. If you are
not the intended recipient of this e-mail you may not copy, forward, disclose, or
otherwise use it or any part of it in any form whatsoever. If you have received this
e-mail in error please e-mail the sender.
*************************************************************************************
attached mail follows:
Hi Alex,
I'm going on the assumption that since you're using a URL parameter
in the include, you have fopen_wrappers enabled, and the URL is
external to your current site. Otherwise you'd just be doing a file
system based include.
I'm not certain if PHP is clipping the parameters. Though I would
discourage this form of include for several reasons described below.
Depending on the intent of your application, you may be using the
wrong function.
What are you trying to do? Pull the code of a php script into your
script, or display the HTML output of a web page embedded in existing
content?
If you're trying to display the contents of another web page within
your own, you may want to look at readfile(), read(), fopen() or even
make a direct HTTP call to the server using sockets. Readfile() will
read and output the HTML generated by the called page. read() and
fopen() will get the output of that page and make it available to you
for your own processing. These may be more suited for such a call,
since you'll likely need to strip <HTML><HEAD...</HEAD><BODY> and
</BODY> tags out of the returned document (presuming your existing
document has already displayed these).
If you're trying to actually include the *script* code for execution
within your program, this is a really dangerous thing to do. It means
the called server gets to execute arbitrary code on your server. The
code might not be arbitrary since you control it- but if your DNS were
hacked, it means a clever hacker could actually insert a different
script.
Another point to consider- if you just want to display the HTML output
of the included page, don't use include. If the external site were
misconfigured, it may output raw php source rather than the interpreted
HTML page. If this happens, that code will be run on your server in
your current execution context. Again exposing you to arbitrary code
being run on your server.
Hope this helps,
James Harrell
http://celestia.cbstech.com
-----Original Message-----
From: Alex Hogan [mailto:Alex.Hogan
alliedelec.com]
Sent: Wednesday, July 14, 2004 1:47 PM
To: PHP General list
Subject: [PHP] Limitation to URL params on Include()?
Hi All,
Is there a limit to the number of url parameters(other than the 256
limit) that you can have on a file that you are including?
I have a file that I'm calling..,
include('http://mydomain.com/block_display.php?id=1&ttl=1011&cnt=268&lnk
=129&prv=202');
where the parameter values are record sets.
What happens is that I get the first three params and then nothing.
Any ideas?
alex hogan
****************************************************************************
*********
The contents of this e-mail and any files transmitted with it are
confidential and
intended solely for the use of the individual or entity to whom it is
addressed. The
views stated herein do not necessarily represent the view of the company. If
you are
not the intended recipient of this e-mail you may not copy, forward,
disclose, or
otherwise use it or any part of it in any form whatsoever. If you have
received this
e-mail in error please e-mail the sender.
****************************************************************************
*********
attached mail follows:
Thanks James,
> I'm going on the assumption that since you're using a URL
> parameter in the include, you have fopen_wrappers enabled,
Yes
> and the URL is external to your current site. Otherwise you'd
> just be doing a file system based include.
No, the url is on my site...
I have a file named block_content.php that is nothing more than a
display block with graphics for effect.
Instead of making several different display files I want to use a single
one and just assign a different value to the variables $header,
$content, $link.., and such. Then I can have as many of the content
blocks on the same page as necessary to display content summaries.
If I am headed in the wrong direction please let me know.
> What are you trying to do? Pull the code of a php script into
> your script, or display the HTML output of a web page
> embedded in existing content?
Display HTML output.
> If you're trying to display the contents of another web page
> within your own, you may want to look at readfile(), read(),
> fopen() or even make a direct HTTP call to the server using
> sockets. Readfile() will read and output the HTML generated
> by the called page. read() and
> fopen() will get the output of that page and make it
> available to you for your own processing.
OK...
alex hogan
*************************************************************************************
The contents of this e-mail and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom it is addressed. The
views stated herein do not necessarily represent the view of the company. If you are
not the intended recipient of this e-mail you may not copy, forward, disclose, or
otherwise use it or any part of it in any form whatsoever. If you have received this
e-mail in error please e-mail the sender.
*************************************************************************************
attached mail follows:
Hi Alex,
In that case, make your include file local; don't use the
URL, use a relative path to the file. Make the include
file have a function you can call or be an object you
can instantiate.
ex: block.php
<?php
function display_block($header,$content,$link,$andsuch)
{
// php code here to output HTML using echo... or
?>
... direct html output here ... and a
variable output such as <?php echo $header; ?> and
some more html, blah blah blah
<?php
} // end of display_block function
?>
Then in your main program do:
<?php
...
include_once("block.php");
...
...
display_block($header,$content,$link,$andsuch);
...
...
display_block($header2,$content2,$link2,$andsuch2);
...
...
?>
Or as an object:
...
$block=new Block($header,$content,$link,$andsuch);
$block->display();
...
Regards,
James Harrell
http://celestia.cbstech.com
attached mail follows:
[snip]
> ...
> $block=new Block($header,$content,$link,$andsuch);
> $block->display();
> ...
[/snip]
That's very cool...
Thank you...
alex hogan
*************************************************************************************
The contents of this e-mail and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom it is addressed. The
views stated herein do not necessarily represent the view of the company. If you are
not the intended recipient of this e-mail you may not copy, forward, disclose, or
otherwise use it or any part of it in any form whatsoever. If you have received this
e-mail in error please e-mail the sender.
*************************************************************************************
attached mail follows:
Hi to all,
I have problem with forms in IIS on WIN2K and PHP 5.0 (locally).
When I´m trying to send some data from HTML form to a PHP script I
received an error, that variables are not defined.
thank You
attached mail follows:
>"Luká¹ moravec - ptv servis" <moravec
ptv.netwave.cz> wrote in message
news:002501c469cd$cd198370$0301a2c6
lukas...
>Hi to all,
>I have problem with forms in IIS on WIN2K and PHP 5.0 (locally).
>When I´m trying to send some data from HTML form to a PHP script I
>received an error, that variables are not defined.
>thank You
You are not the first one experiencing this problem:
http://marc.theaimsgroup.com/?l=php-general&m8981108604272&w
There seems to be a general problem with PHP 5.0.0 and POST. Maybe someone
should file a bug...
Regards, Torsten Roehr
attached mail follows:
I am using a db class which has the following method for cycling through the
records
function nextRecord(){
$this->record=
mysql_fetch_array($this->queryID);
$status=is_array($this->Record);
return ($status);
}
where queryID is set by running the query. It works fine and I can run it
as follows
$sql->query("select * from clients");
while ($sql->nextRecord()){ echo $sql->getField("name");}
Problem is, I want to have the array shuffled so the rows are randomly
displayed each time the user hits the page. I have tried shuffle around the
mysql_fetch_array call and $this->queryID but nothing seems to work...any
ideas?
Thanks,
Eddie
WARNING: The information contained in this message and any attachments is
intended only for the use of the individual or entity to which it is
addressed. This message may contain information that is privileged,
confidential and exempt from disclosure under applicable law. It may also
contain trade secrets and other proprietary information for which you and
your employer may be held liable for disclosing. You are hereby notified
that any unauthorized dissemination, distribution or copying of this
communication is strictly prohibited. If you have received this
communication in error, please notify HIPAA
echoman.com by E-Mail and then
destroy this communication in a manner appropriate for privileged
information.
attached mail follows:
"Edward Peloke" <epeloke
echoman.com> wrote in message
news:NKEFLLFBJFIKEGAGKPCAGEECDIAA.epeloke
echoman.com...
> I am using a db class which has the following method for cycling through
the
> records
>
> function nextRecord(){
> $this->record=
mysql_fetch_array($this->queryID);
> $status=is_array($this->Record);
Hi Edward,
first you are using $this->record and then $this->Record (r / R)?
Have you tried adding this line?:
shuffle($this->record);
> return ($status);
> }
>
> where queryID is set by running the query. It works fine and I can run it
> as follows
>
> $sql->query("select * from clients");
> while ($sql->nextRecord()){ echo $sql->getField("name");}
>
> Problem is, I want to have the array shuffled so the rows are randomly
> displayed each time the user hits the page. I have tried shuffle around
the
>
mysql_fetch_array call and $this->queryID but nothing seems to work...any
> ideas?
>
> Thanks,
> Eddie
Regards, Torsten Roehr
attached mail follows:
yep, that causes nothing to be returned.
-----Original Message-----
From: Torsten Roehr [mailto:roehr
zilleon.com]
Sent: Wednesday, July 14, 2004 2:20 PM
To: php-general
lists.php.net
Subject: [PHP] Re: shuffle
"Edward Peloke" <epeloke
echoman.com> wrote in message
news:NKEFLLFBJFIKEGAGKPCAGEECDIAA.epeloke
echoman.com...
> I am using a db class which has the following method for cycling through
the
> records
>
> function nextRecord(){
> $this->record=
mysql_fetch_array($this->queryID);
> $status=is_array($this->Record);
Hi Edward,
first you are using $this->record and then $this->Record (r / R)?
Have you tried adding this line?:
shuffle($this->record);
> return ($status);
> }
>
> where queryID is set by running the query. It works fine and I can run it
> as follows
>
> $sql->query("select * from clients");
> while ($sql->nextRecord()){ echo $sql->getField("name");}
>
> Problem is, I want to have the array shuffled so the rows are randomly
> displayed each time the user hits the page. I have tried shuffle around
the
>
mysql_fetch_array call and $this->queryID but nothing seems to work...any
> ideas?
>
> Thanks,
> Eddie
Regards, Torsten Roehr
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
it is strange...
if I do this:
function nextRecord(){
$this->record=
mysql_fetch_array($this->queryID);
$test=$this->record;
echo $test;
$status=is_array($this->record);
return ($status);
}
"Array" is echoed for $test so I know it is an array but if I add this:
shuffle($test);
I get the warning that shuffle() expects parameter 1 to be an array, boolean
given.
-----Original Message-----
From: Edward Peloke [mailto:epeloke
echoman.com]
Sent: Wednesday, July 14, 2004 2:23 PM
To: Php-General
Subject: [PHP] shuffle
I am using a db class which has the following method for cycling through the
records
function nextRecord(){
$this->record=
mysql_fetch_array($this->queryID);
$status=is_array($this->Record);
return ($status);
}
where queryID is set by running the query. It works fine and I can run it
as follows
$sql->query("select * from clients");
while ($sql->nextRecord()){ echo $sql->getField("name");}
Problem is, I want to have the array shuffled so the rows are randomly
displayed each time the user hits the page. I have tried shuffle around the
mysql_fetch_array call and $this->queryID but nothing seems to work...any
ideas?
Thanks,
Eddie
WARNING: The information contained in this message and any attachments is
intended only for the use of the individual or entity to which it is
addressed. This message may contain information that is privileged,
confidential and exempt from disclosure under applicable law. It may also
contain trade secrets and other proprietary information for which you and
your employer may be held liable for disclosing. You are hereby notified
that any unauthorized dissemination, distribution or copying of this
communication is strictly prohibited. If you have received this
communication in error, please notify HIPAA
echoman.com by E-Mail and then
destroy this communication in a manner appropriate for privileged
information.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
"Edward Peloke" <epeloke
echoman.com> wrote in message
news:NKEFLLFBJFIKEGAGKPCAMEEIDIAA.epeloke
echoman.com...
> it is strange...
>
> if I do this:
>
> function nextRecord(){
> $this->record=
mysql_fetch_array($this->queryID);
> $test=$this->record;
> echo $test;
>
> $status=is_array($this->record);
> return ($status);
> }
>
> "Array" is echoed for $test so I know it is an array but if I add this:
>
> shuffle($test);
>
> I get the warning that shuffle() expects parameter 1 to be an array,
boolean
> given.
Have you tried shuffling in MySQL?:
SELECT * FROM table ORDER BY RAND()
Regards, Torsten
attached mail follows:
I didn't try that but it works great...thanks!
-----Original Message-----
From: Torsten Roehr [mailto:roehr
zilleon.com]
Sent: Wednesday, July 14, 2004 3:53 PM
To: php-general
lists.php.net
Subject: Re: [PHP] shuffle
"Edward Peloke" <epeloke
echoman.com> wrote in message
news:NKEFLLFBJFIKEGAGKPCAMEEIDIAA.epeloke
echoman.com...
> it is strange...
>
> if I do this:
>
> function nextRecord(){
> $this->record=
mysql_fetch_array($this->queryID);
> $test=$this->record;
> echo $test;
>
> $status=is_array($this->record);
> return ($status);
> }
>
> "Array" is echoed for $test so I know it is an array but if I add this:
>
> shuffle($test);
>
> I get the warning that shuffle() expects parameter 1 to be an array,
boolean
> given.
Have you tried shuffling in MySQL?:
SELECT * FROM table ORDER BY RAND()
Regards, Torsten
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
* Thus wrote Edward Peloke:
> it is strange...
>
> if I do this:
>
> function nextRecord(){
> $this->record=
mysql_fetch_array($this->queryID);
Don't use the
sign, it is bad practice.
> $test=$this->record;
> echo $test;
I'm not sure what this is for.
>
> $status=is_array($this->record);
> return ($status);
> }
>
> "Array" is echoed for $test so I know it is an array but if I add this:
>
> shuffle($test);
Where in the world did $test get set from?
if $test is expected to be the value of $this->record, then all
your going to be doing is shuffling the order of the columns.
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!
attached mail follows:
Does anyone know a way to programmatically determine if a given URL is
already in Google's index? I don't see anything like this in their
documentation. Thanks,
- Brian
attached mail follows:
brian...
there are a number of ways you can do this... you can easily write a
script/app in perl (i'm assuming that php provides something similar...)
that allows you to contact the google url, and submit your "target url" as a
query in the google submit. you can then easily parse the results to see if
you find your "target site" in the respone...
if you can't find what you want from php.net/etc... use perl.. check out the
"www::mechanize, html::treebuilder, etc.." from the cpan.org site...
-bruce
-----Original Message-----
From: Brian Dunning [mailto:brian
briandunning.com]
Sent: Wednesday, July 14, 2004 11:27 AM
To: php-general
lists.php.net
Subject: [PHP] Google question
Does anyone know a way to programmatically determine if a given URL is
already in Google's index? I don't see anything like this in their
documentation. Thanks,
- Brian
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
On Wed, 14 Jul 2004 11:27:09 -0700, Brian Dunning
<brian
briandunning.com> wrote:
> Does anyone know a way to programmatically determine if a given URL is
> already in Google's index? I don't see anything like this in their
> documentation. Thanks,
The Google API allows this sort of query.
http://www.google.com/apis/index.html
--
Greg Donald
http://destiney.com/
attached mail follows:
That's the documentation I was referring to. Are you sure? Like I said,
I didn't see anything like that in there.
On Jul 14, 2004, at 12:13 PM, Greg Donald wrote:
> On Wed, 14 Jul 2004 11:27:09 -0700, Brian Dunning
> <brian
briandunning.com> wrote:
>> Does anyone know a way to programmatically determine if a given URL is
>> already in Google's index? I don't see anything like this in their
>> documentation. Thanks,
>
>
> The Google API allows this sort of query.
>
> http://www.google.com/apis/index.html
>
>
> --
> Greg Donald
> http://destiney.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
- Brian
attached mail follows:
On Wed, 14 Jul 2004 12:30:30 -0700, Brian Dunning
<brian
briandunning.com> wrote:
> That's the documentation I was referring to. Are you sure? Like I said,
> I didn't see anything like that in there.
I found the docs in the API download iirc. It says "After you
download the kit, simply unzip it and open the file "README.txt" to
get started." on:
http://www.google.com/apis/download.html
Plus you can search the web for free sample PHP scripts people made
for use with the Google API.
--
Greg Donald
http://destiney.com/
attached mail follows:
Hello,
On 07/14/2004 03:27 PM, Brian Dunning wrote:
> Does anyone know a way to programmatically determine if a given URL is
> already in Google's index? I don't see anything like this in their
> documentation. Thanks,
You can search for info:http://www.somedomain.com/somepage.html .
To do it programattically you can use the Web services API. If you are
using PHP 5 already, you can use this class that queries Google in a few
lines using the SOAP extension:
Class: Google Client
http://www.phpclasses.org/googleclient
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
attached mail follows:
Brian Dunning wrote:
> That's the documentation I was referring to. Are you sure? Like I
> said, I didn't see anything like that in there.
using programs that do not use the google API to query google is against
their terms of service.
>>
>>
>> The Google API allows this sort of query.
>>
>> http://www.google.com/apis/index.html
>>
>
--
Raditha Dissanayake.
---------------------------------------------
http://www.raditha.com/megaupload/upload.php
Sneak past the PHP file upload limits.
attached mail follows:
I have installed PHP5 and i get the following error from a script that was
working on PHP4
"Fatal error: Call to undefined function mysql_pconnect() in
D:\htdocs\cdalex\Connections\listacon.php on line 9 "
attached mail follows:
Ciprian Constantinescu wrote:
> I have installed PHP5 and i get the following error from a script that was
> working on PHP4
> "Fatal error: Call to undefined function mysql_pconnect() in
> D:\htdocs\cdalex\Connections\listacon.php on line 9 "
MySQL is no longer embedded in PHP, as of PHP 5. Depending on your
platform, you will either need to build PHP 5 with support for MySQL, or
you will need to modify php.ini to load in the MySQL extension.
--
Regards,
Ben Ramsey
http://benramsey.com
---------------------------------------------------
http://www.phpcommunity.org/
Open Source, Open Community
Visit for more information or to join the movement.
---------------------------------------------------
attached mail follows:
> The problem is that this HTTPS variable is not a standard variable
> that has been defined.
>
> Apache's SSL module will only set *a* value to HTTPS if in https is
> being used. The value it sets just so happens to be 'on'
>
> Windows servers (versions unkown) will set 'on' or 'off.
>
> Other servers will use either 'on' or 'ON', with or without
> corresponding 'off' or 'OFF'.
Thanks for the explanation! I understand now why it works on windows and not
linux and to the comment of "Who cares what happens on a Windows box?" I do.
This script needs to be cross platform usuable. Its no good using code that
defects on different operating system. Now someones explained i can work
arround it.
Jamie
attached mail follows:
I just edit php.ini and increase it to 200
its not work any suggestion
does apache effect ? cuz its Usage memory limitid to 98M
----- Original Message -----
From: "Alawi albaity" <php4web
php4web.org>
To: <jabber
raditha.com>
Sent: Wednesday, July 14, 2004 8:55 PM
Subject: Re: [PHP] PHP JAVA Error on linux
> I try this its also not work
> <?
> ini_set("memory_limit","80M");
> echo '<pre>';
>
> // Outputs all the result of shellcommand "ls", and returns
> // the last output line into $last_line. Stores the return value
> // of the shell command in $retval.
>
> $last_line = system('/usr/java/j2sdk1.4.2_05/bin/java -cp
> /home/hrrajco/public_html/test/lib/itext.jar com.lowagie.tools.encrypt_pdf
> /home/hrrajco/public_html/test/test.pdf
> /home/hrrajco/public_html/test/encrypted.pdf user master 00000000 128',
> $retval);
>
> // Printing additional info
> echo '
> </pre>
> <hr>Last line of the output: '.$last_line.'
> <hr>Return value: '.$retval;
> ?>
>
> ----- Original Message -----
> From: "raditha dissanayake" <jabber
raditha.com>
> Cc: "php-general" <php-general
lists.php.net>
> Sent: Wednesday, July 14, 2004 6:19 PM
> Subject: Re: [PHP] PHP JAVA Error on linux
>
>
> >
> > Alawi albaity wrote:
> >
> > >Java 2 SDK 1.4.2
> > >
> > >PHP 4.3.3
> > >
> > >linux fedora 1
> > >
> > >the command is work fine from terminal
> > >
> > >but its not work fine from php & give me this msg when I use exec
system
> passthru :
> > >
> > >Error occurred during initialization of VM Could not reserve enough
space
> for object heap
> > >
> > >
> > What exactly are you refering to? are you trying to use the PHP Java
> > extension or are you trying to execute an 'external java program'? if
> > it's the latter you will need to increase the memory limit (default
> > would be 8MB - not enough to start the JVM). If it's the former
> > http://www.raditha.com/php/java.php might help.
> >
> >
> >
> >
> > >
> > >
> > >
> > >
> >
> >
> > --
> > Raditha Dissanayake.
> > ---------------------------------------------
> > http://www.raditha.com/megaupload/upload.php
> > Sneak past the PHP file upload limits.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
>
attached mail follows:
I also try by php cli is just work fine and tht by terminal
but when I try from net its not work please give me a hand
this command work fine from terminal
php -f /home/hrrajco/public_html/test/test.php
but from php file named test2.php is not work fine
<?
passthru("php -f /home/hrrajco/public_html/test/test.php");
?>
Please give me a hand
----- Original Message -----
From: "Alawi albaity" <php4web
php4web.org>
To: "php-general" <php-general
lists.php.net>
Sent: Wednesday, July 14, 2004 10:04 PM
Subject: Re: [PHP] PHP JAVA Error on linux
> I just edit php.ini and increase it to 200
> its not work any suggestion
> does apache effect ? cuz its Usage memory limitid to 98M
>
> ----- Original Message -----
> From: "Alawi albaity" <php4web
php4web.org>
> To: <jabber
raditha.com>
> Sent: Wednesday, July 14, 2004 8:55 PM
> Subject: Re: [PHP] PHP JAVA Error on linux
>
>
> > I try this its also not work
> > <?
> > ini_set("memory_limit","80M");
> > echo '<pre>';
> >
> > // Outputs all the result of shellcommand "ls", and returns
> > // the last output line into $last_line. Stores the return value
> > // of the shell command in $retval.
> >
> > $last_line = system('/usr/java/j2sdk1.4.2_05/bin/java -cp
> > /home/hrrajco/public_html/test/lib/itext.jar
com.lowagie.tools.encrypt_pdf
> > /home/hrrajco/public_html/test/test.pdf
> > /home/hrrajco/public_html/test/encrypted.pdf user master 00000000 128',
> > $retval);
> >
> > // Printing additional info
> > echo '
> > </pre>
> > <hr>Last line of the output: '.$last_line.'
> > <hr>Return value: '.$retval;
> > ?>
> >
> > ----- Original Message -----
> > From: "raditha dissanayake" <jabber
raditha.com>
> > Cc: "php-general" <php-general
lists.php.net>
> > Sent: Wednesday, July 14, 2004 6:19 PM
> > Subject: Re: [PHP] PHP JAVA Error on linux
> >
> >
> > >
> > > Alawi albaity wrote:
> > >
> > > >Java 2 SDK 1.4.2
> > > >
> > > >PHP 4.3.3
> > > >
> > > >linux fedora 1
> > > >
> > > >the command is work fine from terminal
> > > >
> > > >but its not work fine from php & give me this msg when I use exec
> system
> > passthru :
> > > >
> > > >Error occurred during initialization of VM Could not reserve enough
> space
> > for object heap
> > > >
> > > >
> > > What exactly are you refering to? are you trying to use the PHP Java
> > > extension or are you trying to execute an 'external java program'? if
> > > it's the latter you will need to increase the memory limit (default
> > > would be 8MB - not enough to start the JVM). If it's the former
> > > http://www.raditha.com/php/java.php might help.
> > >
> > >
> > >
> > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > Raditha Dissanayake.
> > > ---------------------------------------------
> > > http://www.raditha.com/megaupload/upload.php
> > > Sneak past the PHP file upload limits.
> > >
> > > --
> > > 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:
On Mon, 12 Jul 2004 14:54:15 -0400 epeloke
echoman.com (Edward Peloke) wrote:
> Is this the only way around it? Can I get to mssql without using the mssql
> extension?
I don't think so. Plus, the entire setup is a bit complicated and you need
FreeTDS as well as UnixODBC installed, plus some /etc configuration "magic".
FWIW, I have an article on the subject. It's in Romanian, but the commands,
configuration files and testing PHP code are clearly marked and are of course
universal, so perhaps you can make do with just some copy&paste.
See here:
http://rowd.zuavra.net/articole/11/p2/
P.S.: If anyone wishes to put an English version on their site please contact
me in private. I'll take the time to translate it. I haven't put the English
version on the Web myself since my site is meant to be in Romanian only.
--
Skippy - Romanian Web Developers - http://ROWD.ORG
attached mail follows:
Skippy wrote:
>> Is this the only way around it? Can I get to mssql without using
>> the mssql extension?
>
> I don't think so. Plus, the entire setup is a bit complicated and you
> need FreeTDS as well as UnixODBC installed, plus some /etc
> configuration "magic".
Why is UnixODBC necessary? I've been using PHP and FreeTDS to connect to a MS SQL 7
server for the past 2+ years and I've never touched UnixODBC. Is there something
I'm missing by not using UnixODBC as well?
attached mail follows:
Can anyone point me to a good article about site planning before coding.
I searched the net but couldn't find a good one?
attached mail follows:
>><?php
>>
>> // here is the date. We wont worry about the time.
>> $processdate = "07/04/2004 14:45";
> What about different formats like 07-04-2004 14:45:00
...You have a good point, Curt. We could modify the code just a little
bit for the same then. Instead of exploding with "/", we may opt for "-"
explosion. Typically, I have observed users using one specific format
for their entire application. A simple change in the function can make
the function suit their requirements.
>> // calling the function.
>> // 1 means the date is in a daylight savings time
>> // 0 means the date is not in a daylight savings time
>
>
> one thing to note, not all zones, even in the US honor the
> DST. this is a rather sepecific function.
...I believe Indiana and Arizona do not honor daylight savings time.
They switch back and forth from EST to CST (Indiana) and MST to PST
(Arizona) if I am not mistaken. If it is not applicable to a particular
user(s), they should not use this function. This function could be
useful for only those who intend to use it.
>
>> echo daylight($processdate);
>>
>> // now the function
>>
>>function daylight($mydate)
>>{
>> // separating the date and time
>> $datetime = explode(" ",$mydate);
>>
>> // exploding the components of date
>> $dateexplode = explode("/",$datetime[0]);
>
>
> Instead of exploding stuff around, make your date argument compatible
> with the strtotime() function, it will return a unix timestamp or
> -1 if it fails to parse the date.
...Good point. I should write something with strtotime(). Thank you.
>
>
>
>> // if the date is between Jan-Mar, NO DAYLIGHT
>> // if the date is between Nov-Dec, NO DAYLIGHT
>> if ($dateexplode[0]<4 or $dateexplode[0]>10)
>> {
>> return 0;
>> }
>> // if the date is not in the above zone, lets see
>> // if the date is between May-Sep, DAYLIGHT
>> elseif ($dateexplode[0]>4 and $dateexplode[0]<10)
>> {
>> return 1;
>> }
>
>
> Since you have a timestamp as I suggested above, you simply need
> to pull the month out, and then check the month value:
...I used the above method to indicate to users what is going on. I did
not use switch :: case because I did not want a month-to-month checking.
I wanted to check and process for only months 4 through 10 and for only
those dates in month 4 & 10 that made a difference between CST and CDT
(or any time zone change, in that case).
> $month = strftime('%m', $utimestamp);
>
> swtich ($month) {
> case '01': case '02': ...
> return 0;
> case '05': case '06': ...
> return 1;
>
> }
>
>
>
>> else
>> {
>> // we are going to pull out what date is a sunday
>> // then we compare our date's day-of-month with the
>> day-that-is-sunday
>>
>> $interestday = 0;
>>
>> // lets see what happens in april - first sunday of the month
>> if ($dateexplode[0]==4)
>> {
>> // looping the first seven days to see what day is a
>> sunday
>> for ($i=1; $i<=7; $i++)
>> {
>> $myday =
>> date("w",mktime(0,0,0,$dateexplode[0],$i,$dateexplode[2]));
>> if ($myday==0)
>> $interestday = $i;
>> }
>>
>> // now that we got what day is a sunday, lets see
>> // if our date's day-of-month is greater than this
>> or not
>> // if it is greater, then DAYLIGHT
>> if ($dateexplode[1]>=$interestday)
>> return 1;
>> else
>> return 0;
>> }
>>
>> // lets see what happens in october - last sunday of the
>> month
>> elseif ($dateexplode[0]==10)
>> {
>> // looping the first seven days to see what day is a
>> sunday
>> for ($i=25; $i<=31; $i++)
>> {
>> $myday =
>> date("w",mktime(0,0,0,$dateexplode[0],$i,$dateexplode[2]));
>> if ($myday==0)
>> $interestday = $i;
>> }
>>
>> // now that we got what day is a sunday, lets see
>> // if our date's day-of-month is greater than this
>> or not
>> // if it is less, then DAYLIGHT
>> if ($dateexplode[1]<=$interestday)
>> return 1;
>> else
>> return 0;
>> }
>> }
>
>
> now instead of doing all that mundane work, we simply have to
> find out if the days are outabounds for the paticular months.
...Your code looks neater. Thank you.
> // obtain the day of month
> $dayofmonth = (int)strftime('%d', $utimestamp);
>
> // and the day of week
> $dayofweek = strftime('%u', $utimestamp);
>
> if ($month == '04') {
>
> // If its the first week of 04
> if ($dayofmonth <= 7) {
>
> // and we havn't reached sunday, return 0
> return ($dayofweek < 7) ? 0: 1;
>
> }
> return 1; // otherwise we're passed it.
>
> } elseif ($month == '10') {
>
> // look at the last week october
> if ($dayofmonth >= 24) {
>
> // see if we're still in the zone.
> return ($dayofweek < 7) ? 1: 0;
> }
> return 1;
>
> }
>
> // something went wrong.
> return -2;
>
>
>
>>}
>
>
>
> Curt
...Thanks for your comments, Curt. Whenever I write a better code, I
will post it here.
Chirag Shukla.
attached mail follows:
Is there an ini-file setting so that objects are
passed by value as in PHP 4? If so, how long is this
likely to be supported?
Thanks,
Troy
attached mail follows:
Troy S wrote:
> Is there an ini-file setting so that objects are
> passed by value as in PHP 4? If so, how long is this
> likely to be supported?
I believe this is possible with the following setting in php.ini:
zend.ze1_compatibility_mode = On
This should turn on PHP5's backwards compatibility with PHP4 (meaning
that the objects are passed by value instead of by reference... the old
way).
--
Regards,
Ben Ramsey
http://benramsey.com
---------------------------------------------------
http://www.phpcommunity.org/
Open Source, Open Community
Visit for more information or to join the movement.
---------------------------------------------------
attached mail follows:
I have php code that takes text input from a webpage and and stores it in a mysql data base.
I tried uploading small images (jpg) using basically the same syntax but they don't make it into the data base.
Does anyone know of a simple tutorial that shows how to do this?
attached mail follows:
Five wrote:
> I have php code that takes text input from a webpage and and stores it in a mysql data base.
> I tried uploading small images (jpg) using basically the same syntax but they don't make it into the data base.
> Does anyone know of a simple tutorial that shows how to do this?
although I'm against storing files in databases...
$file =
mysql_real_escape_string(file_get_contents($_FILES['yourfile']['tmp_name']));
$query = "INSERT INTO yourtable (imgdata) VALUES ('$file')";
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
attached mail follows:
To protect certain web pages on my site, I am using the following code
inserted at the very beginning (top) of the page:
<?php
include_once( 'init.php');
if( isset( $HTTP_SESSION_VARS['session_id'] ) == FALSE ||
isset( $HTTP_SESSION_VARS['username'] ) == FALSE ){
header( 'Location: '.MEMBER_LOGIN_PAGE );
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
... Dreamweaver template code here...
</html>
Is this a recommended way of doing this?
Next, to initialize the session, a login page posts the username - password
information to a PHP script, check_login.php. The login info is checked
against a database and, if all is kosher, a new session is created and the
user is dispatched to the site's home page. Here's the relevant code:
<?php
include_once( 'init.php');
...
$username = trim($HTTP_POST_VARS['username']);
$password = trim($HTTP_POST_VARS['password']);
... if username and password check out, initialize a session...
$HTTP_SESSION_VARS['username'] = $username;
$HTTP_SESSION_VARS['session_id'] = crypt( $password );
header( 'Location: '.SITE_HOME_PAGE );
...
?>
Does this make sense? Am I missing something? Any review, advice, etc.,
would be much appreciated.
Cheers,
Michael
attached mail follows:
Just a quick comment. It's recommended to use $_SESSION instead of
$HTTP_SESSION_VARS, $_POST instead of $HTTP_POST_VARS, etc. Look at
the docs about superglobals for more.
On Wed, 14 Jul 2004 16:18:14 -0700, Michael T. Peterson
<mtp1032
comcast.net> wrote:
> To protect certain web pages on my site, I am using the following code
> inserted at the very beginning (top) of the page:
>
> <?php
> include_once( 'init.php');
> if( isset( $HTTP_SESSION_VARS['session_id'] ) == FALSE ||
> isset( $HTTP_SESSION_VARS['username'] ) == FALSE ){
> header( 'Location: '.MEMBER_LOGIN_PAGE );
> }
> ?>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> ... Dreamweaver template code here...
> </html>
>
> Is this a recommended way of doing this?
>
> Next, to initialize the session, a login page posts the username - password
> information to a PHP script, check_login.php. The login info is checked
> against a database and, if all is kosher, a new session is created and the
> user is dispatched to the site's home page. Here's the relevant code:
>
> <?php
> include_once( 'init.php');
> ...
> $username = trim($HTTP_POST_VARS['username']);
> $password = trim($HTTP_POST_VARS['password']);
>
> ... if username and password check out, initialize a session...
>
> $HTTP_SESSION_VARS['username'] = $username;
> $HTTP_SESSION_VARS['session_id'] = crypt( $password );
>
> header( 'Location: '.SITE_HOME_PAGE );
> ...
> ?>
>
> Does this make sense? Am I missing something? Any review, advice, etc.,
> would be much appreciated.
>
> Cheers,
>
> Michael
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> !DSPAM:40f5bd3942909266016200!
>
>
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--
attached mail follows:
Hello,
On 07/14/2004 07:24 AM, I.A. Gray wrote:
> Is there are a simple way of checking quickly using PHP:
>
> 1) How many email messages on a POP3 mailbox
> 2) How many new email messages on a POP3 mailbox
> 3) The amount of memory in Kb or Mb used up on the POP3 mail box
>
> I want to be able to show these on our customer control panel. Also I want
> to use cron and a php script to be able to regularly check our customers
> haven't exceeded their mail quota. At the moment we don't have our own
> server and use a multiweb hosting account.
You may want to try this POP 3 class that comes with an examples that
demonstrates exactly how to do that:
http://www.phpclasses.org/pop3class
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
attached mail follows:
Hi all,
I'm trying to locate an up to date list (at least sometime in 2004), that
lists major companies (i.e. like Yahoo) that utilize PHP for their website
(or at least part of their website). I've google'd and searched php.net to
no success.
Thanks,
Gary
attached mail follows:
--- "Theisen, Gary" <gary.theisen
eds.com> wrote:
> I'm trying to locate an up to date list (at least sometime in 2004),
> that lists major companies (i.e. like Yahoo) that utilize PHP for their
> website (or at least part of their website). I've google'd and searched
> php.net to no success.
I'm not entirely sure how up to date this list is, but it seems more
thorough than most:
http://www.dreamlab.ca/technology/phpsites/
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly
Coming Fall 2004
HTTP Developer's Handbook - Sams
http://httphandbook.org/
PHP Community Site
http://phpcommunity.org/
attached mail follows:
Just what I was looking for...thanks Chris!
-----Original Message-----
From: Chris Shiflett [mailto:shiflett
php.net]
Sent: Wednesday, July 14, 2004 5:28 PM
To: Theisen, Gary; 'php-general
lists.php.net'
Subject: Re: [PHP] Companies using PHP
--- "Theisen, Gary" <gary.theisen
eds.com> wrote:
> I'm trying to locate an up to date list (at least sometime in 2004),
> that lists major companies (i.e. like Yahoo) that utilize PHP for
> their website (or at least part of their website). I've google'd and
> searched php.net to no success.
I'm not entirely sure how up to date this list is, but it seems more
thorough than most:
http://www.dreamlab.ca/technology/phpsites/
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly
Coming Fall 2004
HTTP Developer's Handbook - Sams
http://httphandbook.org/
PHP Community Site
http://phpcommunity.org/
attached mail follows:
Am I the only one experiencing this:
Fatal error: Class 'SoapClient' not found
checking the output of phpinfo() for the 5.0.0 binary from www.php.net, it
would seem there is no soap support built in at all.
Or have I just not woken up today?
attached mail follows:
Is anyone taking a dynamic PHP / MySQL site and storing or cacheing it
statically in order for pages to display more quickly when visitors access
the site? If so, what solutions are you using to achieve this?
Thanks,
Ed
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]