Hyperlink Variable From One Line Text Box

  • Thread starter Thread starter iPRO Mike
  • Start date Start date
I

iPRO Mike

I have done a search and haven't been able to find the answer... perhaps due
to inexperience with group search tools.

For my index.html (home page) I require a one line text box/submit to
function as follows:
I require the submit button to be a gif image. I need a client to have the
ability to type a word or words into a one line text box and press the
submit button(myimage.gif). The word(s) typed into the box is the VARIABLE
that needs to be inserted into the url string. The url variable is the only
thing that changes.

Example: if the word CAR is typed into the box and the myimage.gif (button)
is clicked a new page loads in the same window with the following url:
www.myweb.com/search.php?search_desc=1&keywords=CAR&x=0&y=0

Example: if the word RED CAR is typed into the box and the myimage.gif
(button) is clicked a new page loads in the same window with the following
url:
www.myweb.com/search.php?search_desc=1&keywords=RED+CAR&x=0&y=0

Example: if the word BIG RED CAR is typed into the box and the myimage.gif
(button) is clicked a new page loads in the same window with the following
url:
www.myweb.com/search.php?search_desc=1&keywords=BIG+RED+CAR&x=0&y=0


In this case I am not able to use .asp , .php, .pl file extensions?
Does anyone have suggestions as to how this can be accomplished.
 
Sorry I forgot to mention this must be placed into the index.html page on a
server not having FrontPage extensions.
 
You are going to have to submit to a hidden page, that then redirect to the created URL:

I don't know the syntax for PHP, but this is how I would do it using ASP, so you will have to
determine how to write this using PHP:

<%
Keywords = Server.HTMLEncode(Request.Form("Keywords"))
URL = "http://www.myweb.com/search.php?search_desc=1&x=0&y=0&keywords="& Keywords

Response.Redirect URL
%>
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
Try

<form action="search.php" method="get">
<input type="hidden" name="search_desc" value="1">
<input type="text" name="keywords" size="20">
<input type="hidden" name="x" value="0">
<input type="hidden" name="y" value="0">
<input type="image" src="images/myimage.gif">
</form>
 
Thomas and Ronx,

I just wanted to thank both of you for your assistance.
It is very much appreciated!

I wasn't able to get the asp to function, probably something I did due to
inexperience.
I did however, get the second suggestion to function well.
 
Back
Top