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 !

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.