php-general Digest 28 Oct 2006 22:12:24 -0000 Issue 4427
Topics (messages 243787 through 243806):
Re: Shopping Cart
243787 by: chris smith
243788 by: CK
243791 by: Stut
243792 by: CK
243793 by: Greg Maruszeczka
243795 by: Ed Lazor
Re: heredoc usage [WAS: <OPTION]
243789 by: Nisse Engström
243790 by: Nisse Engström
243794 by: Paul Novitski
Uploading files.
243796 by: João Cândido de Souza Neto
243798 by: Ed Lazor
Re: PHP Sessions || Problems with AOL, Safari, etc.
243797 by: sit1way
243799 by: Ed Lazor
A general UL script
243800 by: Børge Holen
243801 by: M.Sokolewicz
243802 by: Børge Holen
243803 by: Børge Holen
243805 by: Ed Lazor
243806 by: Børge Holen
Query question
243804 by: Beauford
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
I don't appreciate being scolded.
Spend some time on the list and see how many times this question (or
type of question) gets asked and how many people actually do *some*
sort of work for themselves and you'll appreciate why people ask this
straight away.
If you had said "I found product X & Y but they don't fit what I need"
then we at least know you've made an effort to do a little research
for yourself.
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---
--- Begin Message ---
Hi,
I'm new to the list, and PHP. My assumption was others who have asked
similar questions, would have, like myself, done research. So I
thought no need to clarify. I'm aware these list are not a "do my
homework" solution. However, having received a verbally abusive
retort, when education was desired; I'll seek counsel elsewhere.
Good Day,
CK
On Oct 28, 2006, at 6:13 AM, chris smith wrote:
I don't appreciate being scolded.
Spend some time on the list and see how many times this question (or
type of question) gets asked and how many people actually do *some*
sort of work for themselves and you'll appreciate why people ask this
straight away.
If you had said "I found product X & Y but they don't fit what I need"
then we at least know you've made an effort to do a little research
for yourself.
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
CK wrote:
I'm new to the list, and PHP. My assumption was others who have asked
similar questions, would have, like myself, done research. So I thought
no need to clarify. I'm aware these list are not a "do my homework"
solution. However, having received a verbally abusive retort, when
education was desired; I'll seek counsel elsewhere.
Ok, a couple of things need saying here.
1) Stating "I've done this and that already but nothing helped" is not
only about letting us know you've not already done some research. It's
also about telling us what you've already done so we don't waste our
time telling you what you already know.
2) We don't owe you anything. If you decide to go elsewhere for help
don't expect us to feel guilty or upset or anything but mildly amused. I
would point out that you're unlikely to find a better source of help
than the 'official' PHP lists, but I really don't care enough about
where you go for help.
-Stut
--- End Message ---
--- Begin Message ---
On Oct 28, 2006, at 8:52 AM, Stut wrote:
CK wrote:
I'm new to the list, and PHP. My assumption was others who have
asked similar questions, would have, like myself, done research.
So I thought no need to clarify. I'm aware these list are not a
"do my homework" solution. However, having received a verbally
abusive retort, when education was desired; I'll seek counsel
elsewhere.
Ok, a couple of things need saying here.
1) Stating "I've done this and that already but nothing helped" is
not only about letting us know you've not already done some
research. It's also about telling us what you've already done so we
don't waste our time telling you what you already know.
Be specific in stating what prior research has been done so that we
may help, if possible. Point noted.
2) We don't owe you anything. If you decide to go elsewhere for
help don't expect us to feel guilty or upset or anything but mildly
amused. I would point out that you're unlikely to find a better
source of help than the 'official' PHP lists, but I really don't
care enough about where you go for help.
My statement was meant as some behavioral/emotional modification, or
an attempt at soliciting pity. So my lack of compassion is mutually
returned.
-Stut
--- End Message ---
--- Begin Message ---
CK,
With the obligatory chastisement and ensuing defensiveness out of the
way :) you may want to check out Zen Cart (zen-cart.com) and see if it
meets your requirements.
Cheers,
G
--- End Message ---
--- Begin Message ---
Be specific in stating what prior research has been done so that we
may help, if possible. Point noted.
Helping out further, you'll find that this rule applies to almost all
mailing lists.
2) We don't owe you anything. If you decide to go elsewhere for
help don't expect us to feel guilty or upset or anything but
mildly amused. I would point out that you're unlikely to find a
better source of help than the 'official' PHP lists, but I really
don't care enough about where you go for help.
My statement was meant as some behavioral/emotional modification,
or an attempt at soliciting pity. So my lack of compassion is
mutually returned.
Helping out even further with another general rule of etiquette on
mailing lists, keep it cool and filter the crap. For example, Chris'
initial reply came across as offensive and you could have surprised
him by filtering his attitude, focusing on the real issue, and
responding with information about what you have researched up to this
point. Speaking of which, I think that's where this thread is. Have
you researched any of the options that come up from Googling "php
shopping cart"? Which options have you dismissed and why?
-Ed
--- End Message ---
--- Begin Message ---
On Thu, 26 Oct 2006 13:10:17 -0400, Robert Cummings wrote:
> On Thu, 2006-10-26 at 11:43 +0200, clive wrote:
>> or you could write it likes this '
>> echo "<option value='$day' $selected > $day </option>";
>>
>> much easier to read, but slightly more taxing on the server.
>
> Also slightly more taxing on standards since single quotes are bad :)
As far as I can tell, single and double quotes
are interchangeable (but unmixable) in both HTML
and XHTML. When did single quotes go bad?
--nfe
--- End Message ---
--- Begin Message ---
On Thu, 26 Oct 2006 01:04:25 -0700, Paul Novitski wrote:
> It's so interesting that some details bug some people and others bug
> others. In an expression such as this:
>
> echo '<option value="' . $day . '"' . $selected . '>' . $day
> . '</option>';
>
> ...I count eight transitions (instances of switching between PHP
> syntax and output text) -- one each time you open or close a quote --
> compared to just two transitions (the opening & closing labels) for
> the comparable heredoc statement:
>
> print <<< hdDay
> <option value="$day"$sSelected>$day</option>
>
> hdDay;
>
That's funny. I count eight transitions in both
examples. The difference in the second example is
that the transition switches have changed from
open/closing quote to '$'/not-a-variable-character.
--nfe
--- End Message ---
--- Begin Message ---
On Thu, 26 Oct 2006 01:04:25 -0700, Paul Novitski wrote:
> It's so interesting that some details bug some people and others bug
> others. In an expression such as this:
>
> echo '<option value="' . $day . '"' . $selected . '>' . $day
> . '</option>';
>
> ...I count eight transitions (instances of switching between PHP
> syntax and output text) -- one each time you open or close a quote --
> compared to just two transitions (the opening & closing labels) for
> the comparable heredoc statement:
>
> print <<< hdDay
> <option value="$day"$sSelected>$day</option>
>
> hdDay;
At 10/28/2006 04:28 AM, Nisse Engström wrote:
That's funny. I count eight transitions in both
examples. The difference in the second example is
that the transition switches have changed from
open/closing quote to '$'/not-a-variable-character.
Yes, from the point of view of the PHP parser, a
transition is made each time you encounter an
embedded variable requiring evaluation and each
time you return to the quoted expression that
doesn't require that same kind of evaluation.
What I was referring to were transitions of PHP
syntactical punctuation that fragment the
expression from the human point of view. I
personally find the heredoc expression much
easier to read, proofread, and maintain because
it appears to be all one simple, unbroken expression.
Regards,
Paul
--- End Message ---
--- Begin Message ---
Hi everyone.
I´m in a big doubt about uploading files ins a safe way.
I wont give permission for the web server user to write in some folder of my
system and then use move_uploaded_file function in order to keep it secure.
I was using ftp functions to do it but a get a new trouble, in some servers
my ftp user has no permission to read in the upload temp folder of php.
I am determined to access by ftp funcions, give permission to web server
user, put the file by move_uploaded_file and take the permission previously
gave. I do not test but i think it will works.
Someone has another tip to do it without loss security?
Thanks in advance.
--- End Message ---
--- Begin Message ---
Side note on the PHP FTP... I'm sure there are PHP FTP classes out
there for you to use... google "php ftp class" and you'll see a few
options to explore.
On Oct 28, 2006, at 10:47 AM, João Cândido de Souza Neto wrote:
Hi everyone.
I´m in a big doubt about uploading files ins a safe way.
I wont give permission for the web server user to write in some
folder of my
system and then use move_uploaded_file function in order to keep it
secure.
I was using ftp functions to do it but a get a new trouble, in some
servers
my ftp user has no permission to read in the upload temp folder of
php.
I am determined to access by ftp funcions, give permission to web
server
user, put the file by move_uploaded_file and take the permission
previously
gave. I do not test but i think it will works.
Someone has another tip to do it without loss security?
Thanks in advance.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hey all.
I run a members-only hockey report that relies on Session variable(s) to
grant/deny access to members-only site content.
Generally members have no trouble accessing members-only content once
logged-in to the site; however, since we have a few thousand members, I
frequently receive tech support requests along the lines of "My login
doesn't work, I keep getting returned to the login screen". Invariably it's
McAffee anti-virus, or other anti-virus program running on the user's
computer that disables session cookies, or the user disabled session cookies
in attempts to make their browser more secure.
Is there a way to get around this problem? Not being able to set Session
variable(s) is a major annoyance; one that I'd like to resolve if possible.
Suggestions welcome...
Thanks,
--Noah
--- End Message ---
--- Begin Message ---
Check php.ini session settings. There are some options in there for
you to use in your scripts. Set up scripts to test whether session
cookies are being saved and then route accordingly.
On Oct 28, 2006, at 12:41 PM, sit1way wrote:
Hey all.
I run a members-only hockey report that relies on Session variable
(s) to
grant/deny access to members-only site content.
Generally members have no trouble accessing members-only content once
logged-in to the site; however, since we have a few thousand
members, I
frequently receive tech support requests along the lines of "My login
doesn't work, I keep getting returned to the login screen".
Invariably it's
McAffee anti-virus, or other anti-virus program running on the user's
computer that disables session cookies, or the user disabled
session cookies
in attempts to make their browser more secure.
Is there a way to get around this problem? Not being able to set
Session
variable(s) is a major annoyance; one that I'd like to resolve if
possible.
Suggestions welcome...
Thanks,
--Noah
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
When I use a normal single file upload form; both of these statements will
continue wether my form is empty or not, why?
if(!empty($_FILES)){
do som checking if its a jpg.
if not exit;
if(isset($_FILES)){
--
---
Børge
Kennel Arivene
http://www.arivene.net
---
--- End Message ---
--- Begin Message ---
Børge Holen wrote:
When I use a normal single file upload form; both of these statements will
continue wether my form is empty or not, why?
if(!empty($_FILES)){
do som checking if its a jpg.
if not exit;
if(isset($_FILES)){
because it IS set and NOT empty.
$_FILES['file_upload_field'] is set, it's got no data, but it IS set.
$_FILES is set because $_FILES['file_upload_field'] exists.
Submitting a blank form sends all "variables" though without actual
(non-default) content.
- tul
--- End Message ---
--- Begin Message ---
Ok. got that thanks.
But that leaves me a bit off to how to tell the script to leave it alone.
Is it possible to check it
or maby even better. Posible to not add an empty field in the submit.
The multifile submit I actually intended this script for, always send the
first field empty so later on I slice the array to cut out the first'n empty
field.
Witch ALSO would be very helpful, since I right this minute seems to
believe/found out that Safari actually seems to send the field in the
opposite order of Firefox??? Maby there is something else, but the script
stops when I check the array for actual images.
On Saturday 28 October 2006 23:33, M.Sokolewicz wrote:
> Børge Holen wrote:
> > When I use a normal single file upload form; both of these statements
> > will continue wether my form is empty or not, why?
> >
> > if(!empty($_FILES)){
> > do som checking if its a jpg.
> > if not exit;
> >
> > if(isset($_FILES)){
>
> because it IS set and NOT empty.
> $_FILES['file_upload_field'] is set, it's got no data, but it IS set.
> $_FILES is set because $_FILES['file_upload_field'] exists.
> Submitting a blank form sends all "variables" though without actual
> (non-default) content.
>
> - tul
--
---
Børge
Kennel Arivene
http://www.arivene.net
---
--- End Message ---
--- Begin Message ---
This could also be omitted with the help of NOT use
echo irritating reason
exit
Witch would leave the script running to BREAK on switch out of it all =D
YES. Not an elegant solution... but beats whatever I'm doing right now.
On Saturday 28 October 2006 23:46, Børge Holen wrote:
> Ok. got that thanks.
> But that leaves me a bit off to how to tell the script to leave it alone.
> Is it possible to check it
>
> or maby even better. Posible to not add an empty field in the submit.
> The multifile submit I actually intended this script for, always send the
> first field empty so later on I slice the array to cut out the first'n
> empty field.
>
> Witch ALSO would be very helpful, since I right this minute seems to
> believe/found out that Safari actually seems to send the field in the
> opposite order of Firefox??? Maby there is something else, but the script
> stops when I check the array for actual images.
>
> On Saturday 28 October 2006 23:33, M.Sokolewicz wrote:
> > Børge Holen wrote:
> > > When I use a normal single file upload form; both of these statements
> > > will continue wether my form is empty or not, why?
> > >
> > > if(!empty($_FILES)){
> > > do som checking if its a jpg.
> > > if not exit;
> > >
> > > if(isset($_FILES)){
> >
> > because it IS set and NOT empty.
> > $_FILES['file_upload_field'] is set, it's got no data, but it IS set.
> > $_FILES is set because $_FILES['file_upload_field'] exists.
> > Submitting a blank form sends all "variables" though without actual
> > (non-default) content.
> >
> > - tul
>
> --
> ---
> Børge
> Kennel Arivene
> http://www.arivene.net
> ---
--
---
Børge
Kennel Arivene
http://www.arivene.net
---
--- End Message ---
--- Begin Message ---
Are you just trying to tell whether the form has been submitted? Or
are you just trying to validate form data?
-------------- verify form submitted -----------------
if (isset($_POST)) {
// form submitted, process data
} else {
// display form
}
----------------------------------------------------------
http://us2.php.net/manual/en/features.file-upload.php
Example 38-2. Validating file uploads
On Oct 28, 2006, at 2:46 PM, Børge Holen wrote:
Ok. got that thanks.
But that leaves me a bit off to how to tell the script to leave it
alone.
Is it possible to check it
or maby even better. Posible to not add an empty field in the submit.
The multifile submit I actually intended this script for, always
send the
first field empty so later on I slice the array to cut out the
first'n empty
field.
Witch ALSO would be very helpful, since I right this minute seems to
believe/found out that Safari actually seems to send the field in the
opposite order of Firefox??? Maby there is something else, but the
script
stops when I check the array for actual images.
On Saturday 28 October 2006 23:33, M.Sokolewicz wrote:
Børge Holen wrote:
When I use a normal single file upload form; both of these
statements
will continue wether my form is empty or not, why?
if(!empty($_FILES)){
do som checking if its a jpg.
if not exit;
if(isset($_FILES)){
because it IS set and NOT empty.
$_FILES['file_upload_field'] is set, it's got no data, but it IS set.
$_FILES is set because $_FILES['file_upload_field'] exists.
Submitting a blank form sends all "variables" though without actual
(non-default) content.
- tul
--
---
Børge
Kennel Arivene
http://www.arivene.net
---
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I'm trying to validate wether or not to run the image check script.
however empty the file field(s) are This script is started... how do I tell it
there is nothing here, go do other stuff.
for both multiupload forms and single upload forms since they're supposed to
share this script. My logic tells me there should be something like this if
statements, but then again, I'm more of a copy paster rather than a expert.
On Sunday 29 October 2006 00:03, Ed Lazor wrote:
> Are you just trying to tell whether the form has been submitted? Or
> are you just trying to validate form data?
>
> -------------- verify form submitted -----------------
> if (isset($_POST)) {
> // form submitted, process data
> } else {
> // display form
> }
>
> ----------------------------------------------------------
> http://us2.php.net/manual/en/features.file-upload.php
>
> Example 38-2. Validating file uploads
>
> On Oct 28, 2006, at 2:46 PM, Børge Holen wrote:
> > Ok. got that thanks.
> > But that leaves me a bit off to how to tell the script to leave it
> > alone.
> > Is it possible to check it
> >
> > or maby even better. Posible to not add an empty field in the submit.
> > The multifile submit I actually intended this script for, always
> > send the
> > first field empty so later on I slice the array to cut out the
> > first'n empty
> > field.
> >
> > Witch ALSO would be very helpful, since I right this minute seems to
> > believe/found out that Safari actually seems to send the field in the
> > opposite order of Firefox??? Maby there is something else, but the
> > script
> > stops when I check the array for actual images.
> >
> > On Saturday 28 October 2006 23:33, M.Sokolewicz wrote:
> >> Børge Holen wrote:
> >>> When I use a normal single file upload form; both of these
> >>> statements
> >>> will continue wether my form is empty or not, why?
> >>>
> >>> if(!empty($_FILES)){
> >>> do som checking if its a jpg.
> >>> if not exit;
> >>>
> >>> if(isset($_FILES)){
> >>
> >> because it IS set and NOT empty.
> >> $_FILES['file_upload_field'] is set, it's got no data, but it IS set.
> >> $_FILES is set because $_FILES['file_upload_field'] exists.
> >> Submitting a blank form sends all "variables" though without actual
> >> (non-default) content.
> >>
> >> - tul
> >
> > --
> > ---
> > Børge
> > Kennel Arivene
> > http://www.arivene.net
> > ---
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
--
---
Børge
Kennel Arivene
http://www.arivene.net
---
--- End Message ---
--- Begin Message ---
Hi,
I have a MySQL database with a date field and a bunch of other fields. The
date field is in the format - 01/01/2006. What I want to do is query the
database and create a table that shows just the year and how many instances
of the year there is. I have been taxing my brain for a simple solution, but
just not getting it. Any suggestions?
Thanks
Example output.
Year Count
2002 5
2003 8
2004 9
2005 15
2006 22
ps - I get this information sent to me and I can't change any of the data. I
just enter it in the db and then hopefully do the query on it.
--- End Message ---