Web Design Forum  
 
Go Back   Web Design Forum > Web Software > Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 12-08-2011, 05:24 AM   #1
New Member
 
Join Date: Dec 2011
Posts: 3
Default Link bassed on what was typed into box.

Hi. I'm working on a portion of the website where a user can type in some test, and if the text is recognized, then it when they click a submit button, it will take them to a page relevant to what they typed in. If they type something in wrong, they go to a another page. I'm guessing some kind of java-script would do it.

Thank you very much in advance.
miatthas is offline   Reply With Quote


Old 12-08-2011, 11:49 AM   #2
Silver Member
 
Join Date: Aug 2011
Posts: 100
Default

You could do this in PHP very easily:

PHP Code:
if(isset($POST['text_sub'])){

  if(
$POST['text_sub'] == 'yourtext')
     
header('location: success.php');
  else
    
header('location: fail.php');


__________________
Mark R

Wubbleyou - Web Design Newcastle
A professional web design agency based in Newcastle upon Tyne servicing clients based throughout the U.K.

Home spray tan machine - Landlord Reviews
MarkR is offline   Reply With Quote
Old 12-08-2011, 11:15 PM   #3
New Member
 
Join Date: Dec 2011
Posts: 3
Default

thank you for your response, but i'm not exactly sure where to put the code.

HTML Code:
<div>
<form>
  <div align="center"><p>First Name 
  <input name="firstname" type="text" />
  </p></div>
    <div align="center"><input type="submit" name="login" id="login" value="Login"/></div>
</form>
</div>
Would you put the code in the header or the body? Also, would there be and client side scripts that would run this as well?
miatthas is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:35 AM.


Camera Forum - Computer Forum - Web Design Forum

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.