Re: [PHP] Re: About Session And Cookies

2007-08-30 Thread Stut

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/

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



Re: [PHP] Internet Explorer Caching

2007-08-30 Thread Stut

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/

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



Re: [PHP] Pragmatically changing a "Record Number"

2007-08-30 Thread Stut

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/

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



Re: [PHP] Pragmatically changing a "Record Number"

2007-08-30 Thread M. Sokolewicz

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.


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



Re: [PHP] Pragmatically changing a "Record Number"

2007-08-30 Thread Jason Pruim


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]

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



Re: [PHP] Pragmatically changing a "Record Number"

2007-08-30 Thread Stut

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/

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



Re: [PHP] Pragmatically changing a "Record Number"

2007-08-30 Thread Stut

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/

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



Re: [PHP] Pragmatically changing a "Record Number"

2007-08-30 Thread Jason Pruim


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]

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



Re: [PHP] Pragmatically changing a "Record Number"

2007-08-30 Thread Stut

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/

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



Re: [PHP] Pragmatically changing a "Record Number"

2007-08-30 Thread Jason Pruim


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]

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



[PHP] Internet Explorer Caching - Solved

2007-08-30 Thread Charlene

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

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



Re: [PHP] How to show proper time to users from around the world

2007-08-30 Thread Hemanth
Its ok if I can display just the time set in their computers
wherever they are and even if they are travelling.

anyway thats as far as anyone can get short of asking them for the time

Is there some simple way

I have collected various ideas and snippets searching google
trying to piece them all together



On 8/30/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
>
> On Wed, August 29, 2007 2:24 am, Hemanth wrote:
> > Is there a solution to showing the proper time and date at user
> > browsers
> > and also recording proper USER times in the database operations in
> > mysql
>
> Not really.
>
> You can use Javascript to get what the user's clock SAYS is the
> date/time, but WAY too many users have their clocks set wrong, and
> you'll never fix that.
>
> You can ask them where they live, or ask them to input their own
> time-zone.
>
> Traveling users may prefer to use UTC or something as well, rather
> than try to figure out what time-zone they are in this minute (cough
> Indiana cough).
>
> --
>



-- 
www.ValueAds.bizso easy
FREE India Classifieds
Jobs, Matrimony, Property and more
A Bangalore, India Venture.


[PHP] Reload page after form submit

2007-08-30 Thread Wagner Garcia Campagner
Hello,

I'm building a web page just like a blog...

Where the user input some information... (name, website and comment)

This information is stored in a file...

And then the page displays it...

When the user access the page the first time, the information is displayed
correct...

After the user submit the information, the page become outdated... without
this last information the user submitted...

Is there a way to tell PHP to reload the page after the user submit the
information, so the page is always updated??

Thanks in advance,
Wagner.

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



Re: [PHP] Reload page after form submit

2007-08-30 Thread Per Jessen
Wagner Garcia Campagner wrote:

> Hello,
> 
> I'm building a web page just like a blog...
> 
> Where the user input some information... (name, website and comment)
> 
> This information is stored in a file...
> 
> And then the page displays it...
> 
> When the user access the page the first time, the information is
> displayed correct...
> 
> After the user submit the information, the page become outdated...
> without this last information the user submitted...
> 
> Is there a way to tell PHP to reload the page after the user submit
> the information, so the page is always updated??

After you've processed the POST request, you finish with something like
this:

header("HTTP/1.0 303 See other");
header("Location: #");
exit;


/Per Jessen, Zürich

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



Re: [PHP] Reload page after form submit

2007-08-30 Thread Wouter van Vliet / Interpotential
On 30/08/2007, Per Jessen <[EMAIL PROTECTED]> wrote:
>
> Wagner Garcia Campagner wrote:
>
> > Hello,
> >
> > I'm building a web page just like a blog...
> >
> > Where the user input some information... (name, website and comment)
> >
> > This information is stored in a file...
> >
> > And then the page displays it...
> >
> > When the user access the page the first time, the information is
> > displayed correct...
> >
> > After the user submit the information, the page become outdated...
> > without this last information the user submitted...
> >
> > Is there a way to tell PHP to reload the page after the user submit
> > the information, so the page is always updated??
>
> After you've processed the POST request, you finish with something like
> this:
>
> header("HTTP/1.0 303 See other");
> header("Location: #");
> exit;


It needs a little bit more than that. The script to which the form has been
submitted knows about the $_POST data, once you Location: to another page
that gets forgotten. Just add a line like $_SESSION['lastFormSubmit'] =
$_POST just before the first header() call and you're fine.






-- 
Interpotential.com
Phone: +31615397471


RE: [PHP] Reload page after form submit

2007-08-30 Thread Wagner Garcia Campagner
Thanks a lot,

I tried both suggestions, but it didn't work...

I did it send an Echo with this string:



After processing the form... it worked...

Is there any problem doing this?

Thanks again,
Wagner.



-Original Message-
From: Wouter van Vliet / Interpotential
[mailto:[EMAIL PROTECTED]
Sent: quinta-feira, 30 de agosto de 2007 14:44
To: Per Jessen
Cc: php-general@lists.php.net
Subject: Re: [PHP] Reload page after form submit


On 30/08/2007, Per Jessen <[EMAIL PROTECTED]> wrote:
>
> Wagner Garcia Campagner wrote:
>
> > Hello,
> >
> > I'm building a web page just like a blog...
> >
> > Where the user input some information... (name, website and comment)
> >
> > This information is stored in a file...
> >
> > And then the page displays it...
> >
> > When the user access the page the first time, the information is
> > displayed correct...
> >
> > After the user submit the information, the page become outdated...
> > without this last information the user submitted...
> >
> > Is there a way to tell PHP to reload the page after the user submit
> > the information, so the page is always updated??
>
> After you've processed the POST request, you finish with something like
> this:
>
> header("HTTP/1.0 303 See other");
> header("Location: #");
> exit;


It needs a little bit more than that. The script to which the form has been
submitted knows about the $_POST data, once you Location: to another page
that gets forgotten. Just add a line like $_SESSION['lastFormSubmit'] =
$_POST just before the first header() call and you're fine.






-- 
Interpotential.com
Phone: +31615397471

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



[PHP] Compiling PHP 5.2.3

2007-08-30 Thread Eric Gorr
I am attempting to compile PHP 5.2.3 and am having trouble with the  
configuration step:


configure: error: utf8_mime2text() has new signature, but  
U8T_CANONICAL is missing. This should not happen. Check config.log  
for additional information.


I cannot figure this one out. Any help would be appreciated.

I am using MacPorts (http://www.macports.org/ - same idea as Fink) to  
obtain various packages I need and am running MacOSX 10.4.10.


To what configuration option does this belong? If it belongs to  
something I don't really need, I'll just turn the option off.


What MacPort would I need to install? I could even install something  
via Fink, if wha tI need is not available via MacPorts.


My configure line currently is:


./configure --prefix=/mine/local/php5 --with-apxs2=/opt/local/apache2/ 
bin/apxs --with-config-file-scan-dir=/mine/local/php5/php.d --with- 
iconv-dir=/opt/local --with-iconv --with-openssl=/opt/local --with- 
zlib=/opt/local --with-gd=/opt/local --with-zlib-dir=/opt/local -- 
with-ldap --with-xmlrpc --with-snmp=/opt/local --enable-sqlite-utf8 -- 
enable-exif --enable-wddx --enable-soap --with-sqlite=/opt/local -- 
enable-ftp --enable-sockets --enable-dbx --enable-dbase --enable- 
mbstring --enable-calendar --enable-bcmath --with-bz2=/opt/local -- 
enable-memory-limit --with-curl=shared,/mine/local/php5 --with- 
mysql=shared,/mine/local/php5 --with-mysqli=shared,/mine/local/php5/ 
bin/mysql_config --with-pdo-mysql=shared,/mine/local/php5 --with- 
libxml-dir=shared,/mine/local/php5 --with-xsl=shared,/mine/local/php5  
--with-pdflib=shared,/mine/local/php5 --with-imap=../imap-2004g -- 
with-kerberos=/opt/local --with-imap-ssl=/opt/local --with-jpeg-dir=/ 
mine/local/php5 --with-png-dir=/mine/local/php5 --enable-gd-native- 
ttf --with-freetype-dir=/opt/local --with-iodbc=shared,/opt/local -- 
with-pgsql=shared,/mine/local/php5 --with-pdo-pgsql=shared,/mine/ 
local/php5 --with-t1lib=/opt/local --with-gettext=shared,/mine/local/ 
php5 --with-ming=shared,/mine/local/php5 --with-mcrypt=shared,/mine/ 
local/php5 --with-mhash=shared,/mine/local/php5 --with-mssql=shared,/ 
mine/local/php5 --with-json=shared --enable-memcache --with-xpm-dir=/ 
opt --with-readline=/opt --enable-openbase_module


I'm sure there are still problems with it that I am slowly working  
through...I basically copied the one from http://www.entropy.ch/ 
software/macosx/php/ since I know that installation of PHP has worked  
for me in the past.


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



Re: [PHP] How to show proper time to users from around the world

2007-08-30 Thread Ólafur Waage
Since there are always many ways to do things here's one id like to
see how well it worked. It would be getting the IP address of the user
and matching it against an IP address locator. Since ive seen these to
be accurate to what timezone people are in.

Olafur W

2007/8/30, Hemanth <[EMAIL PROTECTED]>:
> Its ok if I can display just the time set in their computers
> wherever they are and even if they are travelling.
>
> anyway thats as far as anyone can get short of asking them for the time
>
> Is there some simple way
>
> I have collected various ideas and snippets searching google
> trying to piece them all together
>
>
>
> On 8/30/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
> >
> > On Wed, August 29, 2007 2:24 am, Hemanth wrote:
> > > Is there a solution to showing the proper time and date at user
> > > browsers
> > > and also recording proper USER times in the database operations in
> > > mysql
> >
> > Not really.
> >
> > You can use Javascript to get what the user's clock SAYS is the
> > date/time, but WAY too many users have their clocks set wrong, and
> > you'll never fix that.
> >
> > You can ask them where they live, or ask them to input their own
> > time-zone.
> >
> > Traveling users may prefer to use UTC or something as well, rather
> > than try to figure out what time-zone they are in this minute (cough
> > Indiana cough).
> >
> > --
> >
>
>
>
> --
> www.ValueAds.bizso easy
> FREE India Classifieds
> Jobs, Matrimony, Property and more
> A Bangalore, India Venture.
>

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



Re: [PHP] Reload page after form submit

2007-08-30 Thread Stut

Wagner Garcia Campagner wrote:

Thanks a lot,

I tried both suggestions, but it didn't work...

I did it send an Echo with this string:



After processing the form... it worked...

Is there any problem doing this?


You'd be better off with...

header('Location: index.php');

Although technically speaking that should be an absolute URL.

-Stut

--
http://stut.net/

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



RE: [PHP] Reload page after form submit

2007-08-30 Thread Instruct ICC

From: "Wagner Garcia Campagner" <[EMAIL PROTECTED]>

Hello,

I'm building a web page just like a blog...

Where the user input some information... (name, website and comment)

This information is stored in a file...

And then the page displays it...

When the user access the page the first time, the information is displayed
correct...

After the user submit the information, the page become outdated... without
this last information the user submitted...

Is there a way to tell PHP to reload the page after the user submit the
information, so the page is always updated??

Thanks in advance,
Wagner.


I don't get your fundamental problem.  When a user submits a form, the page 
handling the submission  (the PHP script) decides what next to display.  
Can't you have it display the updated information?


From your subject, I was thinking "xajax".  But isn't this basic form 

handling?

_
A new home for Mom, no cleanup required. All starts here. 
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us


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



RE: [PHP] Reload page after form submit

2007-08-30 Thread Instruct ICC

From: "Wagner Garcia Campagner" <[EMAIL PROTECTED]>
Is there a way to tell PHP to reload the page after the user submit the
information, so the page is always updated??

Thanks in advance,
Wagner.


I don't get your fundamental problem.  When a user submits a form, the page 
handling the submission  (the PHP script) decides what next to display.  
Can't you have it display the updated information?


From your subject, I was thinking "xajax".  But isn't this basic form 
handling?


Do you mean User1 submits a change, and you want User1, User2 and UserN to 
see the new information?  Then I could see scheduling a refresh.


_
Booking a flight? Know when to buy with airfare predictions on MSN Travel. 
http://travel.msn.com/Articles/aboutfarecast.aspx&ocid=T001MSN25A07001


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



Re: [PHP] Reload page after form submit

2007-08-30 Thread Afan Pasalic

rough code, to give you an idea:

   ('".mysql_real_escape_string($first)."', 
'".mysql_real_escape_string($last)."')

   ");
}
else
{
   $query = mysql_query("
   select first, last
   from table
   where id=xyz
   ");
   $result = mysql_fetch_array($query, MYSQL_ASSOC);
   $first = $result['first'];
   $last = $result['last'];
}
?>


First: 
Last: 




-afan





From: "Wagner Garcia Campagner" <[EMAIL PROTECTED]>

Hello,

I'm building a web page just like a blog...

Where the user input some information... (name, website and comment)

This information is stored in a file...

And then the page displays it...

When the user access the page the first time, the information is 
displayed

correct...

After the user submit the information, the page become outdated... 
without

this last information the user submitted...

Is there a way to tell PHP to reload the page after the user submit the
information, so the page is always updated??

Thanks in advance,
Wagner.


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



Re: [PHP] Reload page after form submit

2007-08-30 Thread Instruct ICC

From: Afan Pasalic <[EMAIL PROTECTED]>

rough code, to give you an idea:

   ('".mysql_real_escape_string($first)."', 
'".mysql_real_escape_string($last)."')

   ");
}
else
{
   $query = mysql_query("
   select first, last
   from table
   where id=xyz
   ");
   $result = mysql_fetch_array($query, MYSQL_ASSOC);
   $first = $result['first'];
   $last = $result['last'];
}
?>


First: 
Last: 




-afan


Afan,
From your rough code, I'd say the OP always needs the select block (just 
remove the "else" keyword and keep the block) for the current info at the 
present page refresh/load.  But I'd like clarification on how the OP thinks 
about it.


_
A new home for Mom, no cleanup required. All starts here. 
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us


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



[PHP] make test failures (was Re: [PHP] Compiling PHP 5.2.3)

2007-08-30 Thread Eric Gorr
I was able to get past the configure problem. It was apparently  
associated with the --with-imap option and I don't need imap support.


In any case, I got to the make test and got the following failures:

=
FAILED TEST SUMMARY
-
Bug #30638 (localeconv returns wrong LC_NUMERIC settings) (ok to fail  
on MacOS X) [tests/lang/bug30638.phpt]
imagecreatefromwbmp with invalid wbmp [ext/gd/tests/ 
createfromwbmp2.phpt]

Sort with SORT_LOCALE_STRING [ext/standard/tests/array/locale_sort.phpt]
Test gettype() & settype() functions : usage variations [ext/standard/ 
tests/general_functions/gettype_settype_variation2.phpt]
htmlentities() test 2 (setlocale / fr_FR.ISO-8859-15) [ext/standard/ 
tests/strings/htmlentities02.phpt] (warn: possibly braindead libc)
htmlentities() test 4 (setlocale / ja_JP.EUC-JP) [ext/standard/tests/ 
strings/htmlentities04.phpt]
htmlentities() test 15 (setlocale / KOI8-R) [ext/standard/tests/ 
strings/htmlentities15.phpt]

Generic pack()/unpack() tests [ext/standard/tests/strings/pack.phpt]
=


Are these failures expected?


On Aug 30, 2007, at 2:43 PM, Eric Gorr wrote:

I am attempting to compile PHP 5.2.3 and am having trouble with the  
configuration step:


configure: error: utf8_mime2text() has new signature, but  
U8T_CANONICAL is missing. This should not happen. Check config.log  
for additional information.


I cannot figure this one out. Any help would be appreciated.

I am using MacPorts (http://www.macports.org/ - same idea as Fink)  
to obtain various packages I need and am running MacOSX 10.4.10.


To what configuration option does this belong? If it belongs to  
something I don't really need, I'll just turn the option off.


What MacPort would I need to install? I could even install  
something via Fink, if wha tI need is not available via MacPorts.


My configure line currently is:


./configure --prefix=/mine/local/php5 --with-apxs2=/opt/local/ 
apache2/bin/apxs --with-config-file-scan-dir=/mine/local/php5/php.d  
--with-iconv-dir=/opt/local --with-iconv --with-openssl=/opt/local  
--with-zlib=/opt/local --with-gd=/opt/local --with-zlib-dir=/opt/ 
local --with-ldap --with-xmlrpc --with-snmp=/opt/local --enable- 
sqlite-utf8 --enable-exif --enable-wddx --enable-soap --with- 
sqlite=/opt/local --enable-ftp --enable-sockets --enable-dbx -- 
enable-dbase --enable-mbstring --enable-calendar --enable-bcmath -- 
with-bz2=/opt/local --enable-memory-limit --with-curl=shared,/mine/ 
local/php5 --with-mysql=shared,/mine/local/php5 --with- 
mysqli=shared,/mine/local/php5/bin/mysql_config --with-pdo- 
mysql=shared,/mine/local/php5 --with-libxml-dir=shared,/mine/local/ 
php5 --with-xsl=shared,/mine/local/php5 --with-pdflib=shared,/mine/ 
local/php5 --with-imap=../imap-2004g --with-kerberos=/opt/local -- 
with-imap-ssl=/opt/local --with-jpeg-dir=/mine/local/php5 --with- 
png-dir=/mine/local/php5 --enable-gd-native-ttf --with-freetype- 
dir=/opt/local --with-iodbc=shared,/opt/local --with-pgsql=shared,/ 
mine/local/php5 --with-pdo-pgsql=shared,/mine/local/php5 --with- 
t1lib=/opt/local --with-gettext=shared,/mine/local/php5 --with- 
ming=shared,/mine/local/php5 --with-mcrypt=shared,/mine/local/php5  
--with-mhash=shared,/mine/local/php5 --with-mssql=shared,/mine/ 
local/php5 --with-json=shared --enable-memcache --with-xpm-dir=/opt  
--with-readline=/opt --enable-openbase_module


I'm sure there are still problems with it that I am slowly working  
through...I basically copied the one from http://www.entropy.ch/ 
software/macosx/php/ since I know that installation of PHP has  
worked for me in the past.


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



Re: [PHP] Reload page after form submit

2007-08-30 Thread Martin Marques

Stut wrote:

Wagner Garcia Campagner wrote:





header('Location: index.php');

Although technically speaking that should be an absolute URL.


AFAIK, they are both equivalent.

--
 21:50:04 up 2 days,  9:07,  0 users,  load average: 0.92, 0.37, 0.18
-
Lic. Martín Marqués |   SELECT 'mmarques' ||
Centro de Telemática|   '@' || 'unl.edu.ar';
Universidad Nacional|   DBA, Programador,
del Litoral |   Administrador
-

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



RE: [PHP] Internet Explorer Caching

2007-08-30 Thread Daevid Vincent
Here are some cache things we do for IE...


// workaround for IE bug that prevents downloading files from an httpS site
// (see http://support.microsoft.com/default.aspx?scid=kb;en-us;316431 )
session_cache_limiter('public');


// This ensures that most browsers known to human beings won't try to cache
the page.
// Proxy caching is, I believe, somewhat addressed by the cache-control, but

// additional directives exist should that ever become a concern.
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");// Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always
modified
header("Cache-Control: no-store, no-cache, must-revalidate");  // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");  // HTTP/1.0

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



Re: [PHP] Reload page after form submit

2007-08-30 Thread Stut

Martin Marques wrote:

Stut wrote:

Wagner Garcia Campagner wrote:





header('Location: index.php');

Although technically speaking that should be an absolute URL.


AFAIK, they are both equivalent.


Essentially yes, but personally (and for no logical reason I can think 
of) I always prefer headers over HTML content, especially when any other 
HTML content in the page will not be seen.


-Stut

--
http://stut.net/

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



Re: [PHP] Reload page after form submit

2007-08-30 Thread Instruct ICC

From: Martin Marques <[EMAIL PROTECTED]>
Stut wrote:

Wagner Garcia Campagner wrote:





header('Location: index.php');

Although technically speaking that should be an absolute URL.


AFAIK, they are both equivalent.


Ahhh, if the OP meant, "Load a different page after doing some form 
processing in the current PHP page", then just go with the PHP "header" 
function.  The HTML META HTTP-EQUIV='refresh' would require the HTML be 
rendered first.  The PHP "header" would be slightly faster, and you are 
already in the PHP script.


I'm like, "How is the page becoming outdated?  You are not still on that 
page -- it's gone.  The next page display will gather the latest info."


_
A new home for Mom, no cleanup required. All starts here. 
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us


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



[PHP] crypt salt question

2007-08-30 Thread Andras Kende
Hello,

 

I'm trying to move some app from postgresql to mysql but unable to find out
how to authenticate

against the current crypted passwords with php..

 

insert to database:

 

$cset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./";
$salt = substr($cset, time() & 63, 1) . substr($cset, time()/64 & 63, 1);
$password = crypt($password, $salt);   //pass crypted version of password
for further processing



$result = pg_query ("INSERT INTO users (username, password) VALUES
('$username', '$password')");

 

I read the crypt is one way encryption but how to compare the password
entered with the encrypted 

version if don't know the salt ??

 

 

Thanks,

 

Andras



Re: [PHP] crypt salt question

2007-08-30 Thread Satyam
No chance.  Unless you have the salt stored along each password, your 
passwords are as good as random texts


Satyam



- Original Message - 
From: "Andras Kende" <[EMAIL PROTECTED]>

To: 
Sent: Thursday, August 30, 2007 11:42 PM
Subject: [PHP] crypt salt question



Hello,



I'm trying to move some app from postgresql to mysql but unable to find 
out

how to authenticate

against the current crypted passwords with php..



insert to database:



$cset = 
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./";

$salt = substr($cset, time() & 63, 1) . substr($cset, time()/64 & 63, 1);
$password = crypt($password, $salt);   //pass crypted version of password
for further processing



$result = pg_query ("INSERT INTO users (username, password) VALUES
('$username', '$password')");



I read the crypt is one way encryption but how to compare the password
entered with the encrypted

version if don't know the salt ??





Thanks,



Andras








No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.12.12/979 - Release Date: 29/08/2007 
20:21


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



RE: [PHP] crypt salt question

2007-08-30 Thread Jan Reiter
Hi!

How did you do the comparison with the PG_SQL database?? I believe there is
a UNIX function, able to retrieve the salt from a crypt string, or one that
can do the comparison, without a slat given. But I'm not quite sure. I'm
gonna investigate that. But how did you compare passwords before, when using
a time based "random" salt? I understand you use the CRYPT_STD_DES method
... 

Greets,
 Jan

-Original Message-
From: Andras Kende [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 30, 2007 11:42 PM
To: php-general@lists.php.net
Subject: [PHP] crypt salt question

Hello,

 

I'm trying to move some app from postgresql to mysql but unable to find out
how to authenticate

against the current crypted passwords with php..

 

insert to database:

 

$cset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./";
$salt = substr($cset, time() & 63, 1) . substr($cset, time()/64 & 63, 1);
$password = crypt($password, $salt);   //pass crypted version of password
for further processing



$result = pg_query ("INSERT INTO users (username, password) VALUES
('$username', '$password')");

 

I read the crypt is one way encryption but how to compare the password
entered with the encrypted 

version if don't know the salt ??

 

 

Thanks,

 

Andras

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



RE: [PHP] crypt salt question

2007-08-30 Thread Jan Reiter
No, I'm sorry, I spoke out that thought to early!! At the university we used
a PG_SQL database to store the passwords, and used the LDAP tree with all
the user information and stuff to store the salt as well! 

How do your scripts operate on that with the PG_SQL database before
migrating to mysql ...

Greets, 
 Jan

-Original Message-
From: Jan Reiter [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 31, 2007 12:07 AM
To: 'Andras Kende'; PHP Mailing List
Subject: RE: [PHP] crypt salt question

Hi!

How did you do the comparison with the PG_SQL database?? I believe there is
a UNIX function, able to retrieve the salt from a crypt string, or one that
can do the comparison, without a slat given. But I'm not quite sure. I'm
gonna investigate that. But how did you compare passwords before, when using
a time based "random" salt? I understand you use the CRYPT_STD_DES method
... 

Greets,
 Jan

-Original Message-
From: Andras Kende [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 30, 2007 11:42 PM
To: php-general@lists.php.net
Subject: [PHP] crypt salt question

Hello,

 

I'm trying to move some app from postgresql to mysql but unable to find out
how to authenticate

against the current crypted passwords with php..

 

insert to database:

 

$cset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./";
$salt = substr($cset, time() & 63, 1) . substr($cset, time()/64 & 63, 1);
$password = crypt($password, $salt);   //pass crypted version of password
for further processing



$result = pg_query ("INSERT INTO users (username, password) VALUES
('$username', '$password')");

 

I read the crypt is one way encryption but how to compare the password
entered with the encrypted 

version if don't know the salt ??

 

 

Thanks,

 

Andras

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



RE: [PHP] crypt salt question

2007-08-30 Thread Andras Kende

I figured out finally:)
Actually the random salt is always the first 2 character of the encryoted
password,
so this works fine now :





Thanks,

Andras



-Original Message-
From: Satyam [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 30, 2007 3:00 PM
To: Andras Kende; php-general@lists.php.net
Subject: Re: [PHP] crypt salt question

No chance.  Unless you have the salt stored along each password, your 
passwords are as good as random texts

Satyam



- Original Message - 
From: "Andras Kende" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, August 30, 2007 11:42 PM
Subject: [PHP] crypt salt question


> Hello,
>
>
>
> I'm trying to move some app from postgresql to mysql but unable to find 
> out
> how to authenticate
>
> against the current crypted passwords with php..
>
>
>
> insert to database:
>
>
>
> $cset = 
> "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./";
> $salt = substr($cset, time() & 63, 1) . substr($cset, time()/64 & 63, 1);
> $password = crypt($password, $salt);   //pass crypted version of password
> for further processing
>
>
>
> $result = pg_query ("INSERT INTO users (username, password) VALUES
> ('$username', '$password')");
>
>
>
> I read the crypt is one way encryption but how to compare the password
> entered with the encrypted
>
> version if don't know the salt ??
>
>
>
>
>
> Thanks,
>
>
>
> Andras
>
>






No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.484 / Virus Database: 269.12.12/979 - Release Date: 29/08/2007 
20:21

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



[PHP] Re: date formatting

2007-08-30 Thread Haydar TUNA
Hello,
 You can DATE_FORMAT MySQL Command in your SQL Query. For example:
select DATE_FORMAT(yourdatetimefield,'%Y-%m-%d') from yourtable

-- 
Republic Of Turkey - Ministry of National Education
Education Technology Department Ankara / TURKEY
Web: http://www.haydartuna.net

""Mike Ryan"" <[EMAIL PROTECTED]>, haber iletisinde þunlarý 
yazdý:[EMAIL PROTECTED]
>I would like to have my users input the date formate as mm-dd- mysql
> wants the data to come down as -mm-dd.
>
> The question I have is how do I convert from the mm-dd- to -mm-dd 
> so
> that I can write it out to the database? 

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



[PHP] PHP/MySQL not playing nicely. Server drops connection. . .

2007-08-30 Thread Michael Williams

Hi All,

I recently installed PHP, APACHE, MYSQL per the method at the  
following site:


http://switch.richard5.net/isp-in-a-box-v2/installing-mysql-on-mac-os-x/



. . .I then attempted to connect to a database (but without executing  
any commands on it), and I keep receiving the following error:




Safari can’t open the page “http://localhost/~michwill/folder/ 
validate_event.php” because the server unexpectedly dropped the  
connection, which sometimes occurs when the server is busy. You might  
be able to open the page later.



I'm really not sure what the problem is or what to do about it.  Can  
anyone help?  I've ensured that all passwords and ports are correct.   
I've also tried using MAMP, but it keeps telling me that I can't  
access the database with the "connect" commands I'm using (although  
I've adjusted them.  Anyway, any help would be much appreciated.



Regards,
Michael