Login module with css

0 Parth Patwala · September 15, 2015
hey. i want the code when user log in and if enters invalid data then message should appear in the div. In the example div is previously hidden with the message and when user enters invalid username and password combination then div should appear. I did that but not working for me. 
Do it with two text box and predefined values. That will take less time.

Post a Reply

Replies

Oldest  Newest  Rating
0 Casper Hollemans · September 16, 2015
Could you post your code? :)

And i'm not sure but i think the best way of doing that is using JavaScript
0 Parth Patwala · September 16, 2015
Casper i'm using php as a validation. So invalid username and password validation should not contain javascript code. so to help me so just need two textbox,one button, one hidden div and php method. Then you just get two values and check condition like.
if($username=='somthing' && $password=='xyz')

So. when this condition is false, that hidden div will appear. I dont know how to do it with php, so i posted this. 
:)
0 Casper Hollemans · September 16, 2015
I assume he's codeing in PHP becouse this is the PHP category
0 Casper Hollemans · September 16, 2015
lol, but well this forum/website is to learn code and stuff i i don't blame em but they could at least react a bis faster if we want to help :p
0 Casper Hollemans · September 16, 2015
PHP is not ment for that kind of stuff (make a site interactive)
I'd still recommend javascript.
But that doesn't solve your problem, if you really want to do it that way.
Try to be creative with ur code.
Im thinking of something like this:







//set the div what has to appear invisible in your css doc






try somthing like this, remind always try to be creative and try to think outside the box
hope it's usefull
-Greets
0 Casper Hollemans · September 16, 2015
mhhh that sucks my code is gone except of one not.

what i basicually did was
if(usrname == $usrname && ......){
//run this code
}else{
echo" #div{display:visible;} ";
]


first set the div invisible in your css and hope it works, not sure yet.
it's like who's gonna rule the css doc or is this echo going to overwrite it
0 Parth Patwala · September 17, 2015
okay. Thanks casper. i will try.
0 Casper Hollemans · September 17, 2015
forgot somthing sorry in the echo use this one:

echo " #div{divsplay:visable;}";
  • 1

PHP

107,269 followers
About

Server-side, HTML embedded scripting language used to create dynamic Web pages.

Links
Moderators