Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Data verification


  • Please log in to reply

#1
eazyc10

eazyc10

    New Member

  • Member
  • Pip
  • 5 posts
I need a simple script (in php or javascript) to check the data entered in a form field and depending on what is entered, it will send it to a specific page.

For example, if a user enters in a, it will go to page 1. If they enter b, it will go to page 2

Seems to be simple enough but I don't know enough about php to get it started


Thanks!
  • 0

Advertisements


#2
MaleqAlhaq

MaleqAlhaq

    Member

  • Member
  • PipPip
  • 18 posts
I'm not into much of PHP either, but as far as I can recall you can do that with an if thing. Can't say much more, but have a look at the php manual. It should work if you evaluate your form in another page and depending on the stuff entered into the form you set something for the redirect tag in HTML ( in the head part enter
<meta http-equiv="refresh" content="5"; URL="URI"> 5 being the time to display the page and URI being the adress to the page to referr to)
So, if someone enters a wrong name, you can redirect him/her to the page badname.html (with the help of php function
<?php
if ($name != 'rightname') {
$referpage='badname.html'}
?>

and on the redirect page there is
<?php
<meta http-equiv="refresh" content="5"; URL="$referpage">
?>

All that I wrote is very shaky... don't rely on that, its been too long that I used PHP... OH, and if you think, my spelling is funny... blame it on me being German :tazz:
  • 0

#3
MaleqAlhaq

MaleqAlhaq

    Member

  • Member
  • PipPip
  • 18 posts
You might want to have a look at this... it might help you:
http://www.w3schools...p_functions.asp
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP