0
Welcome Guest!
Login
0
items
Join Now
Login
Join Now
Search
Home
Grav
Themes
Joomla!
Templates
Extensions
WordPress
Themes
Plugins
Docs
Forum
Perks
Index
Recent Topics
Rules
Search Forum
Premier Support
You are here:
Forum
General
The Water Cooler
Topic
URL Form
Last Post
Search Topic
Leckenby
Elite Rocketeer
Posts:
714
Thanks:
0
URL Form
Posted 16 years 8 months ago
I need a code which creates a form, and when the user types in, for example 'test', it goes to /test
www.designerwiz.com/JavaScripts/go_to_url_input.htm
this does the right thing, if I have this code at
www.example.com
, and i enter 'test' and click go to, it would go to
www.example.com/test
HOWEVER
I don't want to use it, as if the user instead decides to press enter rather than go to, the url becomes 'www.example.com?href=test', which is no good
Anyone know of a code to do what I want, or able to fix the one I posted above?
#214713
Leckenby
Elite Rocketeer
Posts:
714
Thanks:
0
Re: URL Form
Posted 16 years 8 months ago
Okay, did a bit of research, and got to this stage:
index.php
<form action="url.php" method="post">
<input type="text" name="url" size="25">
</form>
url.php
<?
function clean_up($data) {
$data = strip_tags($data);
$data = trim(htmlentities($data));
return $data;
}
$url = clean_up($_POST);
header("Location:
dev.example.com/projects/$url
");
?>
Now this works great, exactly what I needed, but just wondering, how secure is it? Anybody see any problems?
#214736
J!eremy
Elite Rocketeer
Posts:
2108
Thanks:
8
Re: URL Form
Posted 16 years 8 months ago
Who are you again
haha
But you gotta tell me man, what you would use this for... Inquiring minds gotta know!!!!
Send moderators PMs ONLY if they request it.
James' First Blog Post lol
Top Tips for Support
Be SPECIFIC when posting.
#214804
Leckenby
Elite Rocketeer
Posts:
714
Thanks:
0
Re: URL Form
Posted 16 years 8 months ago
Well, what Im doing is a dev area for clients, and Im giving them a 'token' to enter into a form at dev.example.com which will take them to a project.
So say they enter 'test13', then it would take them to dev.example.com/projects/test13
You see?
#214826
J!eremy
Elite Rocketeer
Posts:
2108
Thanks:
8
Re: URL Form
Posted 16 years 8 months ago
very cool... kinda like a dynamic drop down box... IM impressed... I will totally use that.. lol
Good luck...
Send moderators PMs ONLY if they request it.
James' First Blog Post lol
Top Tips for Support
Be SPECIFIC when posting.
#215019
Leckenby
Elite Rocketeer
Posts:
714
Thanks:
0
Re: URL Form
Posted 16 years 8 months ago
=)
ive sent you a PM of it working, just enter test or something, you will see how cool it is!
Lets just hope its secure...
#215028
J!eremy
Elite Rocketeer
Posts:
2108
Thanks:
8
Re: URL Form
Posted 16 years 8 months ago
That is Excellent....
Send moderators PMs ONLY if they request it.
James' First Blog Post lol
Top Tips for Support
Be SPECIFIC when posting.
#215073
Time to create page: 0.067 seconds
Powered by
Kunena Forum