Re: [PHP] Problem using APC

2008-09-11 Thread Nathan Nobbe
On Wed, Sep 10, 2008 at 11:38 PM, David Park [EMAIL PROTECTED] wrote:

 Hi All,

 I just installed APC on my server that is running PHP and the APC appears
 to
 be randomly crashing.  Below are the symptoms that my server is
 experiencing
 and the configuration of my system.  Has anyone seen this type of problem
 with APC and can you give me any advice to fix it?

 *Symptom #1 - APC appears to be stable but then restarts after a couple
 hours with no page requests*
 1. Reboot server
 2. Load apc.php.  It shows that the cache is empty except for one or two
 system files.  These are the files that are used to create the apc.php
 page.
 3. Load some other PHP pages.  And re-load apc.php after each pageview.
  The
 cache starts filling up with other cached items and the hit rate goes up.
 4. Leave the server alone for a couple hours.
 5. Load apc.php.  It shows that the cache is empty.  Also, the cache uptime
 is less than an hour - in other words, the cache appears to have restarted
 itself.


just curious, but have you really seen a reset after a couple of hours of
*inactivity* ?  i used to monitor apc.php closely when we deployed it at my
last job and every time it got past the size of the cache limit; it would
purge the cache.  i think thats very common.  how many files are you trying
to cache?  we needed to allocate roughly 200MB of memory for apc on our
production box to keep somewhere around 1000 files worth of opcode cache in
memory.  obviously theres no standard for files but thats how it worked for
us.

you can write a test script (javascript) to run through and start requesting
all the various files from your webserver; then apc will cache them, and you
can see how many it can hold before the cache needs to be purged.


 *Symptom #2 - APC restarts in the middle of serving some pages*
 1. Reboot server
 2. Load apc.php.  It shows that the cache is empty except for one or two
 system files.  These are the files that are used to create the apc.php
 page.
 3. Load some other PHP pages.  And re-load apc.php after each pageview.
  The
 cache starts filling up with other cached items and the hit rate goes up.
 4. On some of the PHP pages, however, apc.php shows that the cache has
 emptied and has started again.


 the only reason i know apc would purge the cache is reaching the limit on
cache size and then getting requests to cache new files.  there may be other
reasons it will automatically purge itself, and that could be something
worth asking on an apc dev list.  one thing you might try is adding some
user variables to the cache via the apc api, http://us.php.net/apc, maybe
you could check to see if those get cleared along w/ the opcode cache.  i
dunno if it really matters, but it could be interesting.

-nathan


Re: [PHP] Problem using APC

2008-09-11 Thread David Park
Hi Nathan,

Thanks for the advice.  I don't think that cache getting too full is the
problem because the system cache only got less than 10% full at the most.

On another note, thanks for letting me know about the PECL dev list.  I
didn't realize that that list exists.  I just sent my email to the PECL
list.  Maybe they can help me out there.

David

On Wed, Sep 10, 2008 at 11:17 PM, Nathan Nobbe [EMAIL PROTECTED]wrote:



 On Wed, Sep 10, 2008 at 11:38 PM, David Park [EMAIL PROTECTED] wrote:

 Hi All,

 I just installed APC on my server that is running PHP and the APC appears
 to
 be randomly crashing.  Below are the symptoms that my server is
 experiencing
 and the configuration of my system.  Has anyone seen this type of problem
 with APC and can you give me any advice to fix it?

 *Symptom #1 - APC appears to be stable but then restarts after a couple
 hours with no page requests*
 1. Reboot server
 2. Load apc.php.  It shows that the cache is empty except for one or two
 system files.  These are the files that are used to create the apc.php
 page.
 3. Load some other PHP pages.  And re-load apc.php after each pageview.
  The
 cache starts filling up with other cached items and the hit rate goes up.
 4. Leave the server alone for a couple hours.
 5. Load apc.php.  It shows that the cache is empty.  Also, the cache
 uptime
 is less than an hour - in other words, the cache appears to have restarted
 itself.


 just curious, but have you really seen a reset after a couple of hours of
 *inactivity* ?  i used to monitor apc.php closely when we deployed it at my
 last job and every time it got past the size of the cache limit; it would
 purge the cache.  i think thats very common.  how many files are you trying
 to cache?  we needed to allocate roughly 200MB of memory for apc on our
 production box to keep somewhere around 1000 files worth of opcode cache in
 memory.  obviously theres no standard for files but thats how it worked for
 us.

 you can write a test script (javascript) to run through and start
 requesting all the various files from your webserver; then apc will cache
 them, and you can see how many it can hold before the cache needs to be
 purged.


 *Symptom #2 - APC restarts in the middle of serving some pages*
 1. Reboot server
 2. Load apc.php.  It shows that the cache is empty except for one or two
 system files.  These are the files that are used to create the apc.php
 page.
 3. Load some other PHP pages.  And re-load apc.php after each pageview.
  The
 cache starts filling up with other cached items and the hit rate goes up.
 4. On some of the PHP pages, however, apc.php shows that the cache has
 emptied and has started again.


  the only reason i know apc would purge the cache is reaching the limit on
 cache size and then getting requests to cache new files.  there may be other
 reasons it will automatically purge itself, and that could be something
 worth asking on an apc dev list.  one thing you might try is adding some
 user variables to the cache via the apc api, http://us.php.net/apc, maybe
 you could check to see if those get cleared along w/ the opcode cache.  i
 dunno if it really matters, but it could be interesting.

 -nathan



Re: [PHP] The Best PHP Editor.

2008-09-11 Thread Jim Lucas

jmatt wrote:

Hi, I was using NVU to edit PHP but when I upload the index.php file back
there will always be a slight error in disorientation.
Example using NVU I edited the text just a bit then bam..The webpage became
really funny

What is the best to edit my PHP file?
Thanks

-
Popular free programming ebooks,free database ebooks,free OS ebooks download
at  http://www.ebook-x.com/ http://www.ebook-x.com/  


Check these out.  Just a few to point out.

http://www.nabble.com/PHP-editor-to9940374.html#a9940374
http://www.nabble.com/PHP-editor-to13692513.html#a13692513
http://www.nabble.com/Which-PHP-Editor-to-use--to11968056.html#a11968349
http://www.nabble.com/most-powerful-php-editor-to847.html#a8475670
http://www.nabble.com/PHP-editor-for-linux-to18985718.html#a18985718
http://www.nabble.com/Recommended-PHP-Editors--to16556258.html#a16556258

The site is an archive list of the PHP General mailing list.  It is search able.

http://www.nabble.com/PHP---General-f140.html

Jim

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



[PHP] Re: Interntet Explorer 8 beater 2

2008-09-11 Thread Colin Guthrie

Ross McKay wrote:

Michael McGlothlin wrote:

[...] I think web developers 
should look into a class action case against Microsoft for failing to 
make their browser standards compliant - it sure costs us a lot extra in 
development time. :p


Let me know where the PayPal donate button is... DW  I are fed up with
having to find nasty kludges for IE6 every time we build a website!


I think by the changing shape of the web, all browsers should have a 
sunset date in there beyond which they do not operate (either that or 
open a nag screen on every page load that is impossible to turn off 
(other than with a low level hack/patch to the binary - or obviously 
just a comment/recompile in open source ones!)).


It should be respected that browsers go out of date and beyond that time 
*noone* supports them, not their authors or the web developing public.


Col

--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]


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



Re: [PHP] Re: Interntet Explorer 8 beater 2

2008-09-11 Thread Luke
yeah, make an official no-support date. That would be great- it would help
with the whole IE6 problem.

It needs to be phased out, yet I know many companies that still haven't
upgraded to IE7 yet!

That's a big security problem as well as being a headache for all of us...

2008/9/11 Colin Guthrie [EMAIL PROTECTED]

 Ross McKay wrote:

 Michael McGlothlin wrote:

 [...] I think web developers should look into a class action case against
 Microsoft for failing to make their browser standards compliant - it sure
 costs us a lot extra in development time. :p


 Let me know where the PayPal donate button is... DW  I are fed up with
 having to find nasty kludges for IE6 every time we build a website!


 I think by the changing shape of the web, all browsers should have a sunset
 date in there beyond which they do not operate (either that or open a nag
 screen on every page load that is impossible to turn off (other than with a
 low level hack/patch to the binary - or obviously just a comment/recompile
 in open source ones!)).

 It should be respected that browsers go out of date and beyond that time
 *noone* supports them, not their authors or the web developing public.

 Col

 --

 Colin Guthrie
 gmane(at)colin.guthr.ie
 http://colin.guthr.ie/

 Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
 Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]


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




-- 
Luke Slater


Re: [PHP] Header() - POST

2008-09-11 Thread Luke
But surely you can post data with Javascript? Ach, at college now I can't
access my source, I forget how to do it exactly...

2008/9/11 mike [EMAIL PROTECTED]

 On Wed, Sep 10, 2008 at 3:42 PM, tedd [EMAIL PROTECTED] wrote:

  Then use cURL as was suggested before.

 the reply was on his original attempt to header(POST: /foo) ... that was
 it.

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




-- 
Luke Slater


Re: [PHP] Header() - POST

2008-09-11 Thread mike
On Thu, Sep 11, 2008 at 12:47 AM, Luke [EMAIL PROTECTED] wrote:
 But surely you can post data with Javascript? Ach, at college now I can't
 access my source, I forget how to do it exactly...

yes, i said javascript. something on the client side has to do it.
(well besides for a curl-based form post inside of php, but something
is telling the php script to do that to begin with)

header() in PHP is a command for the server to send a header to the
client. POST is an HTTP request verb...

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



Re: [PHP] ASCII Captcha

2008-09-11 Thread Peter Ford

Nathan Rixham wrote:

tedd wrote:

At 11:14 AM +0200 9/1/08, Nisse =?utf-8?Q?Engstr=C3=B6m?= wrote:

On Fri, 29 Aug 2008 16:11:01 -0400, tedd wrote:


 http://webbytedd.com/aa/assorted-captcha/


Some of these are really cool. Assuming they are
actually working, that is...

-snip- (bunch of errors)

I managed 1 out of 5. What do I win?

/Nisse


None of what you reported can be good.

I fixed the errors you spoke about except I could never get the 
Graphic CAPTCHA to fail.


Also, you're supposed to click the accessibility icon to get the 
page to speak the number.


Anything else?

Cheers,

tedd



why don't people just check for x/y co-ord's on an image submit instead?


Not so good if you're using lynx, or if you're blind, I guess.

--
Peter Ford  phone: 01580 89
Developer   fax:   01580 893399
Justcroft International Ltd., Staplehurst, Kent

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



[PHP] webmail or script for giga mail

2008-09-11 Thread luca
Hi, i'm looking for a webmail or script project with giga attachment
features, something like Tiscali mail. The email recipent receives
only a link, where it can downlod the file.
Do you know something about?

Thanks, Luca.

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



Re: [PHP] webmail or script for giga mail

2008-09-11 Thread Richard Heyes
 Hi, i'm looking for a webmail or script project with giga attachment
 features

Giga attachment features? Wossat?

-- 
Richard Heyes

HTML5 Graphing for IE7, FF, Chrome, Opera and Safari:
http://www.phpguru.org/RGraph

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



Re: [PHP] The Best PHP Editor.

2008-09-11 Thread Nathan Rixham

jmatt wrote:

Hi, I was using NVU to edit PHP but when I upload the index.php file back
there will always be a slight error in disorientation.
Example using NVU I edited the text just a bit then bam..The webpage became
really funny

What is the best to edit my PHP file?
Thanks

-
Popular free programming ebooks,free database ebooks,free OS ebooks download
at  http://www.ebook-x.com/ http://www.ebook-x.com/  


my preferences:
1- Eclipse with PDT
2- Nano/Textpad
3- Zend IDE (problems with memory on win though)
4- dreamweaver 8 code view

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



[PHP] Re: Interntet Explorer 8 beater 2

2008-09-11 Thread Ross McKay
On Thu, 11 Sep 2008 08:25:11 +0100, Colin Guthrie wrote:

[...]
It should be respected that browsers go out of date and beyond that time 
*noone* supports them, not their authors or the web developing public.

The worst thing about Vista is that not enough Win2K and WinXP (IE6)
users want to upgrade to it (and who can blame them?) The best thing
about Google Chrome is that maybe, just maybe, the tide will turn
against Microsoft Word as the tech-unsavvy move to this cloud
computing buzzword-paradise (onto Linux-based cheap PCs with no IE6!)

Ah, a man can dream, can't he?
-- 
Ross McKay, Toronto, NSW Australia
Hope is the dream o a foolish man - The Wee Book of Calvin

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



Re: [PHP] Re: Interntet Explorer 8 beater 2

2008-09-11 Thread Lester Caine

Luke wrote:

yeah, make an official no-support date. That would be great- it would help
with the whole IE6 problem.

It needs to be phased out, yet I know many companies that still haven't
upgraded to IE7 yet!

That's a big security problem as well as being a headache for all of us...


MOST of my council customers only have IE6 on their networks although I was 
asked the question 'Does it run on IE7' only recently. To which the answer is 
'Yes - but all the font sizes are too big!' Since the cost of replacing 
several thousand computers at each council to ones that could RUN XP is 
excessive and the current systems work fine then why should they upgrade? The 
cost will come out of OUR pockets at some point :(


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP] Re: Interntet Explorer 8 beater 2

2008-09-11 Thread Jochem Maas

Lester Caine schreef:

Luke wrote:
yeah, make an official no-support date. That would be great- it would 
help

with the whole IE6 problem.

It needs to be phased out, yet I know many companies that still haven't
upgraded to IE7 yet!

That's a big security problem as well as being a headache for all of 
us...


MOST of my council customers only have IE6 on their networks although I 
was asked the question 'Does it run on IE7' only recently. To which the 
answer is 'Yes - but all the font sizes are too big!'


wtf?

Since the cost of 
replacing several thousand computers at each council to ones that could 
RUN XP is excessive and the current systems work fine then why should 
they upgrade? The cost will come out of OUR pockets at some point :(





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



[PHP] Thank you...

2008-09-11 Thread Jason Pruim

Hey everyone,

Okay, so the first time I typed this out it got rejected for being off  
topic... so here is my attempt to make it on topic


?PHP

$day=Sept 11 2008;
While($day=date(NOW)){
echo HTML

Sorry for the off topic post... But I just wanted to say that if there  
is anyone on this list that either was in military service, or is  
currently serving, thank you It is because of YOUR efforts that I  
can sit here and write this e-mail in the freedom of my home.


And if anyone is near where I live in Michigan that has served, I'd be  
honored to buy you a beer... (It may take awhile to get through to  
everyone, since I'm not rich though.. hehehe)


So again, Thank you!
HTML;
}

if(isset($serviceperson)){
echo Thank you in so many ways I can't express!;
}elseif($serviceperson[1] ==beer){
echo Free beer for anyone in the service that is near me!;
}



?
--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
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] Readdir() question

2008-09-11 Thread Ben Stones
Hi,

I'm going to make a small browser based file system for ease of small
updates that I make frequently on my Website. First of all I want to loop
all the files on the same directory and to tell PHP read the same directory,
I think I'd need to use the magic constant I think its called, __DIR__ such
as:

?php
$dir=opendir(__DIR__);
while($files=readdir($dir)) {
echo $files;
}
?

But I get a few errors:

*Warning*: opendir(__DIR__) [function.opendir]: failed to open dir: No error
in *C:\wamp\www\Project1\index.php* on line *2*

*Warning*: readdir(): supplied argument is not a valid Directory resource in
*C:\wamp\www\Project1\index.php* on line *3

*Any help in the right direction will be appreciated!

Cheers.


Re: [PHP] Readdir() question

2008-09-11 Thread Stut

On 11 Sep 2008, at 13:12, Ben Stones wrote:

I'm going to make a small browser based file system for ease of small
updates that I make frequently on my Website. First of all I want  
to loop
all the files on the same directory and to tell PHP read the same  
directory,
I think I'd need to use the magic constant I think its called,  
__DIR__ such

as:

?php
$dir=opendir(__DIR__);
while($files=readdir($dir)) {
echo $files;
}
?

But I get a few errors:

*Warning*: opendir(__DIR__) [function.opendir]: failed to open dir:  
No error

in *C:\wamp\www\Project1\index.php* on line *2*

*Warning*: readdir(): supplied argument is not a valid Directory  
resource in

*C:\wamp\www\Project1\index.php* on line *3

*Any help in the right direction will be appreciated!


__DIR__ is not a valid constant (yet, I think it may be planned for  
5.3/6). You should be developing with notices on - this would have  
told you __DIR__ is wrong.


Use dirname(__FILE__) to get what you're after.

-Stut

--
http://stut.net/

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



RE: [PHP] Readdir() question

2008-09-11 Thread Jay Blanchard
[snip]
I'm going to make a small browser based file system for ease of small
updates that I make frequently on my Website. First of all I want to
loop
all the files on the same directory and to tell PHP read the same
directory,
I think I'd need to use the magic constant I think its called, __DIR__
such
as:

?php
$dir=opendir(__DIR__);
while($files=readdir($dir)) {
echo $files;
}
?

But I get a few errors:

*Warning*: opendir(__DIR__) [function.opendir]: failed to open dir: No
error
in *C:\wamp\www\Project1\index.php* on line *2*

*Warning*: readdir(): supplied argument is not a valid Directory
resource in
*C:\wamp\www\Project1\index.php* on line *3

*Any help in the right direction will be appreciated!
[/snip]

This really is not the proper use if __DIR__ as it is based on a file
that you are trying to open. This is equivalent to dirname(__FILE__).
which will give you the path of the __FILE__ and hence the directory of
that file. In your case you should specify the file path in $dir

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



Re: [PHP] Readdir() question

2008-09-11 Thread Jochem Maas

Ben Stones schreef:

Hi,

I'm going to make a small browser based file system for ease of small
updates that I make frequently on my Website. First of all I want to loop
all the files on the same directory and to tell PHP read the same directory,
I think I'd need to use the magic constant I think its called, __DIR__ such
as:


__DIR__ does not exist unless your using php5.3 ... and your not.

your still not bothering to develop with error_reporting set to 'full'
namely E_ALL | E_STRICT, probably it's set to E_ALL ^ E_NOTICE ... no idea what
I'm talking about?

read this: http://php.net/error_reporting



?php
$dir=opendir(__DIR__);
while($files=readdir($dir)) {
echo $files;
}
?

But I get a few errors:


code you write should check for errors, namely checking to see whether opendir()
failed or not, if it did fail output don't try to loop through the files using 
readdir(),
output an error message or something instead.



*Warning*: opendir(__DIR__) [function.opendir]: failed to open dir: No error
in *C:\wamp\www\Project1\index.php* on line *2*

*Warning*: readdir(): supplied argument is not a valid Directory resource in
*C:\wamp\www\Project1\index.php* on line *3

*Any help in the right direction will be appreciated!

Cheers.




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



Re: [PHP] Readdir() question

2008-09-11 Thread Nathan Rixham

Stut wrote:

On 11 Sep 2008, at 13:12, Ben Stones wrote:

I'm going to make a small browser based file system for ease of small
updates that I make frequently on my Website. First of all I want to loop
all the files on the same directory and to tell PHP read the same 
directory,
I think I'd need to use the magic constant I think its called, __DIR__ 
such

as:

?php
$dir=opendir(__DIR__);
while($files=readdir($dir)) {
echo $files;
}
?

But I get a few errors:

*Warning*: opendir(__DIR__) [function.opendir]: failed to open dir: No 
error

in *C:\wamp\www\Project1\index.php* on line *2*

*Warning*: readdir(): supplied argument is not a valid Directory 
resource in

*C:\wamp\www\Project1\index.php* on line *3

*Any help in the right direction will be appreciated!


__DIR__ is not a valid constant (yet, I think it may be planned for 
5.3/6). You should be developing with notices on - this would have told 
you __DIR__ is wrong.


Use dirname(__FILE__) to get what you're after.

-Stut


maybe this is into coding standards and ethics.. but this may be acceptable:
if( !defined('__DIR__') ) {
  define('__DIR__' , dirname(__FILE__));
}

however realistically you'd have to do this in every file and nto just 
in one include, as it changes on a per directory basis; hence why it'd 
/need/ to be a *magic* constant I guess :)


talked myself in and out of that one; but yet still worth a post i fear!

nath

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



[PHP] Re: Readdir() question

2008-09-11 Thread Carlos Medina

Ben Stones schrieb:

Hi,

I'm going to make a small browser based file system for ease of small
updates that I make frequently on my Website. First of all I want to loop
all the files on the same directory and to tell PHP read the same directory,
I think I'd need to use the magic constant I think its called, __DIR__ such
as:

?php
$dir=opendir(__DIR__);
while($files=readdir($dir)) {
echo $files;
}
?

But I get a few errors:

*Warning*: opendir(__DIR__) [function.opendir]: failed to open dir: No error
in *C:\wamp\www\Project1\index.php* on line *2*

*Warning*: readdir(): supplied argument is not a valid Directory resource in
*C:\wamp\www\Project1\index.php* on line *3

*Any help in the right direction will be appreciated!

Cheers.


Hi Ben,
if you are searching help, then here: www.php.net - this is the right 
direction



regards

Carlos

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



[PHP] Re: Interntet Explorer 8 beater 2

2008-09-11 Thread Colin Guthrie

Lester Caine wrote:
MOST of my council customers only have IE6 on their networks although I 
was asked the question 'Does it run on IE7' only recently. To which the 
answer is 'Yes - but all the font sizes are too big!' Since the cost of 
replacing several thousand computers at each council to ones that could 
RUN XP is excessive and the current systems work fine then why should 
they upgrade? The cost will come out of OUR pockets at some point :(



Why do they need to upgrade the whole OS just to upgrade a browser who's 
sunset date has been reached?


There are enough open source browsers out there that you can get a 
modern, standards compliant browser on older hardware without any problem.


If this date was built in from the start and was well known, there 
wouldn't be any problem. It's just trying to retrofit now that people 
start to think that it's a problem (and due to the general reluctance to 
keep prop. web apps up-to-date with modern browsers, this is partially 
correct, but like I say, if this was all known up front, these issues 
would all have been dealt with!)


Col


--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]


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



Re: [PHP] Thank you...

2008-09-11 Thread Micah Gersten
There is only 1 military service person that should be thanked for
actions on 9/11 and that is the man who was brave enough to disobey
orders and shoot down the flight over Pennsylvania.  The rest who were
involved obeyed orders and let chaos happen.
There are many military men and women who for action after 9/11 deserve
our thanks though.

Thank you,
Micah Gersten



Jason Pruim wrote:
 Hey everyone,

 Okay, so the first time I typed this out it got rejected for being off
 topic... so here is my attempt to make it on topic

 ?PHP

 $day=Sept 11 2008;
 While($day=date(NOW)){
 echo HTML

 Sorry for the off topic post... But I just wanted to say that if there
 is anyone on this list that either was in military service, or is
 currently serving, thank you It is because of YOUR efforts that I
 can sit here and write this e-mail in the freedom of my home.

 And if anyone is near where I live in Michigan that has served, I'd be
 honored to buy you a beer... (It may take awhile to get through to
 everyone, since I'm not rich though.. hehehe)

 So again, Thank you!
 HTML;
 }

 if(isset($serviceperson)){
 echo Thank you in so many ways I can't express!;
 }elseif($serviceperson[1] ==beer){
 echo Free beer for anyone in the service that is near me!;
 }



 ?
 -- 

 Jason Pruim
 Raoset Inc.
 Technology Manager
 MQC Specialist
 11287 James St
 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] Re: Interntet Explorer 8 beater 2

2008-09-11 Thread Jason Pruim


On Sep 11, 2008, at 8:53 AM, Colin Guthrie wrote:


Lester Caine wrote:
MOST of my council customers only have IE6 on their networks  
although I was asked the question 'Does it run on IE7' only  
recently. To which the answer is 'Yes - but all the font sizes are  
too big!' Since the cost of replacing several thousand computers at  
each council to ones that could RUN XP is excessive and the current  
systems work fine then why should they upgrade? The cost will come  
out of OUR pockets at some point :(



Why do they need to upgrade the whole OS just to upgrade a browser  
who's sunset date has been reached?


There are enough open source browsers out there that you can get a  
modern, standards compliant browser on older hardware without any  
problem.


If this date was built in from the start and was well known, there  
wouldn't be any problem. It's just trying to retrofit now that  
people start to think that it's a problem (and due to the general  
reluctance to keep prop. web apps up-to-date with modern browsers,  
this is partially correct, but like I say, if this was all known up  
front, these issues would all have been dealt with!)


It also would have taken care of the people who wrote the webapps that  
were specific to certain software.  I know large companies on their  
intranets have systems that only work with IE 6 which they spent a ton  
of money developing...


It sucks but it's the truth... I say make sure you write to open web  
standards and the entire internet will be better off :)



--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
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] Thank you...

2008-09-11 Thread Jason Pruim


On Sep 11, 2008, at 8:58 AM, Micah Gersten wrote:


There is only 1 military service person that should be thanked for
actions on 9/11 and that is the man who was brave enough to disobey
orders and shoot down the flight over Pennsylvania.  The rest who were
involved obeyed orders and let chaos happen.
There are many military men and women who for action after 9/11  
deserve

our thanks though.



Anyone that defends their country deserves their countries thanks and  
appreciation.




--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
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] Re: Interntet Explorer 8 beater 2

2008-09-11 Thread Micah Gersten
In the Microsoft world, you only support the latest couple of OSs, so
IE7 won't run on Win2k.

ank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Colin Guthrie wrote:
 Why do they need to upgrade the whole OS just to upgrade a browser
 who's sunset date has been reached?

 There are enough open source browsers out there that you can get a
 modern, standards compliant browser on older hardware without any
 problem.

 If this date was built in from the start and was well known, there
 wouldn't be any problem. It's just trying to retrofit now that people
 start to think that it's a problem (and due to the general reluctance
 to keep prop. web apps up-to-date with modern browsers, this is
 partially correct, but like I say, if this was all known up front,
 these issues would all have been dealt with!)

 Col



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



Re: [PHP] Thank you...

2008-09-11 Thread Micah Gersten
Agreed.  We have days to honor those people though, Veteran's Day and
Memorial Day.
I wish to state with absolute clarity that I am not degrading people in
the military service who do defend out country.  I have the utmost
respect for them.

Thank you,
Micah Gersten



Jason Pruim wrote:
 Anyone that defends their country deserves their countries thanks and
 appreciation.



 -- 

 Jason Pruim
 Raoset Inc.
 Technology Manager
 MQC Specialist
 11287 James St
 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] Readdir() question

2008-09-11 Thread Jochem Maas

Nathan Rixham schreef:

Stut wrote:

On 11 Sep 2008, at 13:12, Ben Stones wrote:

I'm going to make a small browser based file system for ease of small
updates that I make frequently on my Website. First of all I want to 
loop
all the files on the same directory and to tell PHP read the same 
directory,
I think I'd need to use the magic constant I think its called, 
__DIR__ such

as:

?php
$dir=opendir(__DIR__);
while($files=readdir($dir)) {
echo $files;
}
?

But I get a few errors:

*Warning*: opendir(__DIR__) [function.opendir]: failed to open dir: 
No error

in *C:\wamp\www\Project1\index.php* on line *2*

*Warning*: readdir(): supplied argument is not a valid Directory 
resource in

*C:\wamp\www\Project1\index.php* on line *3

*Any help in the right direction will be appreciated!


__DIR__ is not a valid constant (yet, I think it may be planned for 
5.3/6). You should be developing with notices on - this would have 
told you __DIR__ is wrong.


Use dirname(__FILE__) to get what you're after.

-Stut

maybe this is into coding standards and ethics.. but this may be 
acceptable:

if( !defined('__DIR__') ) {
  define('__DIR__' , dirname(__FILE__));
}

however realistically you'd have to do this in every file and nto just 
in one include


which would give an error on second and subsequent define()s

, as it changes on a per directory basis; hence why it'd 
/need/ to be a *magic* constant I guess :)


talked myself in and out of that one; but yet still worth a post i fear!


lol



nath




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



Re: [PHP] Header() - POST

2008-09-11 Thread Dan Joseph
I actually just completely re-engineered this page.  It made sense reading
what everyone had to say.  The extra page that I wanted to post to was
really not needed.  I have everything just contained in the one php script
now, and its working perfectly that way.  After it submits the order, it
then redirects to a confirmation page, rather than trying to validate,
rebuilt the post string, and then submitting that to another page for
processing and confirmation.  Just made more sense really.

In the future, though, if I find I need to do this, curl seemed to be the
best option.  I've used javascript in the past to do it, but it seemed
messy to me.

-- 
-Dan Joseph

www.canishosting.com - Plans start @ $1.99/month.

Build a man a fire, and he will be warm for the rest of the day.
Light a man on fire, and will be warm for the rest of his life.


Re: [PHP] Thank you...

2008-09-11 Thread Jochem Maas

Jason Pruim schreef:


On Sep 11, 2008, at 8:58 AM, Micah Gersten wrote:


There is only 1 military service person that should be thanked for
actions on 9/11 and that is the man who was brave enough to disobey
orders and shoot down the flight over Pennsylvania.  The rest who were
involved obeyed orders and let chaos happen.
There are many military men and women who for action after 9/11 deserve
our thanks though.



Anyone that defends their country deserves their countries thanks and 
appreciation.


and the war's in the middle east constitute defense in what way exactly?




--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
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] Thank you...

2008-09-11 Thread Jason Pruim


On Sep 11, 2008, at 9:13 AM, Jochem Maas wrote:


Jason Pruim schreef:

On Sep 11, 2008, at 8:58 AM, Micah Gersten wrote:

There is only 1 military service person that should be thanked for
actions on 9/11 and that is the man who was brave enough to disobey
orders and shoot down the flight over Pennsylvania.  The rest who  
were

involved obeyed orders and let chaos happen.
There are many military men and women who for action after 9/11  
deserve

our thanks though.

Anyone that defends their country deserves their countries thanks  
and appreciation.


and the war's in the middle east constitute defense in what way  
exactly?


Never said they did...

It's just today I wanted to say thank you to everyone that defends  
their country


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
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] Thank you...

2008-09-11 Thread Jay Blanchard
[snip]
and the war's in the middle east constitute defense in what way exactly?
[/snip]

Let's not let this degrade please.

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



Re: [PHP] Thank you...

2008-09-11 Thread Diogo Neves
On Thu, Sep 11, 2008 at 2:13 PM, Jochem Maas [EMAIL PROTECTED] wrote:

 Jason Pruim schreef:


 On Sep 11, 2008, at 8:58 AM, Micah Gersten wrote:

  There is only 1 military service person that should be thanked for
 actions on 9/11 and that is the man who was brave enough to disobey
 orders and shoot down the flight over Pennsylvania.  The rest who were
 involved obeyed orders and let chaos happen.
 There are many military men and women who for action after 9/11 deserve
 our thanks though.


 Anyone that defends their country deserves their countries thanks and
 appreciation.


 and the war's in the middle east constitute defense in what way exactly?


In the way that the petroil don't get out of america's companies? That their
economy don't get worser?




 --

 Jason Pruim
 Raoset Inc.
 Technology Manager
 MQC Specialist
 11287 James St
 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




-- 
Thanks,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


Re: [PHP] Thank you...

2008-09-11 Thread Diogo Neves
On Thu, Sep 11, 2008 at 2:18 PM, Jason Pruim [EMAIL PROTECTED] wrote:


 On Sep 11, 2008, at 9:13 AM, Jochem Maas wrote:

  Jason Pruim schreef:

 On Sep 11, 2008, at 8:58 AM, Micah Gersten wrote:

 There is only 1 military service person that should be thanked for
 actions on 9/11 and that is the man who was brave enough to disobey
 orders and shoot down the flight over Pennsylvania.  The rest who were
 involved obeyed orders and let chaos happen.
 There are many military men and women who for action after 9/11 deserve
 our thanks though.

  Anyone that defends their country deserves their countries thanks and
 appreciation.


 and the war's in the middle east constitute defense in what way exactly?


 Never said they did...

 It's just today I wanted to say thank you to everyone that defends their
 country


That said, that isn't defense, then they r not defending, and you can always
make a special list to thank people that r invading other contries anyway.



 --


 Jason Pruim
 Raoset Inc.
 Technology Manager
 MQC Specialist
 11287 James St
 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




-- 
Thanks,

Diogo Neves
Web Developer @ SAPO.pt by PrimeIT.pt


[PHP] Re: Interntet Explorer 8 beater 2

2008-09-11 Thread Colin Guthrie

Micah Gersten wrote:

In the Microsoft world, you only support the latest couple of OSs, so
IE7 won't run on Win2k.


What about FF, Opera, Chrome, Safari? Do *any* of those work? If not, 
then it wouldn't take long to get one of them working if IE had a sunset 
date in it. Then you'd see how quickly MS responded with making IEx work 
on their older OSes (and simply recompiling IE6 with a newer sunset 
date should not be allowed!) I'm not sure how you would police it, but 
there should be a badge of honour associated with the system in some 
way, probably overseen by W3C.


Col

--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]


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



Re: [PHP] Thank you...

2008-09-11 Thread Jason Pruim
Okay... I am sorry that I even sent the message. 7 years ago today, My  
Uncle died because he worked in the south tower on the 93rd floor  
All I wanted to do was say thank you to the WORLDS armed forces for  
feeling the call to protect their country from what ever enemy was at  
their gates Even to the point of thanking the iraqi army for  
defending their country against America


LET THIS END HERE PLEASE!


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
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] Thank you...

2008-09-11 Thread Aschwin Wesselius

Jochem Maas wrote:

Jason Pruim schreef:


On Sep 11, 2008, at 8:58 AM, Micah Gersten wrote:


There is only 1 military service person that should be thanked for
actions on 9/11 and that is the man who was brave enough to disobey
orders and shoot down the flight over Pennsylvania.  The rest who were
involved obeyed orders and let chaos happen.
There are many military men and women who for action after 9/11 deserve
our thanks though.



Anyone that defends their country deserves their countries thanks and 
appreciation.


and the war's in the middle east constitute defense in what way exactly?

Hi,

I'm not an American (nor I ever will be), but GW declared the War 
himself, so he started it. There's no defense if you start a war and 
start attacking another country on behalf of it's citizens.


What these called 'terrorists' was not on behalf on any countries 
authorities. BTW, I still think 9/11 is inflicted by the government of 
the U.S. of A. themselves, because a lot points towards their 
involvement and none points to anyone like Bin Laden..


Or try to anwser at least some of these questions:

http://www.rense.com/general24/t500.htm

If you want to get free from your government, check out these pages and 
at least know your rights:


http://www.thinkfree.ca/
http://spiritualeconomicsnow.net/
--

Aschwin Wesselius

/'What you would like to be done to you, do that to the other'/


Re: [PHP] Thank you...

2008-09-11 Thread Dan Joseph
On Thu, Sep 11, 2008 at 9:23 AM, Jason Pruim [EMAIL PROTECTED] wrote:

 Okay... I am sorry that I even sent the message. 7 years ago today, My
 Uncle died because he worked in the south tower on the 93rd floor All I
 wanted to do was say thank you to the WORLDS armed forces for feeling the
 call to protect their country from what ever enemy was at their gates
 Even to the point of thanking the iraqi army for defending their country
 against America

 LET THIS END HERE PLEASE!



 --

 Jason Pruim
 Raoset Inc.
 Technology Manager
 MQC Specialist
 11287 James St
 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


Jason, you have nothing to be sorry for.  The post was good.  There's always
1-2 guys in every crowd that are going to say something inappropriate.  Just
ignore 'em.

Have you all seen the picture of the new battle cruiser built out of the
scrap metal from the towers?

-- 
-Dan Joseph

www.canishosting.com - Plans start @ $1.99/month.

Build a man a fire, and he will be warm for the rest of the day.
Light a man on fire, and will be warm for the rest of his life.


Re: [PHP] Thank you...

2008-09-11 Thread Carlos Medina

Dan Joseph schrieb:

On Thu, Sep 11, 2008 at 9:23 AM, Jason Pruim [EMAIL PROTECTED] wrote:


Okay... I am sorry that I even sent the message. 7 years ago today, My
Uncle died because he worked in the south tower on the 93rd floor All I
wanted to do was say thank you to the WORLDS armed forces for feeling the
call to protect their country from what ever enemy was at their gates
Even to the point of thanking the iraqi army for defending their country
against America

LET THIS END HERE PLEASE!



--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
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



Jason, you have nothing to be sorry for.  The post was good.  There's always
1-2 guys in every crowd that are going to say something inappropriate.  Just
ignore 'em.

Have you all seen the picture of the new battle cruiser built out of the
scrap metal from the towers?


Hi @all,
what about a generally to shut up. More Respect please.

Regards

Carlos

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



RE: [PHP] Thank you...

2008-09-11 Thread Jay Blanchard
[snip]
what about a generally to shut up. More Respect please.
[/snip]

I will ask againplease do not let this degrade.

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



Re: [PHP] Thank you...

2008-09-11 Thread Micah Gersten
Jason, I think you just mentioned what we should remember today.  The
victims that lost their lives.  I think everyone can agree that it was a
tragedy.
My condolences to you and all the other familes.

Thank you,
Micah Gersten



Jason Pruim wrote:
 Okay... I am sorry that I even sent the message. 7 years ago today, My
 Uncle died because he worked in the south tower on the 93rd floor
 All I wanted to do was say thank you to the WORLDS armed forces for
 feeling the call to protect their country from what ever enemy was at
 their gates Even to the point of thanking the iraqi army for
 defending their country against America

 LET THIS END HERE PLEASE!


 -- 

 Jason Pruim
 Raoset Inc.
 Technology Manager
 MQC Specialist
 11287 James St
 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] Re: Interntet Explorer 8 beater 2

2008-09-11 Thread Ross McKay
On Thu, 11 Sep 2008 14:22:30 +0100, Colin Guthrie wrote:

[...] I'm not sure how you would police it, but 
there should be a badge of honour associated with the system in some 
way, probably overseen by W3C.

Like this?

http://en.wikipedia.org/wiki/Acid2
-- 
Ross McKay, Toronto, NSW Australia
You can't control what you can't measure - Tom DeMarco

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



RE: [PHP] Thank you...

2008-09-11 Thread Per Jessen
Jay Blanchard wrote:

 [snip]
 and the war's in the middle east constitute defense in what way
 exactly?
 [/snip]
 
 Let's not let this degrade please.
 

The OP presumably knew what he was doing - given the polarized views on
this, this thread was bound to degrade very quickly.  Just stop. 


/Per Jessen, Zürich


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



[PHP] Why MS Won't Retire Browsers -- was: Interntet Explorer 8 beater 2

2008-09-11 Thread Micah Gersten
The problem is that if you're running on older hardware, IE7 might be
too CPU intensive to run correctly.  That's why MS won't set Sunset
Dates for an old browser.  They instead set the Sunset Dates for the OS
and that's how they make things out of date.  They say upgrade the OS. 
Matter of philosophy.  The problem is that the new OS won't run on the
old hardware and costs lots of money so people don't upgrade.  Remember,
MS is for profit.  If you can just upgrade your browser, they don't make
any money.  If you upgrade your OS, they do.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Colin Guthrie wrote:
 What about FF, Opera, Chrome, Safari? Do *any* of those work? If not,
 then it wouldn't take long to get one of them working if IE had a
 sunset date in it. Then you'd see how quickly MS responded with making
 IEx work on their older OSes (and simply recompiling IE6 with a
 newer sunset date should not be allowed!) I'm not sure how you would
 police it, but there should be a badge of honour associated with the
 system in some way, probably overseen by W3C.

 Col


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



[PHP] Securing pages sections

2008-09-11 Thread Dan Joseph
Hi All,

This is more of a logic/opinion question...  I want to get some fresh ideas.

I am working on a system to manage quotes and orders.  I have many users,
all different levels, and want to secure pages based on active session, user
level, and then go as far as putting access keys on a given page to only
give it access to those people with the key can access the page.

I'd like to know what others are doing from a logic stand point.

I've gone as far as creating a couple tables:

SecurityKeys

- SecurityKeyID
- KeyName
- KeyLevel
- IsActive

SecurityKeysAssigned
- AssignedID
- EmployeeID
- SecurityKeyID

Would anyone suggest a different strategy to the database portion?  Maybe
additions or subtractions to the tables?

Also, how would go about implementing them the key system?

Again, I am looking for some opinions or experiences anyone has had doing
this.

Thanks!

-- 
-Dan Joseph

www.canishosting.com - Plans start @ $1.99/month.

Build a man a fire, and he will be warm for the rest of the day.
Light a man on fire, and will be warm for the rest of his life.


Re: [PHP] Why MS Won't Retire Browsers -- was: Interntet Explorer 8 beater 2

2008-09-11 Thread Wolf
 Micah Gersten [EMAIL PROTECTED] wrote: 
 The problem is that if you're running on older hardware, IE7 might be
 too CPU intensive to run correctly.  That's why MS won't set Sunset
 Dates for an old browser.  They instead set the Sunset Dates for the OS
 and that's how they make things out of date.  They say upgrade the OS. 
 Matter of philosophy.  The problem is that the new OS won't run on the
 old hardware and costs lots of money so people don't upgrade.  Remember,
 MS is for profit.  If you can just upgrade your browser, they don't make
 any money.  If you upgrade your OS, they do.

My last upgrade was from XP to Ubuntu.  :)

And believe it or not, if you want to test your test on Ubuntu there is an IE 
for it or you can just WINE things.  :)

Wolf

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



Re: [PHP] Securing pages sections

2008-09-11 Thread Wolf

 Dan Joseph [EMAIL PROTECTED] wrote: 
 Hi All,
 
 This is more of a logic/opinion question...  I want to get some fresh ideas.
 
 I am working on a system to manage quotes and orders.  I have many users,
 all different levels, and want to secure pages based on active session, user
 level, and then go as far as putting access keys on a given page to only
 give it access to those people with the key can access the page.
 
 I'd like to know what others are doing from a logic stand point.
 
 I've gone as far as creating a couple tables:
 
 SecurityKeys
 
 - SecurityKeyID
 - KeyName
 - KeyLevel
 - IsActive
 
 SecurityKeysAssigned
 - AssignedID
 - EmployeeID
 - SecurityKeyID
 
 Would anyone suggest a different strategy to the database portion?  Maybe
 additions or subtractions to the tables?
 
 Also, how would go about implementing them the key system?
 
 Again, I am looking for some opinions or experiences anyone has had doing
 this.

I have a quote system I developed many years ago.

It uses Sessions and sets the pricing per other defined rules in the table on 
the products.  I have set percentages so that someone who doesn't get the deals 
gets the full price and each deal after that gets tweaked.  When updating the 
product you can either set the price point for the rest, or set the percentages 
and the forms do the work.

You use the sessions and check to see if active.  You have a temp table that 
runs while people are shopping and the quotes/orders are saved with the 
date,time,userID and tied in the DB to the user so that I easily get a set of 
links to them.

HTH,
Wolf

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



[PHP] Mysqli issue

2008-09-11 Thread Jason Pruim

No political undertones in this one I promise! :)

Attempting to setup a prepared statement in php that will update a  
record in a mysql database using mysqli


Here is the relevant code:
$stmt = mysqli_stmt_init($link);
	mysqli_stmt_prepare($stmt, UPDATE purl.schreur (FName, LName, email,  
phone, record, subscribed, date, IPAddress, Business, Address1, City,  
State, Zip, Coffee, Meeting, areaPlans) VALUES  
(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?));


	mysqli_stmt_bind_param($stmt, 'ss',  
$_POST['txtFName'], $_POST['txtLName'], $_POST['txtEmail'],  
$_POST['txtPhone'], $_POST['txturl'], $_POST['record'],  
$_POST['subscribed'],$date, $_SERVER['REMOTE_ADDR'],  
$_POST['txtBusiness'], $_POST['txtAddress1'], $_POST['txtCity'],  
$_POST['txtState'], $_POST['txtZip'], $_POST['rdoCoffee'],  
$_POST['rdoTime'], $_POST['areaPlans']) ;//or die(mysqli_error($link));

echo BRDump of stmt:BR;

mysqli_stmt_execute($stmt) or die(mysqli_error($link));

Here is my error message:

You have an error in your SQL syntax; check the manual that  
corresponds to your MySQL server version for the right syntax to use  
near '(FName, LName, email, phone, record, subscribed, date,  
IPAddress, Business, Addr' at line 1


Now I may just be being dense but I can't figure out the problem...  
Migraines are not helping right now though


Can anyone see my stupid mistake? :)



--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
Holland, MI 49424
www.raoset.com
[EMAIL PROTECTED]






[PHP] Re: Google Maps Distance Between UK Postcodes

2008-09-11 Thread tedd

At 5:37 PM +0100 9/1/08, Colin Guthrie wrote:

Tom Chubb wrote:

That's all way above my head, but I think I'll be able to understand it
after a strong coffee!


I should point out that this is really just trig and is only an 
approximate distance as the crow flies. Not even sure if it takes 
the curvature of the earth into consideration, but it's probably 
good enough for most things.



I've reviewed your code and it does not include the curvature of the 
earth -- it's a flat surface computation.


Considering that my other profession is Geophysicist, I'm kind of up 
on those sort of things. The Earth is an oblate spheroid and the 
computation to include the curvature of the earth would be a bit more 
involved.


But, I agree that your computation should be good enough for most things.

Cheers,

tedd

Here's yet another get distance thing from lat/long, but it's for miles.

 function getDistance($lat1, $lon1, $lat2, $lon2)
{
$rad  = doubleval(pi()/180.0);

$lon1 = doubleval($lon1) * $rad;
$lat1 = doubleval($lat1) * $rad;
$lon2 = doubleval($lon2) * $rad;
$lat2 = doubleval($lat2) * $rad;

$theta = $lon2 - $lon1;
	$distance = acos(sin($lat1) * sin($lat2) + cos($lat1) * 
cos($lat2) * cos($theta));


if ($distance  0)
{
$distance += pi();
}

$distance  = $distance * 6371.2;
$miles   = doubleval($distance * 0.621);
$distance  = sprintf(%.2f, $distance);
$miles   = sprintf(%.4f, $miles);

return $miles;
}


--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Securing pages sections

2008-09-11 Thread Per Jessen
Dan Joseph wrote:

 Again, I am looking for some opinions or experiences anyone has had
 doing this.

Define your access policies as area+type, e.g. sales, readonly. Than
attach policies to users, maybe groups of users. 

For each page or section of a page, check that the current user has the
necessary access. 


/Per Jessen, Zürich


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



[PHP] Re: Google Maps Distance Between UK Postcodes

2008-09-11 Thread tedd

At 5:37 PM +0100 9/1/08, Colin Guthrie wrote:

Tom Chubb wrote:

That's all way above my head, but I think I'll be able to understand it
after a strong coffee!


I should point out that this is really just trig and is only an 
approximate distance as the crow flies. Not even sure if it takes 
the curvature of the earth into consideration, but it's probably 
good enough for most things.


Oh, I forgot to add -- I use it for this:

http://php1.net/b/zipcode/

This plugs into a zip code dB that has the center of the zip code in 
lats and longs.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Mysqli issue

2008-09-11 Thread Stut

On 11 Sep 2008, at 16:15, Jason Pruim wrote:
Attempting to setup a prepared statement in php that will update a  
record in a mysql database using mysqli


Here is the relevant code:
$stmt = mysqli_stmt_init($link);
	mysqli_stmt_prepare($stmt, UPDATE purl.schreur (FName, LName,  
email, phone, record, subscribed, date, IPAddress, Business,  
Address1, City, State, Zip, Coffee, Meeting, areaPlans) VALUES  
(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?));


	mysqli_stmt_bind_param($stmt, 'ss', $_POST 
['txtFName'], $_POST['txtLName'], $_POST['txtEmail'], $_POST 
['txtPhone'], $_POST['txturl'], $_POST['record'], $_POST 
['subscribed'],$date, $_SERVER['REMOTE_ADDR'], $_POST 
['txtBusiness'], $_POST['txtAddress1'], $_POST['txtCity'], $_POST 
['txtState'], $_POST['txtZip'], $_POST['rdoCoffee'], $_POST 
['rdoTime'], $_POST['areaPlans']) ;//or die(mysqli_error($link));

echo BRDump of stmt:BR;

mysqli_stmt_execute($stmt) or die(mysqli_error($link));

Here is my error message:

You have an error in your SQL syntax; check the manual that  
corresponds to your MySQL server version for the right syntax to  
use near '(FName, LName, email, phone, record, subscribed, date,  
IPAddress, Business, Addr' at line 1


Now I may just be being dense but I can't figure out the problem...  
Migraines are not helping right now though


Can anyone see my stupid mistake? :)


That's the syntax for an insert statement. Suggest you read this:  
http://dev.mysql.com/doc/refman/5.0/en/update.html


-Stut

--
http://stut.net/

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



Re: [PHP] Re: Google Maps Distance Between UK Postcodes

2008-09-11 Thread Jason Pruim


On Sep 11, 2008, at 11:19 AM, tedd wrote:


At 5:37 PM +0100 9/1/08, Colin Guthrie wrote:

Tom Chubb wrote:
That's all way above my head, but I think I'll be able to  
understand it

after a strong coffee!


I should point out that this is really just trig and is only an  
approximate distance as the crow flies. Not even sure if it takes  
the curvature of the earth into consideration, but it's probably  
good enough for most things.


Oh, I forgot to add -- I use it for this:

http://php1.net/b/zipcode/

This plugs into a zip code dB that has the center of the zip code in  
lats and longs.


Cheers,

tedd



In regards to your php1.net/b/zipcode/ ... I think I may have found a  
bug :) zipcode 49422 does not show up as being within 10 miles of  
49424 even though 49423 does. FYI, 49422 is the zipcode for holland,  
mi PO BOXES so I'm not sure if your database has that included or  
not...  Or where they would even register the lat/lon... I would  
assume at the holland post office.. but I could be wrong.



--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
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] Mysqli issue

2008-09-11 Thread Wolf
 Jason Pruim [EMAIL PROTECTED] wrote: 
 No political undertones in this one I promise! :)
 
 Attempting to setup a prepared statement in php that will update a  
 record in a mysql database using mysqli
 
 Here is the relevant code:
   $stmt = mysqli_stmt_init($link);
   mysqli_stmt_prepare($stmt, UPDATE purl.schreur (FName, LName, email,  
 phone, record, subscribed, date, IPAddress, Business, Address1, City,  
 State, Zip, Coffee, Meeting, areaPlans) VALUES  
 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?));
   
   mysqli_stmt_bind_param($stmt, 'ss',  
 $_POST['txtFName'], $_POST['txtLName'], $_POST['txtEmail'],  
 $_POST['txtPhone'], $_POST['txturl'], $_POST['record'],  
 $_POST['subscribed'],$date, $_SERVER['REMOTE_ADDR'],  
 $_POST['txtBusiness'], $_POST['txtAddress1'], $_POST['txtCity'],  
 $_POST['txtState'], $_POST['txtZip'], $_POST['rdoCoffee'],  
 $_POST['rdoTime'], $_POST['areaPlans']) ;//or die(mysqli_error($link));
   echo BRDump of stmt:BR;
   
   mysqli_stmt_execute($stmt) or die(mysqli_error($link));
 
 Here is my error message:
 
 You have an error in your SQL syntax; check the manual that  
 corresponds to your MySQL server version for the right syntax to use  
 near '(FName, LName, email, phone, record, subscribed, date,  
 IPAddress, Business, Addr' at line 1
 
 Now I may just be being dense but I can't figure out the problem...  
 Migraines are not helping right now though
 
 Can anyone see my stupid mistake? :)

OK, you asked for it...

You aren't checking your stuff before dumping it.  None of it...

So, you should be taking the post variables and slapping them into a checker.

Then, your statement should be more along the lines of:
mysqli_stmt_bind_param($stmt, 
'ss','$txtFName','$txtLName','$txtEmail','$txtPhone','$txturl','$record','$subscribed',$date,
 
'$REMOTE_ADDR','$txtBusiness','$txtAddress1','$txtCity','$txtState','$txtZip','$rdoCoffee','$rdoTime','$areaPlans')
 ;

HTH,
Wolf

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



Re: [PHP] Re: Google Maps Distance Between UK Postcodes

2008-09-11 Thread mike
On Thu, Sep 11, 2008 at 8:17 AM, tedd [EMAIL PROTECTED] wrote:

 Considering that my other profession is Geophysicist, I'm kind of up on
 those sort of things. The Earth is an oblate spheroid and the computation to
 include the curvature of the earth would be a bit more involved.

what do you think of the code i mentioned earlier?

$distance = number_format(ceil(69*rad2deg(acos(sin(deg2rad($ulat)) *
sin(deg2rad($vlat)) + cos(deg2rad($ulat)) * cos(deg2rad($vlat)) *
cos(deg2rad($ulong - $vlong));

where:

$ulat = latitude of user #1
$ulong = longitude of user #1

$vlat = latitude of user #2
$vlong = longitude of user #2

I took the very popular mysql query (at the time) that supposedly
works with a sphere and mapped it to php functions and it has appeared
to work very well. I have only tested with US zip codes, but the
concept should be the same as long as lat/long are centered properly.

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



Re: [PHP] Mysqli issue

2008-09-11 Thread Jason Pruim


On Sep 11, 2008, at 11:29 AM, Wolf wrote:


 Jason Pruim [EMAIL PROTECTED] wrote:

No political undertones in this one I promise! :)

Attempting to setup a prepared statement in php that will update a
record in a mysql database using mysqli

Here is the relevant code:
$stmt = mysqli_stmt_init($link);
	mysqli_stmt_prepare($stmt, UPDATE purl.schreur (FName, LName,  
email,

phone, record, subscribed, date, IPAddress, Business, Address1, City,
State, Zip, Coffee, Meeting, areaPlans) VALUES
(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?));

mysqli_stmt_bind_param($stmt, 'ss',
$_POST['txtFName'], $_POST['txtLName'], $_POST['txtEmail'],
$_POST['txtPhone'], $_POST['txturl'], $_POST['record'],
$_POST['subscribed'],$date, $_SERVER['REMOTE_ADDR'],
$_POST['txtBusiness'], $_POST['txtAddress1'], $_POST['txtCity'],
$_POST['txtState'], $_POST['txtZip'], $_POST['rdoCoffee'],
$_POST['rdoTime'], $_POST['areaPlans']) ;//or  
die(mysqli_error($link));

echo BRDump of stmt:BR;

mysqli_stmt_execute($stmt) or die(mysqli_error($link));

Here is my error message:

You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near '(FName, LName, email, phone, record, subscribed, date,
IPAddress, Business, Addr' at line 1

Now I may just be being dense but I can't figure out the problem...
Migraines are not helping right now though

Can anyone see my stupid mistake? :)


OK, you asked for it...

You aren't checking your stuff before dumping it.  None of it...


My understanding is that mysqli prepared statements took care of most  
of that. I do need to learn a little more about that though to be sure.





So, you should be taking the post variables and slapping them into a  
checker.


Then, your statement should be more along the lines of:
mysqli_stmt_bind_param($stmt,  
'ss 
','$ 
txtFName 
','$ 
txtLName','$txtEmail','$txtPhone','$txturl','$record','$subscribed', 
$date,  
'$ 
REMOTE_ADDR 
','$ 
txtBusiness 
','$ 
txtAddress1 
','$ 
txtCity','$txtState','$txtZip','$rdoCoffee','$rdoTime','$areaPlans') ;


Isn't that just a style difference though? Does it matter if I pull  
from $_POST['txtZip'], $txtZip, or $Zip? Assuming that I am properly  
escaping/protecting against sql injection?


And yes I really am interested :)


--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
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] Mysqli issue

2008-09-11 Thread Stut

On 11 Sep 2008, at 16:29, Wolf wrote:

 Jason Pruim [EMAIL PROTECTED] wrote:

No political undertones in this one I promise! :)

Attempting to setup a prepared statement in php that will update a
record in a mysql database using mysqli

Here is the relevant code:
$stmt = mysqli_stmt_init($link);
	mysqli_stmt_prepare($stmt, UPDATE purl.schreur (FName, LName,  
email,

phone, record, subscribed, date, IPAddress, Business, Address1, City,
State, Zip, Coffee, Meeting, areaPlans) VALUES
(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?));

mysqli_stmt_bind_param($stmt, 'ss',
$_POST['txtFName'], $_POST['txtLName'], $_POST['txtEmail'],
$_POST['txtPhone'], $_POST['txturl'], $_POST['record'],
$_POST['subscribed'],$date, $_SERVER['REMOTE_ADDR'],
$_POST['txtBusiness'], $_POST['txtAddress1'], $_POST['txtCity'],
$_POST['txtState'], $_POST['txtZip'], $_POST['rdoCoffee'],
$_POST['rdoTime'], $_POST['areaPlans']) ;//or die(mysqli_error 
($link));

echo BRDump of stmt:BR;

mysqli_stmt_execute($stmt) or die(mysqli_error($link));

Here is my error message:

You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near '(FName, LName, email, phone, record, subscribed, date,
IPAddress, Business, Addr' at line 1

Now I may just be being dense but I can't figure out the problem...
Migraines are not helping right now though

Can anyone see my stupid mistake? :)


OK, you asked for it...

You aren't checking your stuff before dumping it.  None of it...

So, you should be taking the post variables and slapping them into  
a checker.


Then, your statement should be more along the lines of:
mysqli_stmt_bind_param($stmt,  
'ss','$txtFName','$txtLName','$txtEmail','$txtPhone',' 
$txturl','$record','$subscribed',$date,  
'$REMOTE_ADDR','$txtBusiness','$txtAddress1','$txtCity','$txtState','$ 
txtZip','$rdoCoffee','$rdoTime','$areaPlans') ;


I think you're the one who's asking for it... I don't really think  
Jason wants to insert '$txtFName' as the name. I'm just guessing, but  
it's a fair bet. If you're going to offer advice to someone be sure  
to check your message thoroughly before sending it!!


To address your actual point, there's no particular reason why that  
input should be being checked at all. Maybe Jason wants to use  
exactly what the user is entering. Nothing wrong with that so long as  
it's properly escaped when being displayed.


-Stut

--
http://stut.net/

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



Re: [PHP] Re: Google Maps Distance Between UK Postcodes

2008-09-11 Thread Nathan Rixham

tedd wrote:

At 5:37 PM +0100 9/1/08, Colin Guthrie wrote:

Tom Chubb wrote:

That's all way above my head, but I think I'll be able to understand it
after a strong coffee!


I should point out that this is really just trig and is only an 
approximate distance as the crow flies. Not even sure if it takes the 
curvature of the earth into consideration, but it's probably good 
enough for most things.


Oh, I forgot to add -- I use it for this:

http://php1.net/b/zipcode/

This plugs into a zip code dB that has the center of the zip code in 
lats and longs.


Cheers,

tedd



I've got code to cal all of this it's rather simple actually - I'll fire 
it through when i get back from work.


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



Re: [PHP] Mysqli issue

2008-09-11 Thread Wolf
!-- SNIP --
  Attempting to setup a prepared statement in php that will update a
  record in a mysql database using mysqli
 
  Here is the relevant code:
 $stmt = mysqli_stmt_init($link);
 mysqli_stmt_prepare($stmt, UPDATE purl.schreur (FName, LName,  
  email,
  phone, record, subscribed, date, IPAddress, Business, Address1, City,
  State, Zip, Coffee, Meeting, areaPlans) VALUES
  (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?));
 
 mysqli_stmt_bind_param($stmt, 'ss',
  $_POST['txtFName'], $_POST['txtLName'], $_POST['txtEmail'],
  $_POST['txtPhone'], $_POST['txturl'], $_POST['record'],
  $_POST['subscribed'],$date, $_SERVER['REMOTE_ADDR'],
  $_POST['txtBusiness'], $_POST['txtAddress1'], $_POST['txtCity'],
  $_POST['txtState'], $_POST['txtZip'], $_POST['rdoCoffee'],
  $_POST['rdoTime'], $_POST['areaPlans']) ;//or die(mysqli_error 
  ($link));
 echo BRDump of stmt:BR;

!-- SNIP --
  Then, your statement should be more along the lines of:
  mysqli_stmt_bind_param($stmt,  
  'ss','$txtFName','$txtLName','$txtEmail','$txtPhone',' 
  $txturl','$record','$subscribed',$date,  
  '$REMOTE_ADDR','$txtBusiness','$txtAddress1','$txtCity','$txtState','$ 
  txtZip','$rdoCoffee','$rdoTime','$areaPlans') ;
 

Double DOH here...

I was looking at my MySQL not MySQLi stuff, and there is some differences...  
Must be the cold drugs/

'$var' definitely should have been $var since you want the contents, but 
according to the php site, the prepare is for the query, so my guess is you'll 
want the query put in the line instead of what looks to be the pieces of the 
insert?
http://us2.php.net/manual/en/mysqli-stmt.prepare.php

mysqli_stmt_prepare($stmt, 'SELECT District FROM City WHERE Name=?')

Of course, you could do the 
Query=insert into TABLE values($var,$var.);
mysqli_stmt_prepare($stmt, $Query);

I'm gonna go drink more cold drugs now...

Wolf

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



Re: [PHP] Mysqli issue

2008-09-11 Thread Jason Pruim


On Sep 11, 2008, at 11:23 AM, Stut wrote:


On 11 Sep 2008, at 16:15, Jason Pruim wrote:
Attempting to setup a prepared statement in php that will update a  
record in a mysql database using mysqli


Here is the relevant code:
$stmt = mysqli_stmt_init($link);
	mysqli_stmt_prepare($stmt, UPDATE purl.schreur (FName, LName,  
email, phone, record, subscribed, date, IPAddress, Business,  
Address1, City, State, Zip, Coffee, Meeting, areaPlans) VALUES  
(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?));


	mysqli_stmt_bind_param($stmt, 'ss',  
$_POST['txtFName'], $_POST['txtLName'], $_POST['txtEmail'],  
$_POST['txtPhone'], $_POST['txturl'], $_POST['record'],  
$_POST['subscribed'],$date, $_SERVER['REMOTE_ADDR'],  
$_POST['txtBusiness'], $_POST['txtAddress1'], $_POST['txtCity'],  
$_POST['txtState'], $_POST['txtZip'], $_POST['rdoCoffee'],  
$_POST['rdoTime'], $_POST['areaPlans']) ;//or  
die(mysqli_error($link));

echo BRDump of stmt:BR;

mysqli_stmt_execute($stmt) or die(mysqli_error($link));

Here is my error message:

You have an error in your SQL syntax; check the manual that  
corresponds to your MySQL server version for the right syntax to  
use near '(FName, LName, email, phone, record, subscribed, date,  
IPAddress, Business, Addr' at line 1


Now I may just be being dense but I can't figure out the problem...  
Migraines are not helping right now though


Can anyone see my stupid mistake? :)


That's the syntax for an insert statement. Suggest you read this: 
http://dev.mysql.com/doc/refman/5.0/en/update.html


Hmmm... I looked at it, but didn't see anything that would help with a  
prepared statement :)


Am I that dense or can't we do updates with prepared statements?

--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
11287 James St
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] Mysqli issue

2008-09-11 Thread Stut

On 11 Sep 2008, at 17:08, Jason Pruim wrote:


On Sep 11, 2008, at 11:23 AM, Stut wrote:


On 11 Sep 2008, at 16:15, Jason Pruim wrote:
Attempting to setup a prepared statement in php that will update  
a record in a mysql database using mysqli


Here is the relevant code:
$stmt = mysqli_stmt_init($link);
	mysqli_stmt_prepare($stmt, UPDATE purl.schreur (FName, LName,  
email, phone, record, subscribed, date, IPAddress, Business,  
Address1, City, State, Zip, Coffee, Meeting, areaPlans) VALUES  
(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?));


	mysqli_stmt_bind_param($stmt, 'ss', $_POST 
['txtFName'], $_POST['txtLName'], $_POST['txtEmail'], $_POST 
['txtPhone'], $_POST['txturl'], $_POST['record'], $_POST 
['subscribed'],$date, $_SERVER['REMOTE_ADDR'], $_POST 
['txtBusiness'], $_POST['txtAddress1'], $_POST['txtCity'], $_POST 
['txtState'], $_POST['txtZip'], $_POST['rdoCoffee'], $_POST 
['rdoTime'], $_POST['areaPlans']) ;//or die(mysqli_error($link));

echo BRDump of stmt:BR;

mysqli_stmt_execute($stmt) or die(mysqli_error($link));

Here is my error message:

You have an error in your SQL syntax; check the manual that  
corresponds to your MySQL server version for the right syntax to  
use near '(FName, LName, email, phone, record, subscribed, date,  
IPAddress, Business, Addr' at line 1


Now I may just be being dense but I can't figure out the  
problem... Migraines are not helping right now though


Can anyone see my stupid mistake? :)


That's the syntax for an insert statement. Suggest you read this:  
http://dev.mysql.com/doc/refman/5.0/en/update.html


Hmmm... I looked at it, but didn't see anything that would help  
with a prepared statement :)


Am I that dense or can't we do updates with prepared statements?


Your problem has nothing to do with your use of prepared statements.  
Your problem is to do with the syntax of the update statement you're  
trying to use.


Insert statements can look like...

  insert into `table` (field1, field2) values (value1, value2);

but update statements can only be in the form...

  update `table` set field1=value1, field2=value2 where field3=value3;

Clear now?

-Stut

--
http://stut.net/

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



Re: [PHP] Mysqli issue

2008-09-11 Thread Andrew Ballard
On Thu, Sep 11, 2008 at 12:08 PM, Jason Pruim [EMAIL PROTECTED] wrote:

 On Sep 11, 2008, at 11:23 AM, Stut wrote:

 On 11 Sep 2008, at 16:15, Jason Pruim wrote:

 Attempting to setup a prepared statement in php that will update a record
 in a mysql database using mysqli

 Here is the relevant code:
$stmt = mysqli_stmt_init($link);
mysqli_stmt_prepare($stmt, UPDATE purl.schreur (FName, LName,
 email, phone, record, subscribed, date, IPAddress, Business, Address1, City,
 State, Zip, Coffee, Meeting, areaPlans) VALUES
 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?));


[snip]


 Here is my error message:

 You have an error in your SQL syntax; check the manual that corresponds
 to your MySQL server version for the right syntax to use near '(FName,
 LName, email, phone, record, subscribed, date, IPAddress, Business, Addr' at
 line 1

 Now I may just be being dense but I can't figure out the problem...
 Migraines are not helping right now though

 Can anyone see my stupid mistake? :)

 That's the syntax for an insert statement. Suggest you read this:
 http://dev.mysql.com/doc/refman/5.0/en/update.html

 Hmmm... I looked at it, but didn't see anything that would help with a
 prepared statement :)

 Am I that dense or can't we do updates with prepared statements?


You're just having a bad day and missing it. The problem isn't that
you're using a prepared statement or not. The problem is that you're
confusing the SQL syntax inside your statement:

INSERT INTO purl.schreur (FName, LName, email, phone, record,
subscribed, date, IPAddress, Business, Address1, City, State, Zip,
Coffee, Meeting, areaPlans) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)

or

UPDATE purl.schreur SET FName = ?, LName = ?, email = ?, phone = ?,
record = ?, subscribed = ?, date = ?, IPAddress = ?, Business = ?,
Address1 = ?, City = ?, State = ?, Zip = ?, Coffee = ?, Meeting = ?,
areaPlans = ?
WHERE [some condition that identifies the row or rows that you want to update]

Andrew

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



Re: [PHP] Re: Interntet Explorer 8 beater 2

2008-09-11 Thread Lester Caine

Colin Guthrie wrote:

Micah Gersten wrote:

In the Microsoft world, you only support the latest couple of OSs, so
IE7 won't run on Win2k.


What about FF, Opera, Chrome, Safari? Do *any* of those work? If not, 
then it wouldn't take long to get one of them working if IE had a sunset 
date in it. Then you'd see how quickly MS responded with making IEx work 
on their older OSes (and simply recompiling IE6 with a newer sunset 
date should not be allowed!) I'm not sure how you would police it, but 
there should be a badge of honour associated with the system in some 
way, probably overseen by W3C.


The problem here is the sales job M$ does on the councils when providing their 
site licences. CERTAINLY when ever I demo new facilities I don't use IE - in 
fact I have even STRIPPED IE from most machines here, but have a couple of 
machines that don't matter if IE leaks ;) IE7 does not run on W2k so M$ want 
money to upgrade to - Vista nowadays - so it's not going to happen any time soon.


It would be nice if we could convince IT departments that there ARE other 
sources of software than M$, and I *AM* now slipping Linux servers into sites 
where only Windows machines were acceptable a couple of years ago. I suspect 
that with the current Linux distributions supplying OpenOffice and Firefox out 
of the box, then a few more IT departments will be moving that way very soon... :)


Jochem - You not had the problem of M$ changing default font sizes in 
different versions of windows? IT departments have enough problems with 
INSTALLING an upgrade without asking them to CHANGE the font size as well :)
The complaint from THIS site was that they could not log out because the 
'logout' button was hidden - selecting a size smaller font on the browser 
fixes the problem, but we have to add a scroll bar to the menu because They 
can't change from the default settings :(


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



[PHP] Re: Why MS Won't Retire Browsers -- was: Interntet Explorer 8 beater 2

2008-09-11 Thread Colin Guthrie

Micah Gersten wrote:

The problem is that if you're running on older hardware, IE7 might be
too CPU intensive to run correctly.  That's why MS won't set Sunset
Dates for an old browser.  They instead set the Sunset Dates for the OS
and that's how they make things out of date.  They say upgrade the OS. 
Matter of philosophy.  The problem is that the new OS won't run on the

old hardware and costs lots of money so people don't upgrade.  Remember,
MS is for profit.  If you can just upgrade your browser, they don't make
any money.  If you upgrade your OS, they do.


Fair point but if people are using old OSes and MS want them to upgrade 
to a newer versin, breaking their ability to surf the web isn't a 
carrot, but it makes a pretty good stick.


Col

--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]


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



[PHP] Re: Interntet Explorer 8 beater 2

2008-09-11 Thread Colin Guthrie

Lester Caine wrote:
Jochem - You not had the problem of M$ changing default font sizes in 
different versions of windows? IT departments have enough problems with 
INSTALLING an upgrade without asking them to CHANGE the font size as 
well :)
The complaint from THIS site was that they could not log out because the 
'logout' button was hidden - selecting a size smaller font on the 
browser fixes the problem, but we have to add a scroll bar to the menu 
because They can't change from the default settings :(


Yeah font sizes are a pain... tip of the day: Don't put and XML preamble 
in if you are using XHTML and get your doctypes right. Once you do that, 
the font size problems are a lot easier to address.


Col



--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]


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



Re: [PHP] Re: Interntet Explorer 8 beater 2

2008-09-11 Thread Jochem Maas

Colin Guthrie schreef:

Lester Caine wrote:
Jochem - You not had the problem of M$ changing default font sizes in 
different versions of windows? IT departments have enough problems 
with INSTALLING an upgrade without asking them to CHANGE the font size 
as well :)
The complaint from THIS site was that they could not log out because 
the 'logout' button was hidden - selecting a size smaller font on the 
browser fixes the problem, but we have to add a scroll bar to the menu 
because They can't change from the default settings :(


Yeah font sizes are a pain... tip of the day: Don't put and XML preamble 
in if you are using XHTML and get your doctypes right. Once you do that, 
the font size problems are a lot easier to address.


indeed they are a pain, properly validating strict xHTML is the start of
making it manageable, other part is defining suitable style sheets that fix
the problem. plenty of eggheads offer blogs posts/articles etc that define
the issues and offer cross-browser font-size solutions.

IE font-size hell is exactly that, but there is no reason to have to pass it
on to the client ... going through M$Hell is our job ;-)



Col






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



Re: [PHP] Re: Installation doesn't complete, Windows Vista: error - script required to complete

2008-09-11 Thread Ashley Sheridan
I've always found EasyPHP to be good for this. Installs within minutes,
and makes adding the extra packages for PHP an absolute doddle. I know
it works on Vista, as I've tried it, although with Vista, some of the
more unusual packages didn't install.


Ash
www.ashleysheridan.co.uk
---BeginMessage---

Ben Stones schrieb:

Hi,

Others are facing the same problem and theres an official bug report here
about it: http://bugs.php.net/bug.php?id=43639thanks=3

PHP hasn't fixed it since December 2007, wondering if anyone has a
workaround as I cannot even uninstall it now as the same problem arises. Is
there any workaround as I have Apache and MySQL all ready and setup.

Cheers.


Hi,
use Xampp -http://www.apachefriends.org/en/xampp-windows.html and relax

simply!

Carlos Medina

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


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

[PHP] quick php for perl coder question

2008-09-11 Thread Thomas Bolioli

I want to return an array from a function.
I have this:
return array($found, $username, $email, $nickname);
as my code. I have a bug in the code and I am not sure where yet. Should 
the above statement with this:


array($vars);
   $vars = function($type, $abc, $xyz);
   $found = $vars[0];
   $username = $vars[1];
   $email = $vars[2];
   $nickname = $vars[3];

on the other end work? If so, then the bug is somewhere else.

Thanks in advance,
Tom

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



Re: [PHP] Setting up a password for WAMP

2008-09-11 Thread Ashley Sheridan
Probably the quickest way is to go into the old command line and restart
the mysqld service. There is an option there to set the username it runs
under and the password it needs when making a connection.


Ash
www.ashleysheridan.co.uk
---BeginMessage---
HI

On Wed, Sep 10, 2008 at 12:23 PM, Ben Stones [EMAIL PROTECTED]wrote:

 Hi, just installed WAMP and wondering how do I setup a root password for
 accessing phpMyAdmin, MySQL, etc. Couldn't find anything on the WAMP's
 Website how to do this. I realise this has got nothing to do with PHP
 specifically but any help will be appreciated!


It usually set the root user with blank password

it means user 'root' and password =''

regards

-- 
Carlos Eduardo Sotelo Pinto (KrLoS)
GNU Linux User Registered #379182
http://csotelop.blogsome.com
---End Message---
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: New Server Install

2008-09-11 Thread Ashley Sheridan
I believe that MySQL uses a particular port when connecting over a
network such as you're doing. I can't remember the exact port number,
but you can Google it. Just check that there's nothing blocking this
port either on your computer, the server, or the router/switch or
whatever else you are using to connect the computers on the network


Ash
www.ashleysheridan.co.uk
---BeginMessage---

Shawn McKenzie wrote:

Robbert van Andel wrote:
I am working on a new webserver running Fedora 9.  I installed 
php-mysql and
php-mssql via yum.  When I try to connect to our mysql server using 
php, I
get the following error: Can't connect to MySQL server on 
'mysqlservername'

(13)

 

Here's the weird part, I can connect to the mysql database server just 
fine
from the web server's command line so I'm pretty confident that it's 
not a
firewall issue.  While trying to connect using PHP, I see no packets 
leaving

the webserver.
 


Any thoughts?

 


Thanks,

Robbert




Well, for MySQL there are multiple user perms.  In the user table you 
may see multiple entries for, let's say root.


mysql use mysql;
mysql select host,user,password from user;

hostuserpassword
*root*22669F8A96AC3CE42B3E5E8087893840412E035F
localhostroot

So, root, if accessing from localhost, requires NO paswword.  But root, 
accessing from any other host requires a password.  Also, this could 
have more host entries, but probably not by default.


If your db server is on a different host from your web server, this or 
similar is most likely your problem.


-Shawn


Or, there is no * entry (all hosts).  In which case you should add a 
specific entry for your web server.


-Shawn

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


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

Re: [PHP] Re: New Server Install

2008-09-11 Thread Tom Chubb
2008/9/11 Ashley Sheridan [EMAIL PROTECTED]

 I believe that MySQL uses a particular port when connecting over a
 network such as you're doing. I can't remember the exact port number,
 but you can Google it. Just check that there's nothing blocking this
 port either on your computer, the server, or the router/switch or
 whatever else you are using to connect the computers on the network


 Ash
 www.ashleysheridan.co.uk


 -- Forwarded message --
 From: Shawn McKenzie [EMAIL PROTECTED]
 To: php-general@lists.php.net
 Date: Wed, 10 Sep 2008 21:31:41 -0500
 Subject: [PHP] Re: New Server Install
 Shawn McKenzie wrote:

 Robbert van Andel wrote:

 I am working on a new webserver running Fedora 9.  I installed php-mysql
 and
 php-mssql via yum.  When I try to connect to our mysql server using php,
 I
 get the following error: Can't connect to MySQL server on
 'mysqlservername'
 (13)


 Here's the weird part, I can connect to the mysql database server just
 fine
 from the web server's command line so I'm pretty confident that it's not
 a
 firewall issue.  While trying to connect using PHP, I see no packets
 leaving
 the webserver.

 Any thoughts?


 Thanks,

 Robbert



 Well, for MySQL there are multiple user perms.  In the user table you may
 see multiple entries for, let's say root.

 mysql use mysql;
 mysql select host,user,password from user;

 hostuserpassword
 *root*22669F8A96AC3CE42B3E5E8087893840412E035F
 localhostroot

 So, root, if accessing from localhost, requires NO paswword.  But root,
 accessing from any other host requires a password.  Also, this could have
 more host entries, but probably not by default.

 If your db server is on a different host from your web server, this or
 similar is most likely your problem.

 -Shawn


 Or, there is no * entry (all hosts).  In which case you should add a
 specific entry for your web server.

 -Shawn

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


I was trying to access MySQL on a remote server from an Excel spreadsheet
and I think it was port 3306 but I still haven't got it working yet!
HTH


[PHP] Unsetting variables less then 256 bytes

2008-09-11 Thread Shevnock, Daniel
While doing some testing with the unset() function, I noticed that
variables that hold values that are less then 256 bytes are not actually
unset from memory. Does anyone know this to be true? The tests were run
on WampServer 2.0 on a Windows XP machine.


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



Re: [PHP] quick php for perl coder question

2008-09-11 Thread Jochem Maas

Thomas Bolioli schreef:

I want to return an array from a function.
I have this:
return array($found, $username, $email, $nickname);
as my code. I have a bug in the code and I am not sure where yet. Should 
the above statement with this:


array($vars);


not sure what you meant with the line above, it's valid but does nothing.


   $vars = function($type, $abc, $xyz);
   $found = $vars[0];
   $username = $vars[1];
   $email = $vars[2];
   $nickname = $vars[3];

on the other end work? If so, then the bug is somewhere else.


yes this should work assuming you meant this:

?php

function foo() {
$found  = true;
$username   = 'The Joker';
$email  = '[EMAIL PROTECTED]';
$nickname   = 'joker';

return array($found, $username, $email, $nickname);
}

$vars   = foo();
$found  = $vars[0];
$username   = $vars[1];
$email  = $vars[2];
$nickname   = $vars[3];
?

although you could do it more perly:

?php

list($found, $username, $email, $nickname) = foo();

?

and maybe consider using an assoc array:

?php

function foo() {
$found  = true;
$username   = 'The Joker';
$email  = '[EMAIL PROTECTED]';
$nickname   = 'joker';

return array(
'found' = $found,
'username'  = $username,
'email' = $email,
'nickname'  = $nickname,
);
}

$vars   = foo();
// using an associative array negates the need to
// define the following variables, you can use
// $vars['found'] (etc) as it is quite descriptive
// in it's own right :-)
$found  = $vars['found'];
$username   = $vars['username'];
$email  = $vars['email'];
$nickname   = $vars['nickname'];

?


Thanks in advance,
Tom




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



Re: [PHP] quick php for perl coder question

2008-09-11 Thread Kirk . Johnson
Thomas Bolioli [EMAIL PROTECTED] wrote on 09/11/2008 01:10:18 PM:

 I want to return an array from a function.
 I have this:
 return array($found, $username, $email, $nickname);
 as my code. I have a bug in the code and I am not sure where yet. Should 

 the above statement with this:
 
 array($vars);
 $vars = function($type, $abc, $xyz);
 $found = $vars[0];
 $username = $vars[1];
 $email = $vars[2];
 $nickname = $vars[3];
 
 on the other end work? If so, then the bug is somewhere else.

You probably want:

$vars = array();

instead of:

array($vars);

which will throw an undefined variable error (if error reporting is turned 
up), but otherwise, yes, that should work.

Kirk

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



Re: [PHP] Unsetting variables less then 256 bytes

2008-09-11 Thread Jim Lucas
Shevnock, Daniel wrote:
 While doing some testing with the unset() function, I noticed that
 variables that hold values that are less then 256 bytes are not actually
 unset from memory. Does anyone know this to be true? The tests were run
 on WampServer 2.0 on a Windows XP machine.
 
 

Please, try starting your own thread if you have a question.

Thanks

-- 
Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Twelfth Night, Act II, Scene V
by William Shakespeare


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



Re: [PHP] Re: New Server Install

2008-09-11 Thread Shawn McKenzie



Tom Chubb wrote:



2008/9/11 Ashley Sheridan [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]


I believe that MySQL uses a particular port when connecting over a
network such as you're doing. I can't remember the exact port number,
but you can Google it. Just check that there's nothing blocking this
port either on your computer, the server, or the router/switch or
whatever else you are using to connect the computers on the network


Ash
www.ashleysheridan.co.uk http://www.ashleysheridan.co.uk


-- Forwarded message --
From: Shawn McKenzie [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
To: php-general@lists.php.net mailto:php-general@lists.php.net
Date: Wed, 10 Sep 2008 21:31:41 -0500
Subject: [PHP] Re: New Server Install
Shawn McKenzie wrote:

Robbert van Andel wrote:

I am working on a new webserver running Fedora 9.  I
installed php-mysql and
php-mssql via yum.  When I try to connect to our mysql
server using php, I
get the following error: Can't connect to MySQL server on
'mysqlservername'
(13)

 
Here's the weird part, I can connect to the mysql database

server just fine
from the web server's command line so I'm pretty confident
that it's not a
firewall issue.  While trying to connect using PHP, I see
no packets leaving
the webserver.
 
Any thoughts?


 
Thanks,


Robbert



Well, for MySQL there are multiple user perms.  In the user
table you may see multiple entries for, let's say root.

mysql use mysql;
mysql select host,user,password from user;

hostuserpassword
*root*22669F8A96AC3CE42B3E5E8087893840412E035F
localhostroot

So, root, if accessing from localhost, requires NO paswword.
 But root, accessing from any other host requires a password.
 Also, this could have more host entries, but probably not by
default.

If your db server is on a different host from your web server,
this or similar is most likely your problem.

-Shawn


Or, there is no * entry (all hosts).  In which case you should add
a specific entry for your web server.

-Shawn

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


I was trying to access MySQL on a remote server from an Excel 
spreadsheet and I think it was port 3306 but I still haven't got it 
working yet!

HTH


Install MyODBC and setup an ODBC connection on your PC.

-Shawn

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



[PHP] namespaces ... coming to a php5.3 near you.

2008-09-11 Thread Jochem Maas

has anyone here downloaded/compiled 5.3 and played with namespaces?
have you encountered any issues/problems?

I'd like to hear from you as I've been asked to compile a reference documenting 
anything/everything
people may have come across (so far as namespaces go), if you have some 
reproduce code, all
the better.

rgds,
Jochem

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



RE: [PHP] Re: Google Maps Distance Between UK Postcodes

2008-09-11 Thread Boyd, Todd M.
 -Original Message-
 From: tedd [mailto:[EMAIL PROTECTED]
 Sent: Thursday, September 11, 2008 10:17 AM
 To: php-general@lists.php.net
 Subject: [PHP] Re: Google Maps Distance Between UK Postcodes
 
 At 5:37 PM +0100 9/1/08, Colin Guthrie wrote:
 Tom Chubb wrote:
 That's all way above my head, but I think I'll be able to understand
 it
 after a strong coffee!
 
 I should point out that this is really just trig and is only an
 approximate distance as the crow flies. Not even sure if it takes
 the curvature of the earth into consideration, but it's probably
 good enough for most things.
 
 
 I've reviewed your code and it does not include the curvature of the
 earth -- it's a flat surface computation.
 
 Considering that my other profession is Geophysicist, I'm kind of up
 on those sort of things. The Earth is an oblate spheroid and the
 computation to include the curvature of the earth would be a bit more
 involved.

---8--- snip

But it's also NOT an oblate spheroid! :)

http://blogs.discovermagazine.com/badastronomy/2008/09/08/ten-things-you
-dont-know-about-the-earth/


Todd Boyd
Web Programmer




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



Re: [PHP] Re: New Server Install

2008-09-11 Thread Tom Chubb
2008/9/11 Shawn McKenzie [EMAIL PROTECTED]



 Tom Chubb wrote:



 2008/9/11 Ashley Sheridan [EMAIL PROTECTED] mailto:
 [EMAIL PROTECTED]

I believe that MySQL uses a particular port when connecting over a
network such as you're doing. I can't remember the exact port number,
but you can Google it. Just check that there's nothing blocking this
port either on your computer, the server, or the router/switch or
whatever else you are using to connect the computers on the network


Ash
www.ashleysheridan.co.uk http://www.ashleysheridan.co.uk


-- Forwarded message --
From: Shawn McKenzie [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
To: php-general@lists.php.net mailto:php-general@lists.php.net
Date: Wed, 10 Sep 2008 21:31:41 -0500
Subject: [PHP] Re: New Server Install
Shawn McKenzie wrote:

Robbert van Andel wrote:

I am working on a new webserver running Fedora 9.  I
installed php-mysql and
php-mssql via yum.  When I try to connect to our mysql
server using php, I
get the following error: Can't connect to MySQL server on
'mysqlservername'
(13)

Here's the weird part, I can connect to the mysql
 database
server just fine
from the web server's command line so I'm pretty confident
that it's not a
firewall issue.  While trying to connect using PHP, I see
no packets leaving
the webserver.
Any thoughts?

Thanks,

Robbert



Well, for MySQL there are multiple user perms.  In the user
table you may see multiple entries for, let's say root.

mysql use mysql;
mysql select host,user,password from user;

hostuserpassword
*root*22669F8A96AC3CE42B3E5E8087893840412E035F
localhostroot

So, root, if accessing from localhost, requires NO paswword.
 But root, accessing from any other host requires a password.
 Also, this could have more host entries, but probably not by
default.

If your db server is on a different host from your web server,
this or similar is most likely your problem.

-Shawn


Or, there is no * entry (all hosts).  In which case you should add
a specific entry for your web server.

-Shawn

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


 I was trying to access MySQL on a remote server from an Excel spreadsheet
 and I think it was port 3306 but I still haven't got it working yet!
 HTH


 Install MyODBC and setup an ODBC connection on your PC.

 -Shawn


Did that and got an error response. I think it's the remote host but was
late Friday afternoon last week and haven't got round to trying it again.
Thanks though.
Anyway, sorry this is veering OT


[PHP] Maps / Distance / GeoCoding [php/mysql]

2008-09-11 Thread Nathan Rixham

re: an earlier thread

as promised here are some note's on geo-coding using mysql and php (and 
geoip and distance between points) also worth reading up on wiki about 
the great circle and associated content! (+openGIS)


Won't make sense to all unless you're working with spatial data - if 
anybody needs I also have the full ip to location databases; + the 
geo-cords or every dwelling place in the world (basically a mashup of 
all decent databases combined - about 4gb worth when rar'd)


if your a postgres coder you want be checkign out postgis and pgrouting
-

Geo Data  Spatial

All geo columns are of type GEOMETRY sith SPATIAL indexes (see mysql 5 
spatial documentation 
http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.html); in 
short they are binary storage columns for geodata. (here's a handy link 
about it aswell: 
http://dev.mysql.com/tech-resources/articles/4.1/gis-with-mysql.html )


you extract data from them by using:

X(point) as lon
Y(point) as lat

or AsText(point)

in where statements you use MBRContains

some functions:

function spatialCountryFromIp($ipNumeric=false) {
if($ipNumeric) {
$getResultsSQL =  select
l.isocode,
l.en,
X(l.geopoint) 
as lon,
Y(l.geopoint) 
as lat
from

geodata.spatialip_country as i
inner join

geodata.spatialloc_country as l
ON

MBRContains(l.geopoint,i.geopoint)
where
MBRContains(i.iprange,PointFromText('Point(0 
.($ipNumeric/1000).)'));;

$result = mysql_query($getResultsSQL);
/* do what you want with data */
}
}

public function spatialCityFromIp($ipNumeric=false, $within=1, 
$units='km') {


if($ipNumeric) {
if(strtolower(trim($units)) == 'km') {
$single_unit = 0.0089992800575953923686105111591073;
}
$offset = 1*$single_unit;
if(is_numeric($within)  $within) {
$offset = $within*$single_unit;
}
$getResultsSQL =  select
l.cid,
l.name,
X(l.point) as 
lon,
Y(l.point) as 
lat,
l.cc,
l.pop,
ACOS(

SIN(Y(g.geopoint)*pi()/180)*SIN(Y(l.point)*pi()/180)

+COS(Y(g.geopoint)*pi()/180)*COS(Y(l.point)*pi()/180)

*COS((X(l.point)-X(g.geopoint))*pi()/180)
)*6372.795
as distance
from

geodata.spatialip_city as g
inner join

geodata.spatialloc_city as l
ON
MBRContains(

GeomFromText(

CONCAT(

'POLYGON(

(

',X(g.geopoint)-(.$offset.),' ',Y(g.geopoint)-(.$offset.),',

',X(g.geopoint)+(.$offset.),' ',Y(g.geopoint)-(.$offset.),',

[PHP] Re: Maps / Distance / GeoCoding [php/mysql]

2008-09-11 Thread Nathan Rixham

Nathan Rixham wrote:

re: an earlier thread


[snip]

or you may just need this bit:

distance =
ACOS( 
SIN(Y(g.geopoint)*pi()/180)*SIN(Y(l.point)*pi()/180) 
 +COS(Y(g.geopoint)*pi()/180)*COS(Y(l.point)*pi()/180)

*COS((X(l.point)-X(g.geopoint))*pi()/180))*6372.795

used to calc the distance between two points on the surface of the earth 
accurately


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



Re: [PHP] Readdir() question

2008-09-11 Thread Nathan Rixham

Jochem Maas wrote:

Nathan Rixham schreef:

Stut wrote:
maybe this is into coding standards and ethics.. but this may be 
acceptable:

if( !defined('__DIR__') ) {
  define('__DIR__' , dirname(__FILE__));
}

however realistically you'd have to do this in every file and nto just 
in one include


which would give an error on second and subsequent define()s

yet if(!defined... it's already defined so won't be defined subsequent 
times :)


still crap though

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



Re: [PHP] Readdir() question

2008-09-11 Thread Jochem Maas

Nathan Rixham schreef:

Jochem Maas wrote:

Nathan Rixham schreef:

Stut wrote:
maybe this is into coding standards and ethics.. but this may be 
acceptable:

if( !defined('__DIR__') ) {
  define('__DIR__' , dirname(__FILE__));
}

however realistically you'd have to do this in every file and nto 
just in one include


which would give an error on second and subsequent define()s

yet if(!defined... it's already defined so won't be defined subsequent 
times :)


my bad



still crap though



yes :-P

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



Re: [PHP] Re: Why MS Won't Retire Browsers -- was: Interntet Explorer 8 beater 2

2008-09-11 Thread Sancar Saran
Because,

M$ earning money from Win GUI. No WinGUI no money.

From the begining, M$ try to broke web compatibilty in every way...

Sure M$ has bad records about software quality. But even ask yourself. WHY IE 
(especially 5 and 6) SO buggy even M$ standards.

M$ isn't mr nice guy and they wont get a dime from web.

They hate web and internet from begining.

M$ is anti web IT company. They are too big they are to bold (or bald) to 
accept changing market and they got too much money on 
bank to do someting very very stupid.

Like Windows VISTA.

Don't expect anything good from M$...

Regards

Sancar

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



Re: [PHP] Serving pages based on user input

2008-09-11 Thread prasad

Jochem Maas wrote:

tedd schreef:

At 10:02 PM -0700 8/23/08, Prasad Chand wrote:
Thanks for that information. But in my case I need to serve pages 
based on selection of US states. There are 50 of them, so generating 
pages dynamically would have been a nice idea.


WTF? do you have any idea why we write scripts as opposed to endless
copy/pasting of plain (X|(x)HT)ML?

and really you don't need to generate 50 pages, merely 50 URLs that
end up triggering a single script (which in turn generates output based
on the request URL).



OK late reply but just to set the record straight. I did not mean 
generating 50 different pages!!! I would as well do it in html if thats 
the case. I meant generating a single page with the desired content 
based on form input. As of now I am using includes to generate the page. 
 I will be more careful with the wording next time.




Really, there are 50 of them!?!?  :-)


unofficially there are 51, well Tony Blair would like to think so.


You don't have to generate 50 pages dynamically to do it -- try this:

http://webbytedd.com/bbb/map/

That demo is done with just pure css -- no php nor javascript.

 
Plus each one of those States can be linked to another page -- AND-- 
it is user friendly, validates, accessible, and SEO friendly. What 
more could anyone want?


a version of europe actually :-P

seriously how much time did you spend hacking that together? and
how did your eyes bleed?



If you don't know php, then I think the best way to ask a question on 
this list by telling us what you want to do rather than asking 
specific php questions trying to do something they way you think it 
might work.


Thanks for your comment. I was completely new to php so the questions 
were unrefined, now I am much more comfortable. map-navigation is a good 
idea but I will need to change the look and feel and I need to give it 
more time and then I am willing to right now. Btw, I could not download 
the outline of the map when i saved it as you haven't given permission 
to the states folder. I had to create the states folder and then 
download the outline of the us map.




no. the best thing would be to RTFM and STFW for a few years,
but hey hell will freeze over first ;-)



Cheer,

tedd





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



[GodsWordEachDay] GodsWordEachDay September 11, 2008

2008-09-11 Thread MARNICOL58
 

Thursday September 11,  2008


For even when we were with  you we gave you this rule:  If a man will not 
work, he shall not  eat.  We hear that some among you are idle.  They are not 
busy;   they are busybodies.  Such people we command and urge in the Lord  
Jesus Christ to settle down and earn the bread they eat. 2 Thessalonians 3:  
10, 
11, 12 NIV
 
 
 
 


_Reply (via web post) _ 
(http://groups.yahoo.com/group/GodsWordEachDay/post;_ylc=X3oDMTJvYmI0cmMxBF9TAzk3MzU5NzE0BGdycElkAzM5NTUyNgRncnBzcElkAzE3MDUwNzQwNDY
EbXNnSWQDMjQ1MQRzZWMDZnRyBHNsawNycGx5BHN0aW1lAzEyMjEwMTU3OTA-?act=replymessag
eNum=2451) | _Start  a new topic _ 
(http://groups.yahoo.com/group/GodsWordEachDay/post;_ylc=X3oDMTJkamdqbHNxBF9TAzk3MzU5NzE0BGdycElkAzM5NTUyNgRncnBzcElkAzE3
MDUwNzQwNDYEc2VjA2Z0cgRzbGsDbnRwYwRzdGltZQMxMjIxMDE1Nzkw) 
_Messages_ 
(http://groups.yahoo.com/group/GodsWordEachDay/messages;_ylc=X3oDMTJkZm01ajFvBF9TAzk3MzU5NzE0BGdycElkAzM5NTUyNgRncnBzcElkAzE3MDUwNzQwNDYEc2VjA2Z0
cgRzbGsDbXNncwRzdGltZQMxMjIxMDE1Nzkw)  

*   
If you've received this verse as a forwarded message and would like to  
subscribe, send a blank e-mail to [EMAIL PROTECTED] 
 
(http://groups.yahoo.com/;_ylc=X3oDMTJjZmVtbTNxBF9TAzk3NDc2NTkwBGdycElkAzM5NTUyNgRncnBzcElkAzE3MDUwNzQwNDYEc2VjA2Z0cgRzbGsDZ2ZwBHN0aW1lAzEyMjEwMTU3OTA-)
  
_Change  settings via the Web_ 
(http://groups.yahoo.com/group/GodsWordEachDay/join;_ylc=X3oDMTJlbW5zZDJuBF9TAzk3NDc2NTkwBGdycElkAzM5NTUyNgRncnBzcElkAzE3MDUw
NzQwNDYEc2VjA2Z0cgRzbGsDc3RuZ3MEc3RpbWUDMTIyMTAxNTc5MA--)  (Yahoo! ID 
required) 
Change settings via email: _Switch  delivery to Daily Digest_ 
(mailto:[EMAIL PROTECTED] Delivery: Digest)  | _Switch  
format to Traditional_ 
(mailto:[EMAIL PROTECTED] Delivery Format: Traditional)  
_Visit  Your Group _ 
(http://groups.yahoo.com/group/GodsWordEachDay;_ylc=X3oDMTJjazFpcGFiBF9TAzk3NDc2NTkwBGdycElkAzM5NTUyNgRncnBzcElkAzE3MDUwNzQwNDYEc2VjA2Z
0cgRzbGsDaHBmBHN0aW1lAzEyMjEwMTU3OTA-) | _Yahoo! Groups Terms of Use _ 
(http://docs.yahoo.com/info/terms/) | _Unsubscribe _ 
(mailto:[EMAIL PROTECTED]) 
.
 
   



**Pt...Have you heard the news? There's a new fashion blog, 
plus the latest fall trends and hair styles at StyleList.com.  
(http://www.stylelist.com/trends?ncid=aolsty000514)