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
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
"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
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), '/') ==
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
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
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
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
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
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
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
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
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
> 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
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
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
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
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
{
> 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
(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
>
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
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
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?
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
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
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
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
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
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
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
"==" (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
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 $
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
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
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
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
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
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
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
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
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
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
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
43 matches
Mail list logo