php-general Digest 30 Aug 2007 14:12:04 -0000 Issue 4990
Topics (messages 261521 through 261534):
Re: Internet Explorer Caching
261521 by: Charlene
261522 by: Charlene
261523 by: Jim Lucas
261525 by: Stut
Re: About Session And Cookies
261524 by: Stut
Re: Pragmatically changing a "Record Number"
261526 by: Stut
261527 by: M. Sokolewicz
261528 by: Jason Pruim
261529 by: Stut
261530 by: Stut
261531 by: Jason Pruim
261532 by: Stut
261533 by: Jason Pruim
Internet Explorer Caching - Solved
261534 by: Charlene
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 ---
Unfortunately I don't have a choice. I have to be able to handle IE.
And IE is caching the page. I can see it in my Temporary Internet Files
folder. And the Expiration Date is 3 hours after the file is created.
If I delete the file, a new one is created and the Expiration Date is 3
hours after the new file is created.
Charlene
Richard Lynch wrote:
On Wed, August 29, 2007 2:10 pm, Charlene wrote:
I forgot to mention in my question that only IE appears to cache. And
with the way my PHP program goes, I'm constantly changing the URL as I
go through the application to modify data and status message. But
whenever I return the the edit page, the old data is showing up.
Ah!
"old data" as in "This is what you typed into the form last time you
were here, so this is what you must want in the form this time, no
matter what is in the HTML for the default value, because we are
Microsoft, and our users are stupid and this is what they want"?
You're pretty much dealing with a browser behaviour, I think, and
people dumb enough to use IE actually expect it to work that way, and
trying to fix it is probably a mistake.
--- End Message ---
--- Begin Message ---
Unfortunately I don't have a choice. I have to be able to handle IE.
And IE is caching the page. I can see it in my Temporary Internet Files
folder. And the Expiration Date is 3 hours after the file is created.
If I delete the file, a new one is created and the Expiration Date is 3
hours after the new file is created.
Charlene
Richard Lynch wrote:
On Wed, August 29, 2007 2:10 pm, Charlene wrote:
I forgot to mention in my question that only IE appears to cache. And
with the way my PHP program goes, I'm constantly changing the URL as I
go through the application to modify data and status message. But
whenever I return the the edit page, the old data is showing up.
Ah!
"old data" as in "This is what you typed into the form last time you
were here, so this is what you must want in the form this time, no
matter what is in the HTML for the default value, because we are
Microsoft, and our users are stupid and this is what they want"?
You're pretty much dealing with a browser behaviour, I think, and
people dumb enough to use IE actually expect it to work that way, and
trying to fix it is probably a mistake.
--- End Message ---
--- Begin Message ---
Charlene wrote:
Unfortunately I don't have a choice. I have to be able to handle IE.
And IE is caching the page. I can see it in my Temporary Internet Files
folder. And the Expiration Date is 3 hours after the file is created.
If I delete the file, a new one is created and the Expiration Date is 3
hours after the new file is created.
Charlene
Richard Lynch wrote:
On Wed, August 29, 2007 2:10 pm, Charlene wrote:
I forgot to mention in my question that only IE appears to cache. And
with the way my PHP program goes, I'm constantly changing the URL as I
go through the application to modify data and status message. But
whenever I return the the edit page, the old data is showing up.
Ah!
"old data" as in "This is what you typed into the form last time you
were here, so this is what you must want in the form this time, no
matter what is in the HTML for the default value, because we are
Microsoft, and our users are stupid and this is what they want"?
You're pretty much dealing with a browser behavior, I think, and
people dumb enough to use IE actually expect it to work that way, and
trying to fix it is probably a mistake.
It could be that your browser is overriding the cache settings.
In IE go to
Tools -> Internet Options -> General -> (history)Settings
make sure it is set to either Automatically or "Every visit to the page"
if it is form data that keeps returning, go to
Tools -> Internet Options -> Content -> AutoComplete
And make sure that Forms is not checked in the list of items
Hope this helps
--- End Message ---
--- Begin Message ---
Satyam wrote:
I'm sending these headers:
header('Cache-Control: no-cache, must-revalidate'); // HTTP/1.1
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
I don't remember where I took them from, but they are working fine for me.
Probably not relevant to the problem, but 26 Jul 1997 was a Saturday not
a Monday.
-Stut
--
http://stut.net/
--- End Message ---
--- Begin Message ---
Richard Lynch wrote:
On Wed, August 29, 2007 4:33 pm, tedd wrote:
At 10:52 PM +0200 8/18/07, Michelle Konzack wrote:
Am 2007-08-17 22:07:47, schrieb Bastien Koert:
If cookies are not available, you can either
hide the id in the hidden form field element
or
enable trans_sid to automatically pass the session id in the url
This will be a security risk since Session-Hijacker can grap the URL
Greetings
Michelle Konzack
Systemadministrator
Tamay Dogan Network
Debian GNU/Linux Consultant
When the user first generates a session id, grab the user's ip and
store both in mysql.
In the code, always check the session id against the user's ip before
doing anything. If they don't match with what you started with, then
stop. That should stop most Session-Hijackers, don't you think?
Cheers,
tedd
PS; Back from vacation, and all ready to be retrained.
You have just booted all AOL users from your website.
They change IP address every request sometimes.
IP is absolutely useless for identification.
Indeed it is. Use the user agent instead and you should be fine.
However, I would not be surprised if there is a user agent out there
somewhere that changes that header when it feels so inclined, but it's
infinitely better than using the IP.
-Stut
http://stut.net/
--- End Message ---
--- Begin Message ---
Jason Pruim wrote:
Hi Everyone,
Hi Dr Jason.
I think after I get this question answered, I can stop asking for awhile
since my project will be done, at least until the users say "What
happened to XYZ????" then I'll ask again :)
I asked on a MySQL list about "Resetting a auto increment filed" so that
there arn't any gaps in the record number.
So to say it another way, I have a table that has 900 records in it,
I've added 3 records, but then deleted 2 of those which puts the actual
record count at 901 but my auto increment field starts at 904 on the
next insert.
Is there away with PHP that I can pragmatically change that value to the
total records in the database more so then a representation of the
actual record number?
What are you actually trying to achieve? Why do you need all records to
have a sequential number? Ignore how you're going to do it, just tell us
why you think you need this, because I've never come across a reason to
need this.
-Stut
--
http://stut.net/
--- End Message ---
--- Begin Message ---
Stut wrote:
Jason Pruim wrote:
Hi Everyone,
Hi Dr Jason.
I think after I get this question answered, I can stop asking for
awhile since my project will be done, at least until the users say
"What happened to XYZ????" then I'll ask again :)
I asked on a MySQL list about "Resetting a auto increment filed" so
that there arn't any gaps in the record number.
So to say it another way, I have a table that has 900 records in it,
I've added 3 records, but then deleted 2 of those which puts the
actual record count at 901 but my auto increment field starts at 904
on the next insert.
Is there away with PHP that I can pragmatically change that value to
the total records in the database more so then a representation of the
actual record number?
What are you actually trying to achieve? Why do you need all records to
have a sequential number? Ignore how you're going to do it, just tell us
why you think you need this, because I've never come across a reason to
need this.
-Stut
I've seen many people who wished to "fix" sequences like this before,
usually because they believe there is something "wrong" with there being
gaps in there. However, from a database-point-of-view an auto_increment
value represents a unique row which _stays_ unique. As such because it
doesn't re-assign values used before you keep database integrity intact
because old possible links between rows/tables won't be reused and thus
won't form unintended links (ie. say you delete row [id=2] from table a,
which was linked via [id=2] to a row in table b. If it was reused, a
"fresh" row would suddenly inherit its predecessors links (which it
should not!).
The auto_increment value represents just that, an internal unique id for
a row in a specific table. It doesn't represent the location of a row in
respect to other rows (ie the 2nd, 3rd and 4th of the table), simply
because that's now what it's intended for. If that is what you wish,
you'll need to find a different way of achieving it.
--- End Message ---
--- Begin Message ---
On Aug 30, 2007, at 5:14 AM, Stut wrote:
Jason Pruim wrote:
Hi Everyone,
Hi Dr Jason.
I think after I get this question answered, I can stop asking for
awhile since my project will be done, at least until the users say
"What happened to XYZ????" then I'll ask again :)
I asked on a MySQL list about "Resetting a auto increment filed"
so that there arn't any gaps in the record number.
So to say it another way, I have a table that has 900 records in
it, I've added 3 records, but then deleted 2 of those which puts
the actual record count at 901 but my auto increment field starts
at 904 on the next insert.
Is there away with PHP that I can pragmatically change that value
to the total records in the database more so then a representation
of the actual record number?
What are you actually trying to achieve? Why do you need all
records to have a sequential number? Ignore how you're going to do
it, just tell us why you think you need this, because I've never
come across a reason to need this.
What I am trying to achieve, is something along the lines of excel...
You can clear out a row in excel, and then "sort" all the blank lines
out renumbering the records. Basically, the people I'm going to sell
this app too, are used to using excel, so I'm attempting to mimic as
much of it as I can.
Does that help clear it up?
--
Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
M. Sokolewicz wrote:
Stut wrote:
Jason Pruim wrote:
Hi Everyone,
Hi Dr Jason.
I think after I get this question answered, I can stop asking for
awhile since my project will be done, at least until the users say
"What happened to XYZ????" then I'll ask again :)
I asked on a MySQL list about "Resetting a auto increment filed" so
that there arn't any gaps in the record number.
So to say it another way, I have a table that has 900 records in it,
I've added 3 records, but then deleted 2 of those which puts the
actual record count at 901 but my auto increment field starts at 904
on the next insert.
Is there away with PHP that I can pragmatically change that value to
the total records in the database more so then a representation of
the actual record number?
What are you actually trying to achieve? Why do you need all records
to have a sequential number? Ignore how you're going to do it, just
tell us why you think you need this, because I've never come across a
reason to need this.
-Stut
I've seen many people who wished to "fix" sequences like this before,
usually because they believe there is something "wrong" with there being
gaps in there. However, from a database-point-of-view an auto_increment
value represents a unique row which _stays_ unique. As such because it
doesn't re-assign values used before you keep database integrity intact
because old possible links between rows/tables won't be reused and thus
won't form unintended links (ie. say you delete row [id=2] from table a,
which was linked via [id=2] to a row in table b. If it was reused, a
"fresh" row would suddenly inherit its predecessors links (which it
should not!).
The auto_increment value represents just that, an internal unique id for
a row in a specific table. It doesn't represent the location of a row in
respect to other rows (ie the 2nd, 3rd and 4th of the table), simply
because that's now what it's intended for. If that is what you wish,
you'll need to find a different way of achieving it.
Again this is focusing on what autoincrement fields are used for. I want
Jason to tell us what he needs a sequential record number with no gaps
for, otherwise you lot are going to continue telling him the same thing
over and over again which is unlikely to help anyone.
-Stut
--
http://stut.net/
--- End Message ---
--- Begin Message ---
Jason Pruim wrote:
On Aug 30, 2007, at 5:14 AM, Stut wrote:
Jason Pruim wrote:
Hi Everyone,
Hi Dr Jason.
I think after I get this question answered, I can stop asking for
awhile since my project will be done, at least until the users say
"What happened to XYZ????" then I'll ask again :)
I asked on a MySQL list about "Resetting a auto increment filed" so
that there arn't any gaps in the record number.
So to say it another way, I have a table that has 900 records in it,
I've added 3 records, but then deleted 2 of those which puts the
actual record count at 901 but my auto increment field starts at 904
on the next insert.
Is there away with PHP that I can pragmatically change that value to
the total records in the database more so then a representation of
the actual record number?
What are you actually trying to achieve? Why do you need all records
to have a sequential number? Ignore how you're going to do it, just
tell us why you think you need this, because I've never come across a
reason to need this.
What I am trying to achieve, is something along the lines of excel...
You can clear out a row in excel, and then "sort" all the blank lines
out renumbering the records. Basically, the people I'm going to sell
this app too, are used to using excel, so I'm attempting to mimic as
much of it as I can.
Does that help clear it up?
Not really. You are in control of how the data gets displayed. This has
a very loose connection with how the data is actually stored in the
database.
How are you displaying the data to your users? Why do they need a row
number? If you're writing a spreadsheet application then an
autoincrement column for the row number is not what you want since the
row is something you need to control.
Some insight into what you are actually going to be doing with this
number would be helpful, rather than just the assertion that you need
it. We get that you think you need this sequential number, but why?
-Stut
--
http://stut.net/
--- End Message ---
--- Begin Message ---
On Aug 30, 2007, at 6:34 AM, Stut wrote:
Jason Pruim wrote:
On Aug 30, 2007, at 5:14 AM, Stut wrote:
Jason Pruim wrote:
Hi Everyone,
Hi Dr Jason.
I think after I get this question answered, I can stop asking
for awhile since my project will be done, at least until the
users say "What happened to XYZ????" then I'll ask again :)
I asked on a MySQL list about "Resetting a auto increment filed"
so that there arn't any gaps in the record number.
So to say it another way, I have a table that has 900 records in
it, I've added 3 records, but then deleted 2 of those which puts
the actual record count at 901 but my auto increment field
starts at 904 on the next insert.
Is there away with PHP that I can pragmatically change that
value to the total records in the database more so then a
representation of the actual record number?
What are you actually trying to achieve? Why do you need all
records to have a sequential number? Ignore how you're going to
do it, just tell us why you think you need this, because I've
never come across a reason to need this.
What I am trying to achieve, is something along the lines of
excel... You can clear out a row in excel, and then "sort" all the
blank lines out renumbering the records. Basically, the people I'm
going to sell this app too, are used to using excel, so I'm
attempting to mimic as much of it as I can.
Does that help clear it up?
Not really. You are in control of how the data gets displayed. This
has a very loose connection with how the data is actually stored in
the database.
How are you displaying the data to your users? Why do they need a
row number? If you're writing a spreadsheet application then an
autoincrement column for the row number is not what you want since
the row is something you need to control.
Some insight into what you are actually going to be doing with this
number would be helpful, rather than just the assertion that you
need it. We get that you think you need this sequential number, but
why?
The information is being displayed in a table, and can be sorted by
any of the fields. The purpose of the application I am writing is
going to be a online database, giving my customers access to their
mailing list 24/7 from anywhere in the world.
Alot of the customers that my company deals with aren't the best when
it comes to computers, so it's a comfort level thing for them.
Also, I do have one customer that wants to be able to say to us "What
do you have for record #????" and have us be able say what it says
for that record. That customer is one of the people I want to switch
over to here ASAP and let her manage her mailing list.
But as I type that out, I think the reason I want a sequential
address number more then anything is to prevent the users from
asking, "I only have 900 records in my database, why do I have record
numbers over 1,000?". But, if I were to use something like
mysql_num_rows I could display a total record count and just tell
them to ignore the record number until there was an issue right? I
know that's on my end :) but I think I am talking my self out off
displaying sequential record numbers and finding other ways to
display the information :)
--
Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Jason Pruim wrote:
The information is being displayed in a table, and can be sorted by any
of the fields. The purpose of the application I am writing is going to
be a online database, giving my customers access to their mailing list
24/7 from anywhere in the world.
Alot of the customers that my company deals with aren't the best when it
comes to computers, so it's a comfort level thing for them.
Also, I do have one customer that wants to be able to say to us "What do
you have for record #????" and have us be able say what it says for that
record. That customer is one of the people I want to switch over to here
ASAP and let her manage her mailing list.
But as I type that out, I think the reason I want a sequential address
number more then anything is to prevent the users from asking, "I only
have 900 records in my database, why do I have record numbers over
1,000?". But, if I were to use something like mysql_num_rows I could
display a total record count and just tell them to ignore the record
number until there was an issue right? I know that's on my end :) but I
think I am talking my self out off displaying sequential record numbers
and finding other ways to display the information :)
I think you're creating a problem where none exists. If your customers
can't understand that you give each record a unique ID and that when you
delete records you don't reuse those IDs then I think you need to get
new customers.
Here's a tip for free... don't call them record numbers, call them IDs.
The question your customer should be asking is "What do you have for
user #????".
If your customers do start asking about it, educate them rather than
trying to shield them from what is a really basic concept. As someone
has previously said in this thread, compare it to social security
numbers. The IDs are unique for life, so if a user gets deleted their ID
will never be reused. The IDs have no connection at all to the number of
users in the database.
It sounds like your getting it, but if you need any further
clarification on it I'll be happy to help.
-Stut
--
http://stut.net/
--- End Message ---
--- Begin Message ---
On Aug 30, 2007, at 6:52 AM, Stut wrote:
Jason Pruim wrote:
The information is being displayed in a table, and can be sorted
by any of the fields. The purpose of the application I am writing
is going to be a online database, giving my customers access to
their mailing list 24/7 from anywhere in the world.
Alot of the customers that my company deals with aren't the best
when it comes to computers, so it's a comfort level thing for them.
Also, I do have one customer that wants to be able to say to us
"What do you have for record #????" and have us be able say what
it says for that record. That customer is one of the people I want
to switch over to here ASAP and let her manage her mailing list.
But as I type that out, I think the reason I want a sequential
address number more then anything is to prevent the users from
asking, "I only have 900 records in my database, why do I have
record numbers over 1,000?". But, if I were to use something like
mysql_num_rows I could display a total record count and just tell
them to ignore the record number until there was an issue right? I
know that's on my end :) but I think I am talking my self out off
displaying sequential record numbers and finding other ways to
display the information :)
I think you're creating a problem where none exists. If your
customers can't understand that you give each record a unique ID
and that when you delete records you don't reuse those IDs then I
think you need to get new customers.
Here's a tip for free... don't call them record numbers, call them
IDs. The question your customer should be asking is "What do you
have for user #????".
If your customers do start asking about it, educate them rather
than trying to shield them from what is a really basic concept. As
someone has previously said in this thread, compare it to social
security numbers. The IDs are unique for life, so if a user gets
deleted their ID will never be reused. The IDs have no connection
at all to the number of users in the database.
It sounds like your getting it, but if you need any further
clarification on it I'll be happy to help.
I understand what you are saying, and I think I even understand why
what I was thinking was wrong... Now, it's just a matter of
displaying a "ID #" and then somewhere on the page, include a "Total
Records: $totalRecords" so they know how many are in there.
thank you for taking the time to help me understand why what I wanted
wasn't really what I wanted :)
--
Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424
www.raoset.com
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Charlene wrote:
I've been having problems with Internet Explorer caching php
programs. I'm using the following code:
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Pragma", "no-cache");
header("Expires", "-1");
And it used to work, but now, according to Windows Explorer its giving
it 3 hours to expire.
Charlene
I am using sessions, and it appears to work differently in PHP5 than
PHP4 (not fully tested as to verification of that statement). So I
needed to add a line of code before the session_start function:
session_cache_expire(0);
session_start();
Charlene
--- End Message ---