Jump to content

validate password and image thingy problems!


j33baS

Recommended Posts

Hi im trying to make a little script to improve a registration page, its your standard affair with 2 password textfeilds which need to equal each other and a jpg with text in which the user must type out, looks sumthing like ...

 

<?php

if($_POST['submit']) {

if($_POST['password'] == $_POST['password2']){
if($_POST['verifyimg'] != "1234"){
require("header.php");
echo "you did not type out the text in the image correctly";
}
else {
$sql = "IBIG SILLY QUERY"; blahblah
}
}
else{
require("header.php");

echo "you mistyped your password";
}
}
else {
require("header.php");
?>
forms and submit button ....

 

I realise this is a very silly and ugly way to do it and it also doesnt completely work... If you type the text in the image, it performs the query without checking the password if they are left empty, because empty == empty.

 

Is there a way i could improve this ?

 

I was thinking a list of else if's ? but can i compare 2 conditions in one go ? for example ...

 

else if(password1 == password2) && (image = imagetxt){

 

}

 

Any help greatly appreciated, im far from the best programmer !

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.