[PHP] Re: checking for and enforcing https

2008-02-25 Thread Shawn McKenzie
Rick Pasotto wrote: > What is the best or recomended proceedure for making sure that a page is > accessed only via a secure connection? > Best is subjective, however I check in $_SERVER['SERVER_PROTOCOL'], also https will appear in some other $_SERVER vars. -Shawn -- PHP General Mailing List (h

[PHP] Re: Checking a date for validity

2005-09-07 Thread JamesBenson
I would use something like:- $date = '09/09/2005'; list($month, $day, $year) = explode("/", $date); if(checkdate($month, $day, $year)) { /* valid date */ } else { /* invalid date */ } Todd Cary wrote: I need to check the input of a

[PHP] Re: checking for internet connection

2005-07-20 Thread Mark Rees
"Steven" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi > > I am looking for a simple way to check if the server is connected to the > Internet, they use a dialup to get Internet connection, and I need to > email reports out, but want to check to see if the user remembered to > c

[PHP] Re: Checking if

2005-01-11 Thread Ben Ramsey
Bruno B B Magalhães wrote: how to determine if the last char of a string is a '/'... The problem, a webpage can be accessed by www.domain.com/page.php or www.domain.com/page.php/ Use substr()... http://www.php.net/substr $url = 'http://example.com/index.php/'; if (strcmp(substr($url, -1), '/') ==

[PHP] Re: checking multiple URL parameters

2004-09-17 Thread Christian David
Dustin Krysak wrote: > now what I need to do is modify the code so that the script checks 2 > URL parameters, and has 2 variables defined (from the URL parameter)... > > So I need to also check if $_REQUEST['year'] is set as well as the > original (both need to be set to get the first HTML conten

Re: [PHP] Re: Checking for form submission

2004-08-04 Thread Jason Wong
On Wednesday 04 August 2004 18:21, Craig Donnelly wrote: > Ok, in simple form - If the submit button was clicked, > If some one hits enter this would be a problem, easy way to resolve > this would be to have a hidden form element flagged and to terst for that > instead of the > submit button, would

Re: [PHP] Re: Checking for form submission

2004-08-04 Thread Craig Donnelly
Ok, in simple form - If the submit button was clicked, If some one hits enter this would be a problem, easy way to resolve this would be to have a hidden form element flagged and to terst for that instead of the submit button, wouldnt you agree Jason? Craig "Jason Wong" <[EMAIL PROTECTED]> wrote

Re: [PHP] Re: Checking for form submission

2004-08-04 Thread Jason Wong
On Wednesday 04 August 2004 17:34, Craig Donnelly wrote: > If you want to test to see if a form has been submitted, I would suggest > that you > use the name from the submit button. > > e.g - > > if(isset($_POST['sendform'])){ > echo "Form has been submitted!"; > } > > So basically this check

[PHP] Re: Checking for form submission

2004-08-04 Thread Craig Donnelly
Hi Shaun, Your expression is evaluating, if you like does the $_POST superglobal exist and it does but might be empty, this would be the same for $_GET and other superglobals. If you did the following: if (isset($_POST) && !empty($_POST)) { echo '(isset($_POST))'; } This would only appear i

[PHP] Re: Checking if a website is up?

2004-03-30 Thread Jason Barnett
Henry Grech-Cini wrote: Hi All, I am trying to check if a website is up (reachable) and I have used the standard code below: Unfortunately this works for most sites but Microsoft doesn't work most of the time even thought the site is definiately up! (Occassionally it does say it is reachable but

[PHP] Re: Checking a URL string.

2003-12-12 Thread Mike
try the PEAR Validate class you can do Validate::url($websiteUrl); by the way, preg is quicker than ereg Mike Philip J. Newman wrote: I would like to check if i have a correct url enterend --- Philip J. Newman Master Developer PhilipNZ.com [NZ] Ltd. [EMAIL PROTECTED] -- PHP General Mailing Li

[PHP] Re: Checking for Javascript funcionality

2003-08-26 Thread Kae Verens
Hecchan wrote: I do something similar to this at http://contactjuggling.org/ if the server thinkks JavaScript is set, then it uses the above to make sure. Otherwise, it puts this in the header: document.location="/?s=1" Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe

[PHP] Re: checking the return value of member function with empty

2003-08-14 Thread Greg Beaver
Hi, empty() is confusing, because it is not a function, but a language construct, like isset(). As such, you can only use it on variables, and not on expressions or function return values. See the very small print Note at the bottom of: http://www.php.net/empty Note: Because this is a langua

[PHP] Re: checking how many records are returned?

2003-08-06 Thread Nadim Attari
> Is there a way to check how many records are returned from a query to the > database? Which database? MsSQL? mySQL? mSQL? PostgreSQL? ? If it's mySQL then try mysql_num_rows -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Checking a string for # of charactors.

2003-03-28 Thread rotsky
strlen() > I would like to check that a string as more than 20 charactors in it. Can > someone point me in the right direction. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Checking for Null Variables

2003-03-07 Thread Christopher J. Crane
isset is the function I was looking for. I could not remember what it was. Thank you. "Bobby Patel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > you can look at isset() and empty(). If you retrieve the query result with > Mysql association (ie. $field=mysql_fetch_array($resource, M

[PHP] Re: Checking for Null Variables

2003-03-07 Thread Bobby Patel
you can look at isset() and empty(). If you retrieve the query result with Mysql association (ie. $field=mysql_fetch_array($resource, MYSQL_ASSOC), then even the field has a blank value, there will be a blank variable created ($field["Name"] is created but with no value)), however if you grab the r

RE: [PHP] Re: Checking for empty values sent from a form[Scanned]

2003-03-06 Thread Michael Egan
March 2003 14:24 To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: Checking for empty values sent from a form[Scanned] You usually don't want spaces either foreach($_POST as $val) { if(strlen(trim($val)) < 1) // do what you want } "Rick Emery" <[EMAIL PROTECTED]&g

Re: [PHP] Re: Checking for empty values sent from a form

2003-03-06 Thread Leendert
{ > do something > } > - Original Message - > From: "shaun" <[EMAIL PROTECTED]> > To: <> > Sent: Thursday, March 06, 2003 7:45 AM > Subject: [PHP] Re: Checking for empty values sent from a form > > > thanks for your reply but I was

Re: [PHP] Re: Checking for empty values sent from a form

2003-03-06 Thread Lowell Allen
(I think this is from the Welling and Thomson book -- PHP and MySQL Web Development.) -- Lowell Allen > From: "shaun" <[EMAIL PROTECTED]> > Date: Thu, 6 Mar 2003 13:45:52 - > To: [EMAIL PROTECTED] > Subject: [PHP] Re: Checking for empty values sent from a form >

Fw: [PHP] Re: Checking for empty values sent from a form

2003-03-06 Thread Rick Emery
foreach($HTTP_POST_VARS as $val) if($val=="") { do something } - Original Message - From: "shaun" <[EMAIL PROTECTED]> To: <> Sent: Thursday, March 06, 2003 7:45 AM Subject: [PHP] Re: Checking for empty values sent from a form thanks for your re

[PHP] Re: Checking for empty values sent from a form

2003-03-06 Thread shaun
thanks for your reply but I was wondering if there was a way to check through all of the form entries with an easier way that if ($_POST['your_input_name'] == '' || $_POST['your_input_name'] == '' || $_POST['your_input_name'] == '' || $_POST['your_input_name'] == '' ) //etc // field is empty th

[PHP] Re: Checking for empty values sent from a form

2003-03-06 Thread Niels Andersen
Since input from a form are strings, you can check like this: if ($_POST['your_input_name'] == '') // field is empty "Shaun" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Is there an easy way to scan through an array of values sent from a form to > see if any of them are empty?

Re: [PHP] Re: Checking for HTTP:// at the start of a string and more ////

2003-03-01 Thread Ernest E Vogelsinger
At 01:17 02.03.2003, Kris Jones said: [snip] >>Untested: >> >>if (preg_match('/^http:\/\/[^\.\s]+\.[^\s]+\/$/i', $string)) >>// valid string >>else >>// invalid string >> > >I've also been looking for this information. Can you please point me to a >l

[PHP] Re: Checking for HTTP:// at the start of a string and more ////

2003-03-01 Thread Kris Jones
Untested: if (preg_match('/^http:\/\/[^\.\s]+\.[^\s]+\/$/i', $string)) // valid string else // invalid string Should match a string beginning with 'http://', followed by one or more characters that are no dots or whitespace, followed by a dot, followed >by one or more characters that are no

Re: [PHP] Re: Checking File Size BEFORE Uploading

2002-10-14 Thread Jason Wong
On Tuesday 15 October 2002 04:29, Monty wrote: > Nicos, the problem is that MAX_FILE_SIZE doesn't check the file size before > it's uploaded to the server, it only works afterwards. So, you have to > first wait for the file to upload before you know whether or not it's too > large. Actually it do

[PHP] Re: Checking File Size BEFORE Uploading

2002-10-14 Thread Monty
Nicos, the problem is that MAX_FILE_SIZE doesn't check the file size before it's uploaded to the server, it only works afterwards. So, you have to first wait for the file to upload before you know whether or not it's too large. Thanks. > Hi, > > The way is : > > > Send this file: > > > See

[PHP] Re: Checking File Size BEFORE Uploading

2002-10-14 Thread nicos
Hi, The way is : Send this file: See the MAX_FILE_SIZE hidden BEFORE the userfile's type. See also: http://www.php.net/manual/sk/features.file-upload.php -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet "Monty" <[EMAIL PROTECTED]> a écrit da

[PHP] Re: Checking Session Vars in Functions

2002-08-09 Thread lallous
try to check if a session is session or not via: session_is_registered() Elias "Monty" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I have PHP 4.2.2 with register_globals=off. > > It seems like session vars stored in $_SESSION[] aren't visible to > functi

[PHP] Re: Checking Insert to Postgre, whats wrong?

2002-07-28 Thread Yasuo Ohgaki
Bård Magnus Fauske wrote: > But when I print the result from pg_fetch_result() to the browser (last > lines above), I only get the first letter in the string $fornavn[$i] and > similar strings not listed above, not the whole string. What is the > reason for this? Has it something to do with the

Re: [PHP] Re: checking

2002-07-01 Thread Uli B
"==" (2) is for comparison while you are accidently doing assignments by "=" (1) if ($lastname="") - wrong if ($lastname=="") - better that's why u r screwed up here :-) Uli At 17:49 30.06.02 -0500, Richard Lynch wrote: >In article <03d201c21db6$7deb2110$7800a8c0@leonard> , [EMAIL PROTECTED] >(L

[PHP] Re: checking

2002-07-01 Thread Richard Lynch
In article <03d201c21db6$7deb2110$7800a8c0@leonard> , [EMAIL PROTECTED] (Leo) wrote: >I have a form and I don't want to insert recording with blank value. >I put: >if ($lastname="") { >$insert="no" >} >if ($insert="no"){ >do not insert; >else >insert; >} >my probleme is in some case $

[PHP] Re: checking date is not greater than today

2002-06-30 Thread Timothy J. Luoma
On Mon, 1 Jul 2002, Peter J. Schoenster wrote: > On 30 Jun 2002 at 22:31, Timothy J. Luoma wrote: > > > I am trying to compare a given date string (i.e. June 30, 2002 is > > 20020630). I want to make sure that the input string that is given is > > not greater than today (i.e. if today is June 30

[PHP] Re: checking if a link is still "alive"

2002-03-21 Thread Julio Nobrega Trabalhando
Open a connection? Maybe fopen, dns search, ip search, anything. I just don't know which way is faster (I think it's fopen). -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.n

[PHP] RE: checking if a link is still "alive"

2002-03-21 Thread Christoph Starkmann
Outsch, sorry, I just found what I wanted... > Is there any posibility to check if there is > actually a website behind a link or just, let's > say a 404? http://www.hotscripts.com/PHP/Scripts_and_Programs/Link_Checking/ Have a nice day ;) Kiko - It's not a bug, it's a feature. christoph s

Re: [PHP] Re: Checking to see what value error_reporting is set at?

2002-03-10 Thread David Robley
Robley" <[EMAIL PROTECTED]> > To: <> > Sent: Saturday, March 09, 2002 6:52 PM > Subject: [PHP] Re: Checking to see what value error_reporting is set at? > > > > In article <00b801c1c714$b4854230$0501a8c0@zaireweb>, > > [EMAIL PROTECTED] says... > &g

Re: [PHP] Re: Checking to see what value error_reporting is set at?

2002-03-09 Thread eric.coleman
I ment, if you re-set it, as im setting it to error_reporting(E_ALL); depending on a value i get from a db query... -Eric - Original Message - From: "David Robley" <[EMAIL PROTECTED]> To: <> Sent: Saturday, March 09, 2002 6:52 PM Subject: [PHP] Re: Chec

[PHP] Re: Checking to see what value error_reporting is set at?

2002-03-09 Thread David Robley
In article <00b801c1c714$b4854230$0501a8c0@zaireweb>, [EMAIL PROTECTED] says... > Is it possible to return what error_reporting is set at currently? If not, think >they would be able to throw it into the newest build of php? > > Thanks, > Eric > Have a look at the ini_get function -- David

[PHP] Re: Checking for characters in string

2002-01-04 Thread Joe Webster
This one had me for a min, thank god for the lookahead =) $password_string being the password in quesiton, $is_valid = true when it is valid, false when it's not valid. $is_valid = preg_match("/(?=.*\d)(?=.*[a-z])(?=.*[A-Z])./", $password_string); I've said it before and I'll say it again, preg

Re: [PHP] Re: Checking if session has been started

2001-09-22 Thread Alexander Skwar
So sprach »Fredrik Arild Takle« am 2001-09-22 um 18:00:37 +0200 : > session_register("valid_session"); > > OR SOMETHING LIKE THIS? > > if (session_is_registered($valid_session)) { Yep, that seems better. Thanks to both of you! Alexander Skwar -- How to quote: http://learn.to/quote (germ

[PHP] Re: Checking if session has been started

2001-09-22 Thread Fredrik Arild Takle
session_start(); $valid_session = true; session_register("valid_session"); OR SOMETHING LIKE THIS? if (session_is_registered($valid_session)) { // Do something?! } "Gaylen Fraley" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Why not populate a

[PHP] Re: Checking if session has been started

2001-09-22 Thread Gaylen Fraley
Why not populate a session variable, in the page that starts the session, like : session_start(); session_register("valid_session"); $valid_session = true; Then in the page that you need to check, like: if ($session_valid) { // Do something since a session is already running } -- Gay

[PHP] Re: checking if checkbox is checked

2001-07-06 Thread George Whiffen
To check if a type checkbox variable has been set use isset() i.e. if ( isset($interest) or isset($interest2) or isset($interest3) or isset($interest4) or isset($interest1) ) { // Everthing is ok } else { $error = . ) This should do exactly what you want, and a