rswildy Posted September 27, 2006 Share Posted September 27, 2006 For my arcade i need a html code that will add whatever typed in the box to the end of my url example,In the box i type Rswildy, The url comes out as www.whatever.com/whatever/whatever&reduel=Rswildy(The thing i entered) Can anyone help? Link to comment Share on other sites More sharing options...
reportingsjr Posted September 28, 2006 Share Posted September 28, 2006 Im guessing your name has to do with Runescape? I used to play that game.. Way back when though. Your answer: You will need a server side language, PHP is the most popular but ASP is also an option. I know php. Anways this would be your code:<form action="page.php" method="get"><input type="text" name="reduel" /><br /><input type="submit" value="Do it"/></form>Thats for the form, when the user hit the Do it button whatever the put in reduel would be in the url like this:http://site.com/page.php?reduel=RswildyTo pull the info from the url you will need a server side language. Simple enough:page.php -- <?phpecho $_GET['reduel'];?> That will put whatever you typed in on the screen . Link to comment Share on other sites More sharing options...
Cronthenoob Posted September 28, 2006 Share Posted September 28, 2006 I think you'll need some PHP to do that. Possibly javascript. Here is a PHP solution: <form name="form" method="get" action="www.whatever.com/whatever/whatever.php?reduel=<?=$_GET['name']?>"><input type="name"><input type="submit" value="submit"></form> Link to comment Share on other sites More sharing options...
rswildy Posted September 28, 2006 Author Share Posted September 28, 2006 Thanx guys, yes reporting runescape is a great game Link to comment Share on other sites More sharing options...
reportingsjr Posted September 28, 2006 Share Posted September 28, 2006 Meh.. I got bored after the 4th year of playing =\. Ive been playing.. since about 2 weeks after it first came out. I had no knees lol. It just gets boring after a while. Some people quicker, some people less. Actually when I quit rs I went to a game called RS Battle (You can guess whats it based off lol) and after a while on there I got curious as to how exactly you make games like this. The creator said "PHP", since then which was less than a year ago I have gotten a pretty good grip on: HTML XHTML (Basically same things) CSS Javascript (not JAVA, I am learning Java though ) AJAX (Branch off javascript) PHP SQL And I have a ways to go! Im only 14 to (Just turned it on the 14th which is less than 2 weeks ago). Right now im learning Java so I hope to have it down pretty well by the end of this year. Wish me luck ! Link to comment Share on other sites More sharing options...
rswildy Posted September 28, 2006 Author Share Posted September 28, 2006 I don't understand PHP, so if i tell you the url i actully need making for the &u= can someone do it for me?||http://folk.ntnu.no/khanghyv/Arcade/index.php?b=rswild&u=(enterd user)Ill be back in few hours. Link to comment Share on other sites More sharing options...
Chocolate570 Posted September 28, 2006 Share Posted September 28, 2006 Here's a way to do it with javascript.Put this script between the <head> and </head> tags in your HTML document. And make sure that the form element that has the text in it has an id of "searchGet" <script type="text/javascript">function goTo(val) { window.location="http://folk.ntnu.no/khanghyv/Arcade/index.php?b=rswild&u="+val;}</script> Your form should look like this:<!-- The text input --><input type="text" id="textval" /><!-- The button --><input type="button" value="Go" onclick="goTo(document.getElementById('textval').value)" /> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now