Unstoppable Domains

Getting information from a field

Spaceship Spaceship
Watch
Impact
11
How do i get information from a field and then add it to an if statement?

I have:

PHP:
<?
if($check==yes){
echo'OK';
}
else {
echo'NO';
}
?>

<form name="searchform" method="post" action="check.php">
<input type="text" name="check" id="check" value="<? $check ?>" size="25">
<input type="hidden" name="action" value="check">
<input type="submit" name"submit" value="Check">
</form>

Im going to end up searching a database and if the information thats entered is found, they it will say its found, if not it would say its not found.



Nvm, i got it.
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable DomainsUnstoppable Domains
You need to get the variable first via $_POST['name'] access semantics. Nobody in their right mind leaves register_globals on anymore.

For example, to check for a flag called "foo", my php would do this:
Code:
$flag = $_POST['foo'];
if( isset($flag) ) {
  echo "way to go smartguy, you typed \"$flag\".";
}

and my html for bit would look like:
Code:
<input type="text" name="flag" />

Now, if someone were to set the flag by typing something in there, it would execute, otherwise not.
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99
Appraise.net

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back