NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Getting information from a field

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 07-03-2006, 12:33 PM THREAD STARTER               #1 (permalink)
Senior Member
 
killaklown's Avatar
Join Date: Oct 2003
Posts: 3,472
killaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to beholdkillaklown is a splendid one to behold
 



Getting information from a field


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

I have:

PHP Code:
<?
????: NamePros.com http://www.namepros.com/programming/213141-getting-information-from-a-field.html
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 by killaklown; 07-03-2006 at 12:43 PM.
killaklown is offline  
Old 07-05-2006, 02:01 PM   #2 (permalink)
NamePros Regular
 
monaco's Avatar
Join Date: Jul 2005
Location: Tucson, AZ
Posts: 689
monaco will become famous soon enough
 



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:
????: NamePros.com http://www.namepros.com/showthread.php?t=213141
Code:
<input type="text" name="flag" />
Now, if someone were to set the flag by typing something in there, it would execute, otherwise not.
__________________
My Website | My Blog
monaco is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 07:01 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger