Re: [PHP] checking dates not working

2011-11-10 Thread tamouse mailing lists
On Thu, Nov 10, 2011 at 4:35 PM, Marc Fromm wrote: > I have this bit of code to see if a date is greater or equal to a set date. > > echo(date("m/d/Y",strtotime($jobs_effective_start)));// displays entered date > of 01/03/2012 > echo(date("m/d/Y",strtotime(WSOFFBEGIN))); // displays set date of 0

Re: [PHP] checking dates not working

2011-11-10 Thread Simon J Welsh
On 11/11/2011, at 11:35 AM, Marc Fromm wrote: > I have this bit of code to see if a date is greater or equal to a set date. > > echo(date("m/d/Y",strtotime($jobs_effective_start)));// displays entered date > of 01/03/2012 > echo(date("m/d/Y",strtotime(WSOFFBEGIN))); // displays set date of 09/16

Re: [PHP] Checking file type when uploading

2010-09-19 Thread tedd
At 1:40 PM -0700 9/17/10, Catherine Madsen wrote: Hi! I have created a form following the PHP manual to upload files and need to restrict the upload to only PDF. How do I check the file type ($_FILES['userfile']['type']?) and where: on the form page or on the validation page? I want to be able

Re: [PHP] Checking file type when uploading

2010-09-18 Thread Ashley Sheridan
On Sat, 2010-09-18 at 02:46 -0700, Michael Shadle wrote: > There is a fileinfo module for php (and it's packaged in 5.3) > > http://www.php.net/manual/en/intro.fileinfo.phphttp://www.php.net/manual/en/intro.fileinfo.php > > However after trying to use "file" in a system call back in the day its

Re: [PHP] Checking file type when uploading

2010-09-18 Thread Michael Shadle
There is a fileinfo module for php (and it's packaged in 5.3) http://www.php.net/manual/en/intro.fileinfo.phphttp://www.php.net/manual/en/intro.fileinfo.php However after trying to use "file" in a system call back in the day its great with graphics and some other stuff, but a large number of the

Re: [PHP] Checking file type when uploading

2010-09-18 Thread Ashley Sheridan
On Sat, 2010-09-18 at 11:21 +0200, Peter Lind wrote: > On 17 September 2010 23:25, Jim Lucas wrote: > > Catherine Madsen wrote: > >> Hi! > >> > >> I have created a form following the PHP manual to upload files and need > >> to restrict the upload to only PDF. How do I check the file type > >> ($

Re: [PHP] Checking file type when uploading

2010-09-18 Thread Peter Lind
On 17 September 2010 23:25, Jim Lucas wrote: > Catherine Madsen wrote: >> Hi! >> >> I have created a form following the PHP manual to upload files and need >> to restrict the upload to only PDF.  How do I check the file type >> ($_FILES['userfile']['type']?) and where: on the form page or on the >

Re: [PHP] Checking file type when uploading

2010-09-17 Thread Jim Lucas
Catherine Madsen wrote: > Hi! > > I have created a form following the PHP manual to upload files and need > to restrict the upload to only PDF. How do I check the file type > ($_FILES['userfile']['type']?) and where: on the form page or on the > validation page? I want to be able to tell the use

Re: [PHP] Checking for internet connection.

2009-12-23 Thread Kim Madsen
Kim Madsen wrote on 23/12/2009 17:01: Okay, explanation excepted, E-mails can easily be misunderstood :-) May you have a merry Christmas (grab another cup of choco, just in case ;-)) correction: accepted Now _I'M_ gonna get a cup of chocolate :-) -- Kind regards Kim Emax - masterminds.dk --

Re: [PHP] Checking for internet connection.

2009-12-23 Thread Kim Madsen
Bob McConnell wrote on 23/12/2009 15:55: > The problem arises when too many of the relevant parts are also removed, > which happened far too often on this thread as well as others. When the > core context is not retained, the conversation drifts and quickly > becomes useless to either the early p

Re: [PHP] Checking for internet connection.

2009-12-23 Thread Daniel Egeberg
On Wed, Dec 23, 2009 at 14:35, Bob McConnell wrote: > I don't keep copies of every message in any of the > dozens of mailing lists and news groups I follow, so there is no simple > way to go back through the conversation to figure out where it all came > from. Fortunately, other people keep compl

RE: [PHP] Checking for internet connection.

2009-12-23 Thread Bob McConnell
From: Kim Madsen > Bob McConnell wrote on 23/12/2009 14:35: >> From: Andy Shellam >> And I was pointing out that this would not be a valid test when there is a caching DNS on the LAN. >> >>> I also pointed out how to avoid caching issues - the >>> comment was aimed at the author of the

Re: [PHP] Checking for internet connection.

2009-12-23 Thread Kim Madsen
Hi Bob Bob McConnell wrote on 23/12/2009 14:35: From: Andy Shellam And I was pointing out that this would not be a valid test when there is a caching DNS on the LAN. I also pointed out how to avoid caching issues - the comment was aimed at the author of the message before mine. Too much o

RE: [PHP] Checking for internet connection.

2009-12-23 Thread Bob McConnell
From: Andy Shellam >> And I was pointing out that this would not be a valid >> test when there is a caching DNS on the LAN. > I also pointed out how to avoid caching issues - the > comment was aimed at the author of the message before mine. > >> Too much of the conversation and most of the attri

Re: [PHP] Checking for internet connection.

2009-12-22 Thread Andy Shellam
> > And I was pointing out that this would not be a valid test when there is > a caching DNS on the LAN. I also pointed out how to avoid caching issues - the comment was aimed at the author of the message before mine. > > Too much of the conversation and most of the attribution was stripped >

RE: [PHP] Checking for internet connection.

2009-12-22 Thread Bob McConnell
From: Andy Shellam >> >> I'm confused... what's the problem with just trying to hit >> the update server? If you can then you check for updates, if >> not then you, erm, don't. Simples, no? > > True, I think I said this same thing in a previous post - I > suggested the DNS option if all the OP wa

Re: [PHP] Checking for internet connection.

2009-12-22 Thread Andy Shellam
> > I'm confused... what's the problem with just trying to hit the update server? > If you can then you check for updates, if not then you, erm, don't. Simples, > no? True, I think I said this same thing in a previous post - I suggested the DNS option if all the OP wanted to do was check if a

Re: [PHP] Checking for internet connection.

2009-12-22 Thread Kim Madsen
Bob McConnell wrote on 21/12/2009 15:05: Both at home and at work there are caching DNS on the LAN. So a DNS request may come back with a valid IP address when the WAN connection is down. I still won't be able to connect to the remote site. Then use fopen() to read a page you know exists? --

RE: [PHP] Checking for internet connection.

2009-12-22 Thread Ashley Sheridan
On Tue, 2009-12-22 at 08:27 -0500, Bob McConnell wrote: > From: Andy Shellam > > >> > >> Both at home and at work there are caching DNS on the LAN. So a DNS > >> request may come back with a valid IP address when the WAN connection > is > >> down. I still won't be able to connect to the remote s

RE: [PHP] Checking for internet connection.

2009-12-22 Thread Bob McConnell
From: Andy Shellam >> >> Both at home and at work there are caching DNS on the LAN. So a DNS >> request may come back with a valid IP address when the WAN connection is >> down. I still won't be able to connect to the remote site. > > Dig an external server - e.g. dig @a.root-servers.net google.

Re: [PHP] Checking for internet connection.

2009-12-22 Thread Stuart Dallas
On 21 Dec 2009, at 19:40, Andy Shellam wrote: >> >> Both at home and at work there are caching DNS on the LAN. So a DNS >> request may come back with a valid IP address when the WAN connection is >> down. I still won't be able to connect to the remote site. > > Dig an external server - e.g. dig

Re: [PHP] Checking for internet connection.

2009-12-22 Thread Andy Shellam
> > Both at home and at work there are caching DNS on the LAN. So a DNS > request may come back with a valid IP address when the WAN connection is > down. I still won't be able to connect to the remote site. Dig an external server - e.g. dig @a.root-servers.net google.co.uk If your net is down t

Re: [PHP] Checking for internet connection.

2009-12-22 Thread Daniel Brown
On Sat, Dec 19, 2009 at 19:13, Angus Mann wrote: > Hi all. > > I'w writing a PHP app that is designed to run over a LAN, so internet > connection for the server is not really essential. Some users may > deliberately not connect it to the internet as a security precaution. > > But I'd like the app

RE: [PHP] Checking for internet connection.

2009-12-21 Thread Bob McConnell
From: Andy Shellam >> By attempting to connect you will implicitly query DNS (which itself >> is a connection to server). > > No it's not - it's putting out a packet targeted at an IP address > and hoping a server will answer - hence why multi-cast works for > DNS because you're not directly co

Re: [PHP] Checking for internet connection.

2009-12-20 Thread Andy Shellam
> By attempting to connect you will implicitly query DNS (which itself > is a connection to server). No it's not - it's putting out a packet targeted at an IP address and hoping a server will answer - hence why multi-cast works for DNS because you're not directly connecting to a specified ser

Re: [PHP] Checking for internet connection.

2009-12-20 Thread LinuxManMikeC
On Sun, Dec 20, 2009 at 2:32 AM, Andy Shellam wrote: >> >> I think the only way to detect if it can connect to the Internet is to >> see if you can grab a file from somewhere on the Internet. I'd hazard a >> guess that when operating systems are able to tell you they can "connect >> to the Interne

Re: [PHP] Checking for internet connection.

2009-12-20 Thread Andy Shellam
> > I think the only way to detect if it can connect to the Internet is to > see if you can grab a file from somewhere on the Internet. I'd hazard a > guess that when operating systems are able to tell you they can "connect > to the Internet" they are actually saying they can ping a predetermined

Re: [PHP] Checking for internet connection.

2009-12-19 Thread Phpster
The next way to handle this might be to code an AIR app. Then it's a simple js trap to see if connectivity exists. Bastien Sent from my iPod On Dec 19, 2009, at 7:13 PM, "Angus Mann" wrote: Hi all. I'w writing a PHP app that is designed to run over a LAN, so internet connection for the

Re: [PHP] Checking for internet connection.

2009-12-19 Thread John Corry
Curl_init() will return a resource or false if it fails, like it would if no Internet connection were present. J Corry Sent from my iPhone On Dec 19, 2009, at 5:36 PM, "Angus Mann" wrote: Why can't you put the update on the same LAN server that the app resides? If that is not possible,

Re: [PHP] Checking for internet connection.

2009-12-19 Thread Ashley Sheridan
On Sun, 2009-12-20 at 10:36 +1000, Angus Mann wrote: > Why can't you put the update on the same LAN server that the app resides? > > If that is not possible, what about using CURL, and update if it can connect > successfully, but don't if it cannot? > > Thanks, > Ash > http://

Re: [PHP] Checking for internet connection.

2009-12-19 Thread Angus Mann
Why can't you put the update on the same LAN server that the app resides? If that is not possible, what about using CURL, and update if it can connect successfully, but don't if it cannot? Thanks, Ash http://www.ashleysheridan.co.uk Since the LAN is remote (many hundred

Re: [PHP] Checking for internet connection.

2009-12-19 Thread Ashley Sheridan
On Sun, 2009-12-20 at 10:13 +1000, Angus Mann wrote: > Hi all. > > I'w writing a PHP app that is designed to run over a LAN, so internet > connection for the server is not really essential. Some users may > deliberately not connect it to the internet as a security precaution. > > But I'd like

Re: [PHP] checking local file size

2008-12-17 Thread John Pillion
> > I tried installing it like the documentation said... but I got the > > following errors. I contacted the hosting service (dreamhost) and they > > said they don't > > provide support for pecl, though they do support perl. Anyone? > > > > -- > > > > $ pecl install uploadprogress > > > >

RE: [PHP] checking local file size

2008-12-17 Thread David Robley
John Pillion wrote: >> > I already downloaded that, thanks. How do I apply it is my question. >> > There's no documentation for the installation of it, that I see >> >> 'Course it is :) >> >> http://www.php.net/manual/en/install.pecl.php >> >> Linked from here: http://pecl.php.net/doc/inde

RE: [PHP] checking local file size

2008-12-16 Thread John Pillion
> > I already downloaded that, thanks. How do I apply it is my question. > > There's no documentation for the installation of it, that I see > > 'Course it is :) > > http://www.php.net/manual/en/install.pecl.php > > Linked from here: http://pecl.php.net/doc/index.php > I tried installing

Re: [PHP] checking local file size

2008-12-16 Thread Chris
In short, what next? http://pecl.php.net/package/uploadprogress I already downloaded that, thanks. How do I apply it is my question. There's no documentation for the installation of it, that I see 'Course it is :) http://www.php.net/manual/en/install.pecl.php Linked from here: http:/

RE: [PHP] checking local file size

2008-12-16 Thread John Pillion
>> "Bojan Tesanovic" > wrote in message >> news:>... >>> Well you need to know the TMP file name that has been in progress of >>> upload, it is usually at /tmp folder >> >> I know how to get that... >> >>> also you need to know the actual size of file uploading, there is an >>> extension for

Re: [PHP] checking local file size

2008-12-16 Thread Chris
John Pillion wrote: "Bojan Tesanovic" wrote in message news:... Well you need to know the TMP file name that has been in progress of upload, it is usually at /tmp folder I know how to get that... also you need to know the actual size of file uploading, there is an extension for PHP that

Re: [PHP] checking local file size

2008-12-16 Thread John Pillion
"Bojan Tesanovic" wrote in message news:... > Well you need to know the TMP file name that has been in progress of > upload, it is usually at /tmp folder I know how to get that... > also you need to know the actual size of file uploading, there is an > extension for PHP that will give you

Re: [PHP] checking local file size

2008-12-16 Thread Bojan Tesanovic
Well you need to know the TMP file name that has been in progress of upload, it is usually at /tmp folder also you need to know the actual size of file uploading, there is an extension for PHP that will give you this info but you need to compile it , on my cars site for uploading images I am

Re: [PHP] Checking for http://

2008-08-29 Thread Gergely Hodicska
You could use substr() (www.php.net/substr) strncmp is better and faster for this purpose. Best Regards, Felhő -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Checking for http://

2008-08-29 Thread Eric Butera
On Fri, Aug 29, 2008 at 11:33 AM, Dan Joseph <[EMAIL PROTECTED]> wrote: > You could use substr() (www.php.net/substr) > > if ( substr( $web_site, 0, 7 ) != "http://"; ) > { > $web_site = "http://"; . $web_site; > } > > -- > -Dan Joseph Or parse_url() -- PHP General Mailing List (http://www.php.n

Re: [PHP] Checking for http://

2008-08-29 Thread Dan Joseph
On Fri, Aug 29, 2008 at 11:25 AM, Ron Piggott <[EMAIL PROTECTED]>wrote: > How do I check if http:// is at the beginning of $web_site and if it > isn't add it? Ron > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > You could use subs

Re: [PHP] checking if URL's exist

2008-07-09 Thread Daniel Brown
On Wed, Jul 9, 2008 at 6:18 AM, <[EMAIL PROTECTED]> wrote: > Hi All, > > I have a Directory table with hundreds of URL's to sites > and want to check periodically if all the URL's still exist. > Does anyone know of a utility to check this ? > Or a pointer to a piece of code ... > > TIA, Cor > -

Re: [PHP] checking if URL's exist

2008-07-09 Thread Maxim Antonov
You need $s= fsockopen('host.com',80); fwrite($s,"GET ".$URL." HTTP/1.1 \r\n"); fwrite($s,"Host: host.com \r\n\r\n"); and you must read first string - if url exists string begining with 200 or 304 if url not exists string begin - is 404 Børge Holen пишет: On Wednesday 09 July 2008 12:18:

Re: [PHP] checking if URL's exist

2008-07-09 Thread Børge Holen
On Wednesday 09 July 2008 12:18:27 [EMAIL PROTECTED] wrote: > Hi All, > > I have a Directory table with hundreds of URL's to sites > and want to check periodically if all the URL's still exist. > Does anyone know of a utility to check this ? > Or a pointer to a piece of code ... > > TIA, Cor ping

RE: [PHP] Checking how many letters are in a string.

2008-03-20 Thread Edward Kay
> -Original Message- > From: tedd > Chapter 4 is all about l16n, L10n, and Unicode. Makes a good read. What's l16n? Did you mean i18n (internationasation)? (I'm not being a pedant; just wondered if I was missing something) :) Edward -- PHP General Mailing List (http://www.php.net/) T

Re: [PHP] Checking how many letters are in a string.

2008-03-20 Thread tedd
At 9:10 AM +0200 3/20/08, Dotan Cohen wrote: On 20/03/2008, tedd <[EMAIL PROTECTED]> wrote: > At least, that's my understanding. Cheers, tedd Thank you Tedd, that was very helpful. After reading your mail from yesterday I went to wikipedia to learn what graphemes and ligatures are. Yo

Re: [PHP] Checking how many letters are in a string.

2008-03-20 Thread Dotan Cohen
On 20/03/2008, tedd <[EMAIL PROTECTED]> wrote: > At 9:29 PM +0200 3/19/08, Dotan Cohen wrote: > >I am asking the second question: how many Hebrew characters in a > >string that _very_likely_ contains other characters as well. The array > >suggestion sounds about what I am doing: checking if each

Re: [PHP] Checking how many letters are in a string.

2008-03-19 Thread tedd
At 9:29 PM +0200 3/19/08, Dotan Cohen wrote: I am asking the second question: how many Hebrew characters in a string that _very_likely_ contains other characters as well. The array suggestion sounds about what I am doing: checking if each letter is a Hebrew character. I will also look into the m

Re: [PHP] Checking how many letters are in a string.

2008-03-19 Thread Dotan Cohen
On 19/03/2008, TG <[EMAIL PROTECTED]> wrote: > > Is the question: > > "How do I tell how many characters are in a string that may contain Hebrew > characters?" > > or is the question... > > "How do I tell how many Hebrew characters are in a string that may contain > Hebrew and non-Hebrew char

Re: [PHP] Checking how many letters are in a string.

2008-03-19 Thread TG
Is the question: "How do I tell how many characters are in a string that may contain Hebrew characters?" or is the question... "How do I tell how many Hebrew characters are in a string that may contain Hebrew and non-Hebrew characters.. but I only want a count of the Hebrew characters?" or

Re: [PHP] Checking how many letters are in a string.

2008-03-19 Thread tedd
At 6:39 PM +0200 3/19/08, Dotan Cohen wrote: I need to count how many Hebrew characters a given string has. I have been checking, character by character, if the given character is a [ý‚™] and if so I simply ++ the counting variable. It turns out that this is rather resouce intensive, and I may ne

Re: [PHP] Checking how many letters are in a string.

2008-03-19 Thread Richard Heyes
I need to count how many Hebrew characters a given string has. I have been checking, character by character, if the given character is a [א-ת] and if so I simply ++ the counting variable. It turns out that this is rather resouce intensive, and I may need a better way of doing this. I have looked a

Re: [PHP] Checking an array against user input?

2008-02-26 Thread Chris
Keikonium wrote: I am a bit confused by your code, Rob. $newTimestamp = $oldTimestamp; $newTimestamp[5] = '.'; means make the 6th character (remember php is 0 based so the first character is index 0) a '.'. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing L

Re: [PHP] Checking an array against user input?

2008-02-26 Thread Keikonium
YE! That works perfectly ^_^. Thank you very much for helping out a PHP noob lol. "Robert Cummings" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Wed, 2008-02-27 at 01:53 -0500, Keikonium wrote: Here is an example of the text I want to update: [01:19:23]And the city lit

Re: [PHP] Checking an array against user input?

2008-02-26 Thread Robert Cummings
On Wed, 2008-02-27 at 01:53 -0500, Keikonium wrote: > Here is an example of the text I want to update: > > [01:19:23]And the city lit up the night > [01:21:04]With the green glow of the Camlin Hotel > > [01:37:49][01:26:82]Ghosts are in the radio, > [01:42:13][01:31:53]They sing along, they sing

Re: [PHP] Checking an array against user input?

2008-02-26 Thread Keikonium
Here is an example of the text I want to update: [01:19:23]And the city lit up the night [01:21:04]With the green glow of the Camlin Hotel [01:37:49][01:26:82]Ghosts are in the radio, [01:42:13][01:31:53]They sing along, they sing along [02:02:14]It's on and the ghosts in the radio [02:05:80]Ar

Re: [PHP] Checking an array against user input?

2008-02-26 Thread Robert Cummings
Show me an example of actual text where you want to update the format. Cheers, Rob. On Wed, 2008-02-27 at 01:42 -0500, Keikonium wrote: > I am a bit confused by your code, Rob. The timestamps will always change > (and have text after them) and that is what I am trying to take into > account. P

Re: [PHP] Checking an array against user input?

2008-02-26 Thread Keikonium
I am a bit confused by your code, Rob. The timestamps will always change (and have text after them) and that is what I am trying to take into account. Perhaps having my entire code might be of more use: Lyrics Editor $letters = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l"

Re: [PHP] Checking an array against user input?

2008-02-26 Thread Robert Cummings
On Wed, 2008-02-27 at 00:36 -0500, Keikonium wrote: > Hello all, > > I am new to this news group, and figured this was the fastest way to get a > good, helpful answer. Here is my problem: > > I have an array that I set up with numbers 00 thru 99. Now, I have some > timestamps that look somewha

RE: [PHP] checking for and enforcing https

2008-02-26 Thread Bastien Koert
> Date: Tue, 26 Feb 2008 17:39:13 -0500 > From: [EMAIL PROTECTED] > To: php-general@lists.php.net > Subject: Re: [PHP] checking for and enforcing https > > On Tue, Feb 26, 2008 at 04:46:38PM -0500, Daniel Brown wrote: >> >&g

Re: [PHP] checking for and enforcing https

2008-02-26 Thread tedd
At 5:39 PM -0500 2/26/08, Rick Pasotto wrote: I've had nothing to add although I've been somewhat annoyed by the excessive quoting. -- "The most important thing in life is not simply to capitalize on your gains. Any fool can do that. The important thing is to profit from your losses. That requ

Re: [PHP] checking for and enforcing https

2008-02-26 Thread Daniel Brown
On Tue, Feb 26, 2008 at 5:39 PM, Rick Pasotto <[EMAIL PROTECTED]> wrote: > I've had nothing to add although I've been somewhat annoyed by the > excessive quoting. That's probably on the fault of people like myself who use Gmail. It hides the quoted text automatically, so we don't even see th

Re: [PHP] checking for and enforcing https

2008-02-26 Thread Rick Pasotto
On Tue, Feb 26, 2008 at 04:46:38PM -0500, Daniel Brown wrote: > > Of course, getting into that is a completely different discussion > from the post made by the OP whom, as it appears, gave up and took > off when Tedd *hijacked* his thread. ;-P No, I've been reading all the posts and have

Re: [PHP] checking for and enforcing https

2008-02-26 Thread Daniel Brown
On Tue, Feb 26, 2008 at 4:06 PM, Shawn McKenzie <[EMAIL PROTECTED]> wrote: > When most people talk about a http and https directory, they are most > likely talking about the common convention in shared hosting especially > on Apache where your account will have a httpdocs/ and a httpsdocs/ > di

Re: [PHP] checking for and enforcing https

2008-02-26 Thread Andrew Ballard
On Tue, Feb 26, 2008 at 4:06 PM, Shawn McKenzie <[EMAIL PROTECTED]> wrote: > > Andrew Ballard wrote: > > On Tue, Feb 26, 2008 at 11:54 AM, tedd <[EMAIL PROTECTED]> wrote: > >> At 11:03 AM -0500 2/26/08, Robert Cummings wrote: > >> >On Tue, 2008-02-26 at 10:57 -0500, Andrew Ballard wrote: > >>

Re: [PHP] checking for and enforcing https

2008-02-26 Thread Shawn McKenzie
Andrew Ballard wrote: > On Tue, Feb 26, 2008 at 11:54 AM, tedd <[EMAIL PROTECTED]> wrote: >> At 11:03 AM -0500 2/26/08, Robert Cummings wrote: >> >On Tue, 2008-02-26 at 10:57 -0500, Andrew Ballard wrote: >> >>> > Am I misunderstanding you somewhere? >> > >> >I don't think you are. I think Ted h

Re: [PHP] checking for and enforcing https

2008-02-26 Thread tedd
At 1:27 PM -0500 2/26/08, Daniel Brown wrote: It's fun to learn, 'cause knowledge is power! ;-P ---* The More You Know! Yes, as the ads say "A mind is a terrible thing..." Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earths

Re: [PHP] checking for and enforcing https

2008-02-26 Thread Daniel Brown
On Tue, Feb 26, 2008 at 1:11 PM, tedd <[EMAIL PROTECTED]> wrote: > At 12:10 PM -0500 2/26/08, Daniel Brown wrote: > >On Tue, Feb 26, 2008 at 11:54 AM, tedd <[EMAIL PROTECTED]> wrote: > >> At present, I use the actual directories (http/https) to determine if > >> the operation of the script i

Re: [PHP] checking for and enforcing https

2008-02-26 Thread tedd
At 12:10 PM -0500 2/26/08, Daniel Brown wrote: On Tue, Feb 26, 2008 at 11:54 AM, tedd <[EMAIL PROTECTED]> wrote: At present, I use the actual directories (http/https) to determine if the operation of the script is secure or not. You also hijack other people's threads. No-no, Tedd! *s

RE: [PHP] checking for and enforcing https

2008-02-26 Thread Warren Vail
is entered using the wrong protocol, I'll issue a redirect to correct things. HTH, Warren Vail > -Original Message- > From: Daniel Brown [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 26, 2008 9:11 AM > To: tedd > Cc: PHP General list > Subject: Re: [PHP] checkin

Re: [PHP] checking for and enforcing https

2008-02-26 Thread Daniel Brown
On Tue, Feb 26, 2008 at 11:54 AM, tedd <[EMAIL PROTECTED]> wrote: > At present, I use the actual directories (http/https) to determine if > the operation of the script is secure or not. You also hijack other people's threads. No-no, Tedd! *slaps hand* > For scripts that don't collect sen

Re: [PHP] checking for and enforcing https

2008-02-26 Thread Andrew Ballard
On Tue, Feb 26, 2008 at 11:54 AM, tedd <[EMAIL PROTECTED]> wrote: > At 11:03 AM -0500 2/26/08, Robert Cummings wrote: > >On Tue, 2008-02-26 at 10:57 -0500, Andrew Ballard wrote: > > > > Am I misunderstanding you somewhere? > > > >I don't think you are. I think Ted has been doing it the hard way

Re: [PHP] checking for and enforcing https

2008-02-26 Thread tedd
At 11:03 AM -0500 2/26/08, Robert Cummings wrote: On Tue, 2008-02-26 at 10:57 -0500, Andrew Ballard wrote: > Am I misunderstanding you somewhere? I don't think you are. I think Ted has been doing it the hard way... but the lightbulb may have just gone on :) Cheers, Rob. It's flickering -- so

Re: [PHP] checking for and enforcing https

2008-02-26 Thread Daniel Brown
On Tue, Feb 26, 2008 at 11:12 AM, Jim Lucas <[EMAIL PROTECTED]> wrote: > And it doesn't say "off". It either exists or doesn't. > > if ( isset($_SERVER['HTTPS']) ) { > // Is using SSL > } else { > // Is NOT using SSL > } Almost correct. From http://php.net/reserved.va

Re: [PHP] checking for and enforcing https

2008-02-26 Thread Dan Joseph
On Tue, Feb 26, 2008 at 11:04 AM, Robert Cummings <[EMAIL PROTECTED]> wrote: > Surely you mean $_SERVER['HTTPS'] and not $_ENV['HTTPS']. > > > woops! yep, I meant $_SERVER, thanks :) -- -Dan Joseph "Build a man a fire, and he will be warm for the rest of the day. Light a man on fire, and will

Re: [PHP] checking for and enforcing https

2008-02-26 Thread Jim Lucas
Robert Cummings wrote: On Tue, 2008-02-26 at 11:00 -0500, Dan Joseph wrote: On Tue, Feb 26, 2008 at 10:56 AM, tedd <[EMAIL PROTECTED]> wrote: So, let's say I wanted script "secure.php" to be forced to use https -- do I use something like what Dan provided, namely? https://".$url.$_SERVER['PHP

Re: [PHP] checking for and enforcing https

2008-02-26 Thread Robert Cummings
On Tue, 2008-02-26 at 11:00 -0500, Dan Joseph wrote: > On Tue, Feb 26, 2008 at 10:56 AM, tedd <[EMAIL PROTECTED]> wrote: > > > > > So, let's say I wanted script "secure.php" to be forced to use https > > -- do I use something like what Dan provided, namely? > > > > > if($_SERVER['SERVER_PORT

Re: [PHP] checking for and enforcing https

2008-02-26 Thread Robert Cummings
On Tue, 2008-02-26 at 10:57 -0500, Andrew Ballard wrote: > On Tue, Feb 26, 2008 at 10:16 AM, tedd <[EMAIL PROTECTED]> wrote: > > At 3:47 PM +0100 2/26/08, Per Jessen wrote: > > > > >tedd wrote: > > > > > >> Sometimes I feel like a child here. > > >> > > >> Under what circumstances would one

Re: [PHP] checking for and enforcing https

2008-02-26 Thread Robert Cummings
On Tue, 2008-02-26 at 10:56 -0500, tedd wrote: > At 10:24 AM -0500 2/26/08, Robert Cummings wrote: > >On Tue, 2008-02-26 at 10:16 -0500, tedd wrote: > > > Then a user wants to purchase something and I direct them to a unique > >> script in the https directory and that script takes their sensitiv

Re: [PHP] checking for and enforcing https

2008-02-26 Thread Dan Joseph
On Tue, Feb 26, 2008 at 10:56 AM, tedd <[EMAIL PROTECTED]> wrote: > > So, let's say I wanted script "secure.php" to be forced to use https > -- do I use something like what Dan provided, namely? > > if($_SERVER['SERVER_PORT'] != '443') { > $url = isset($_SERVER['HTTP_HOST']) ? $_SERVE

Re: [PHP] checking for and enforcing https

2008-02-26 Thread Andrew Ballard
On Tue, Feb 26, 2008 at 10:16 AM, tedd <[EMAIL PROTECTED]> wrote: > At 3:47 PM +0100 2/26/08, Per Jessen wrote: > > >tedd wrote: > > > >> Sometimes I feel like a child here. > >> > >> Under what circumstances would one require that? > >> > >> If your script is in a https directory, isn't t

Re: [PHP] checking for and enforcing https

2008-02-26 Thread tedd
At 10:24 AM -0500 2/26/08, Robert Cummings wrote: On Tue, 2008-02-26 at 10:16 -0500, tedd wrote: > Then a user wants to purchase something and I direct them to a unique script in the https directory and that script takes their sensitive data and finalizes the sale. What's wrong with that? N

Re: [PHP] checking for and enforcing https

2008-02-26 Thread Robert Cummings
On Tue, 2008-02-26 at 10:16 -0500, tedd wrote: > At 3:47 PM +0100 2/26/08, Per Jessen wrote: > >tedd wrote: > > > >> Sometimes I feel like a child here. > >> > >> Under what circumstances would one require that? > >> > >> If your script is in a https directory, isn't that secure? OR, is > >> t

Re: [PHP] checking for and enforcing https

2008-02-26 Thread Wolf
tedd <[EMAIL PROTECTED]> wrote: > At 3:47 PM +0100 2/26/08, Per Jessen wrote: > >tedd wrote: > > > >> Sometimes I feel like a child here. > >> > >> Under what circumstances would one require that? > >> > >> If your script is in a https directory, isn't that secure? OR, is > >> this somet

Re: [PHP] checking for and enforcing https

2008-02-26 Thread tedd
At 3:47 PM +0100 2/26/08, Per Jessen wrote: tedd wrote: Sometimes I feel like a child here. Under what circumstances would one require that? If your script is in a https directory, isn't that secure? OR, is this something else? Please explain. You might want to do such checks if your

Re: [PHP] checking for and enforcing https

2008-02-26 Thread Robert Cummings
On Tue, 2008-02-26 at 09:45 -0500, Dan Joseph wrote: > On Tue, Feb 26, 2008 at 9:39 AM, tedd <[EMAIL PROTECTED]> wrote: > > > Sometimes I feel like a child here. > > > > Under what circumstances would one require that? > > > > If your script is in a https directory, isn't that secure? OR, is > >

Re: [PHP] checking for and enforcing https

2008-02-26 Thread Aleksandar Vojnovic
If you are running Apache you could use a rewrite rule for such a case. Example below RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(my|folder|examples) /https/://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] Aleksander Per Jessen wrote: tedd wrote: Sometimes I feel like a child h

Re: [PHP] checking for and enforcing https

2008-02-26 Thread Daniel Brown
On Tue, Feb 26, 2008 at 9:39 AM, tedd <[EMAIL PROTECTED]> wrote: > Sometimes I feel like a child here. > > Under what circumstances would one require that? > > If your script is in a https directory, isn't that secure? OR, is > this something else? > > Please explain. HTTPS is a protocol:

Re: [PHP] checking for and enforcing https

2008-02-26 Thread Per Jessen
tedd wrote: > Sometimes I feel like a child here. > > Under what circumstances would one require that? > > If your script is in a https directory, isn't that secure? OR, is > this something else? > > Please explain. You might want to do such checks if your website (www.example.com) is accessib

Re: [PHP] checking for and enforcing https

2008-02-26 Thread Dan Joseph
On Tue, Feb 26, 2008 at 9:39 AM, tedd <[EMAIL PROTECTED]> wrote: > Sometimes I feel like a child here. > > Under what circumstances would one require that? > > If your script is in a https directory, isn't that secure? OR, is > this something else? > > Well for instance. We have a web server her

Re: [PHP] checking for and enforcing https

2008-02-26 Thread tedd
At 2:09 PM -0500 2/25/08, Daniel Brown wrote: On Mon, Feb 25, 2008 at 1:40 PM, Rick Pasotto <[EMAIL PROTECTED]> wrote: What is the best or recomended proceedure for making sure that a page is accessed only via a secure connection? Provided you're running SSL on the standard HTTPS port o

Re: [PHP] checking for and enforcing https

2008-02-25 Thread Dan Joseph
On Mon, Feb 25, 2008 at 2:09 PM, Daniel Brown <[EMAIL PROTECTED]> wrote: > if($_SERVER['SERVER_PORT'] != '443') { >$url = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : > $_SERVER['SERVER_NAME']; >header("Location: > https://".$url.$_SERVER['PHP_SELF']."?".$_SERVER['QUE

Re: [PHP] checking for and enforcing https

2008-02-25 Thread Stephen Johnson
008 14:26:12 -0500 > To: Stephen Johnson <[EMAIL PROTECTED]> > Cc: Rick Pasotto <[EMAIL PROTECTED]>, > Subject: Re: [PHP] checking for and enforcing https > > Nope, it works like a charm for me, but I have it in an IF statement checking > to see if the requestor is h

Re: [PHP] checking for and enforcing https

2008-02-25 Thread Stut
On 25 Feb 2008, at 18:40, Rick Pasotto wrote: What is the best or recomended proceedure for making sure that a page is accessed only via a secure connection? What web server are you using? In my experience this is best done there rather than in PHP. -Stut -- http://stut.net/ -- PHP Gene

Re: [PHP] checking for and enforcing https

2008-02-25 Thread Wolf
Stephen Johnson <[EMAIL PROTECTED]> wrote: > > Or you can cheat... > > > > $url = $_SERVER['SERVER_NAME']; > > header( 'Location:https://'.$url.''); > > > > > > I think that would cause an infinite loop of redirection... > > This would be better > > > $curPort = $_SERVER['SERVER_PO

Re: [PHP] checking for and enforcing https

2008-02-25 Thread Wolf
ephen Johnson c | eh > The Lone Coder > > http://www.thelonecoder.com > continuing the struggle against bad code > > http://www.fortheloveofgeeks.com > I¹m a geek and I¹m OK! > -- > > > > > > From: Wolf <[EMAIL PROTECTED]> > > Date: Mon, 2

Re: [PHP] checking for and enforcing https

2008-02-25 Thread Stephen Johnson
?> -- Stephen Johnson c | eh The Lone Coder http://www.thelonecoder.com continuing the struggle against bad code http://www.fortheloveofgeeks.com I¹m a geek and I¹m OK! -- > From: Wolf <[EMAIL PROTECTED]> > Date: Mon, 25 Feb 2008 13:55:41 -0500 > To: Rick Pasotto <[EMAI

Re: [PHP] checking for and enforcing https

2008-02-25 Thread Daniel Brown
On Mon, Feb 25, 2008 at 1:40 PM, Rick Pasotto <[EMAIL PROTECTED]> wrote: > What is the best or recomended proceedure for making sure that a page is > accessed only via a secure connection? Provided you're running SSL on the standard HTTPS port of 443, include this at the very top of every fil

  1   2   3   4   5   >