Posted by Russ on 03/31/05 00:18
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
Navigation:
[Reply to this message]
|