strncmp function (Forgot code snippit)
| From: | Russ | Date: | Wed, 30 Mar 2005 21:18:00 +0000 |
| Subject: | strncmp function (Forgot code snippit) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-211927@lists.php.net to get a copy of this message | ||
Subject: strncmp function
Date: Wednesday 30 March 2005 01:14 pm
From: Russ <russbucket@centurytel.net>
To: PHP General <php-general@lists.php.net>
I'm new to php and linux. I am trying to replace a password program I used
under windows with a mysql based login. I want to compare the first character
of the first and last name of the user for a capital letter. My login program
passes a user name and password. Below is a start to the program but I'm
alittle confused on how to set str1 to check all letters of the alphabet. Can
anyone point me to a document or give me an idea on how to do this? I can not
use .htaccess do to ISP (host) rules. Access is to a members only sectionof
the webpages for my Lions club.
<?php
$fname=John;
$lname=Smith;
if(strncmp(S,${lname},1) ===0) {
?>
<h1>strncmp() must have returned returned non-false</h1>
<?php
} else {
?>
<h3>Strncmp() must have returned false</h3>
<?php
}
?>
--
Russ