Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Getting information from a field

SpaceshipSpaceship
Spacemail by SpaceshipSpacemail by Spaceship
Namecheap AuctionsNamecheap Auctions
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
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
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
Close
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

A browser tab with a favicon next to the page title
Search members
You can now search for members by name, company, location and more. Open the search at the top of any page and choose Members. You will...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back