strncmp function (Forgot code snippit)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 






Subject: strncmp function
Date: Wednesday 30 March 2005 01:14 pm
From: Russ <russbucket@xxxxxxxxxxxxxx>
To: PHP General <php-general@xxxxxxxxxxxxx>

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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux