Controling Data Input -
Im making (mainly made) a search engine and for a bit more security I want people to only be allowed to search for letters, or numbers (and allow spaces)
How might I co around doing that? I forgot the correct format
somthing like
if ($query eq [a-zA-z] or [0-9))
{
}
else
{
print "Content-type: text/html\n\n";
print "error";
}
would that not allow spaces? because It is a keyword search engine so I need spaces to be allowed also so they can search for more htan 1 keyword.
Dass posted this at 19:10 — 11th May 1999.
They have: 109 posts
Joined: Apr 1999
I think I found out how to include spaces.
So the script would contain somthing like
if ($query eq [a-zA-z] or [0-9) or \s)
{
#nothing happens, the script just keeps going
}
else
{
print "Content-type: text/html\n\n";
print "error";
}
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.