Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
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