Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Verify Two Text Box Values 3

Status
Not open for further replies.

lanm

Programmer
Jul 7, 2005
244
US
This should be very simple, but I'm having a bit of trouble.

I have two text boxes, a numberID and a password.
I need to:
1. Verify the numberID is a vaild ID in my table from an SQL query (I'm doing that now with a recordset)
2. Make sure the password is valid
3. If numberID is valid, and password is correct, Update column to 1 from value of 0.

This is a simple application, but I am VERY new to PHP. I did it in ASP.NET but it's not supported on the server.
Any suggestions, sampel code or articles would be appreciated.

Thanks! I'm diggin' in my PHP books as we speak.
 
sorrr it supposed to be
Code:
if(isset($totalRows_Recordset2)){

Sure wish there were an edit Post option.
 
Thanks vacunita!

I used:

if(isset($totalRows_Recordset2)){
$IDFound = "This is a valid IDNumber";
$IDNotFound = "This is not a valid IDNumber";
If ($totalRows_Recordset2==1)
{echo $IDFound;}
Else
{echo $IDNotFound;}

How can I make sure the echo fires only when the submit button is clicked, or at least hide the echo till the user clicks the button. When the page loads, it'll always say "This is not a valid IDNumber" since the query goes off the text box in the form.

Thanks!
 
Try this line it should work:

Code:
if (isset($_POST['Znumber'])) {
instead of
Code:
 if(isset($totalRows_Recordset2)){
 
sleipnir214 thanks for the help!

vacunita that's exactly what I needed!!!!!!!!!

I know this page is a bit rough, but hopefully I'll only get better.

Thanks again to both of you!
 
I must say, even though you have some problems here, you have some good programming too..

I see you use sprintf for one.

even so, why do you do:
Code:
<?php require_once('Connections/conn.php'); ?>
<?php...

Also, below that large chunk of code-area, you do:
Code:
...?>
<?PHP

If it's to seperate different chunks of code, you might consider rather commenting the code, as well as indenting it properly.
You might also want to look at building functions, etc.

Olav Alexander Mjelde
Admin & Webmaster
 
DaButcher,

I think Dreamweaver put the:

<?php require_once('Connections/conn.php'); ?>

....in there!

Thanks for the tips.

Any advice is welcome!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top