|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
lets say that i wanted to have a script that says so and so when the address is script.php?name=blah, or say something else when the script name is script.php?name=barf HOWEVER i, of course, want to prevent those 'curious' users from entering something bogus liike script.php?name=somethingtotallybogus...heres how i field all of the requests for existing variables:
PHP Code:
and that of course works fine...i also have some html in the beginning of the document so that if a user does not specify a variable it will default to that. i also have this code in the very beginning: PHP Code:
now what i would also like to do is either redirect users to the default page (with $name NOT specified) OR at least display an error stating that a the $name variable is either not specified, or the value is incorrect and therefor does not exist...heres how im currently doing this: PHP Code:
__________________
-Alexander |
|
#2
|
|||
|
|||
|
You'll have to store a list of valid names in either a database or a flat file and get the list of names each time the page loads, unless you want to enter each name manually. if you're not going to have a lot of names, that's not so bad..
PHP Code:
Of course this gives you no flexibility, and I do suggest using some other method of storing your name list. |
|
#3
|
|||
|
|||
|
alright thanks, but what other options have i got? i like your idea of having a mysql backend so i can do that easily, but how would i implement the scripting? would i , for instance, store in the column "name" of the db the name of the "person" and then in the, say, "content" column, store the html that would be displayed? thanks--
ps., when we have everything perfect and ready for publication and every thing, how would i make it so that if a "curious" user type in like name.php?name=blahblahblah, which doesn't exist, it would automatically display text stating to select a "person," and this would work for ANYTHING bogus? thanks-- Last edited by Vasarab69 : December 2nd, 2002 at 06:23 PM. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > a way to field all non existent variables?!? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|