Follow us on Twitter!
You cannot teach a man anything; you can only help him find it within himself. - Galileo
Thursday, April 24, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 23
Guests Online: 19
Members Online: 4

Registered Members: 82895
Newest Member: kevy90
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

PHP Coding Help


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 09-07-05 16:45
ok this is what i have so far.

Code

<html>
<body>
<body bgcolor=black>
<br>
<br>
<br>
<br>
<center><font color=white><font size=4> How much dirt is in a hole 6 and a half feet wide, 8 feet deep, and 5 feet long?

<form action="" method="POST">
Answer: <input type="password" name="password" />
<input type="submit" />
</form>

<?php
if($password=='none' {
echo "Good job! You got it correct!<br>\n";
}
else {echo "Nice try, but you need to think more.<br>\n";
}
?>

</font>
</body>
</html>





Now what I want it to do is check to see if the password from the form is none. If it is then to echo "Good job! You got it correct!" But for ome reason I cant get it to work. I think it is a problem with my form but I dont know Im new to integradeing PHP with HTML. Not to mention that this is the first PHP code I have ever written. Anyone with a little advice?
Author

RE: PHP Coding Help

Mr_Cheese




Posts: 2468
Location: Brighton, UK
Joined: 30.11.04
Rank:
Uber Elite
Posted on 09-07-05 17:24
Code

<?php
if($password=='none' {
echo "Good job! You got it correct!<br>\n";
}
else {echo "Nice try, but you need to think more.<br>\n";
}
?>




try this...

Code

<?php
if($_POST['password'] = 'none' ) {
echo "Good job! You got it correct!<br>\n";
}
else {
echo "Nice try, but you need to think more.<br>\n";
}
?>







Edited by Mr_Cheese on 09-07-05 19:10
http://www.hellboundhackers.org/
Author

RE: PHP Coding Help


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 27-09-05 08:10
Mr_Cheese wrote:
Code

<?php
if($_POST['password'] = 'none' ) {
echo "Good job! You got it correct!<br>\n";
}
else {
echo "Nice try, but you need to think more.<br>\n";
}
?>



No in that if() statement your setting the $_POST['pass'] to the actual password instead of checking it using the ''equal too'' logical operator in C++ ie....
Code

if($_POST['test'] == "myPass" )  // This would check it ( compare )




is not the same as...
Code

if($_POST['test'] = "myPass" ) // This sets the input to the actuall pass so always says anything they enter is correct.



Author

RE: PHP Coding Help


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 27-09-05 08:13
And as for to answer the original question you are using the variable $password... but it's not set to nothing? It's blank.. See you have
Code

<?php
if($password=='none' {
echo "Good job! You got it correct!<br>\n";
}
else {echo "Nice try, but you need to think more.<br>\n";
}
?>




when you need it set to...
Code

<?php
$password = $_POST['password'];
if($password == 'none') {
echo "Good job! You got it correct!<br>\n";
}
else {echo "Nice try, but you need to think more.<br>\n";
}
?>




You also forgot your closing ')' on the if() statment.