473,396 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Send data type into textbox to addressbar

I'm making a form that has a text box and submit button. Whatever is typed into the text box I want it to go to the address bar. For example if someone types 'name' in the text box and they press submit it will take them to the page on my website:

http://www.mywebsite.com/name

Can anyone help?

Thanks.
Aug 13 '12 #1
2 2512
dlite922
1,584 Expert 1GB
We don't write code for people here, but since this is so short that explaining it will probably take longer, here's a simple code to do what you're asking

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. if($_GET['submit']) header("location: http://www.mywebsite.com/".$_GET['page_name'])
  4.  
  5. ?>
  6. <html>
  7.  <body>
  8.   <form action="" method="get">
  9.    <input type="text" name="page_name" value="" />
  10.    <input type="submit" name="submit" value="Go" />
  11.   </form>
  12.  </body>
  13. </html>
  14.  
Any questions?

Dan
Aug 13 '12 #2
ariful alam
185 100+
Why you need a PHP code for this? you can do this using JavaScript. here is the code:
Expand|Select|Wrap|Line Numbers
  1. <script language='javascript' type='text/javascript'>
  2.     function redirect(user)
  3.     {
  4.         var location='http://localhost/';
  5.  
  6.         window.location = location+user;
  7.     }
  8. </script>
  9.  
  10. <input type='text' size='30' id='txtbox'/>
  11. <input type='button' value='click' onclick='javascript:redirect(document.getElementById("txtbox").value)'/>
Aug 14 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Fatih BOY | last post by:
Hi, I want to send a report from a windows application to a web page like 'report.asp' Currently i can send it via post method with a context like local=En&Username=fatih&UserId=45&Firm=none...
0
by: Syed Aun Ali | last post by:
i am running an asp.net application on a IIs server with some clients connected through local network and Tcp/ip.i want to send data from a textbox control on a aspx page of a client machine to a...
3
by: Tom | last post by:
In a JET db using ACCESS, I specify a field Data Type as Date/Time and the Format as Short Date. These dates appear as 1/3/2003, 3/31/2003 ..... in Access which is fine since I don't want the time....
0
by: Sam | last post by:
I am trying to use a Simple form with 3 fields from SQL NorthWind Database (Order Details Table with 3 Fields. - OrderId, ProductId and Unit Price). The Field Unit Price has a data type of 'Money...
0
by: Sam | last post by:
Folks.. I am trying to use a Simple form with 3 fields from SQL NorthWind Database (Order Details Table with 3 Fields. - OrderId, ProductId and Unit Price). The Field Unit Price has a data...
5
by: trig | last post by:
Please help! I am an ICT teacher at a secondary school and my year 12 (AS Level) group need to create a website where data can be sent from a form to a Microsoft Access database. I am trying...
4
by: Ty | last post by:
I have a SQL server 2000 DB that Ihave copied onto my PC and am using SQL server express 2005 to view. I created a project in VB.net and am reading the data out of the DB using...
5
sid0404
by: sid0404 | last post by:
Hi I am new to the visualstudio.net I am trying to develop an application which requires me to send data to a HTML webpage - http://patft.uspto.gov/netahtml/PTO/search-bool.html and the user...
0
by: icyfenix | last post by:
I'm a developer for my company and my job is to make things move faster and reduce overhead/labor dollars using software. We are in an all-Microsoft environment. The problem I am having is this:...
2
by: mohanaabi | last post by:
In c # vs.net 2005 (windows application) is it possible to send data from one application to another application. Can the content in textbox of one application can b sent to textbox of another...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.