Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending Page title to a form ( ID-10-T Question )

Status
Not open for further replies.

MarkRobinson

Programmer
Feb 18, 2000
112
US
I want to create a "Buy Now" button that sends the user, along with the page title in a variable, to a fill in form that has the page title field filled in.

Can you point me in the right direction?
 
Code:
<a href="your_script.pl?title=$title&name=$name">Buy Now</a>





------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Didn't work

This created the command line with:
your_script.pl?title=$title&name=$name

when I believe we want
your_script.pl?title=This is the title of the page

am I missing something?
 
you're script probably has the href link code in a single-quoted string that is killing the variable interpolation. Change it to a double-quoted string.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
I don't understand where you're suggesting my error is.
Again, what I am trying to do is to take the text from inside the <title></title> tag and pass it. I can't hardcode the title inside the html tag.

The Code in the first form is:
--------------------------------------------------
<html>
<head>
<title>Japanese women</title>
</head>
<body>
<p><img src="Japanese women bowing.jpg" width="150" height="231" /></p>
<a href=" Now</a>
----------------------------------------------------------
When I click on the button:
----
----
appears in the address bar, sending the words "$title" and "$name" as parameters into the perl script.



</body>
</html>
 
I thought your form was being dynamically created, if it's a static html page you have to add the parameter values yourself

Code:
<html>
<head>
<title>Japanese women</title>
</head>
<body>
<p><img src="Japanese women bowing.jpg" width="150" height="231" /></p>
<a href="[URL unfurl="true"]http://www.handicappedpets.com/cgi-bin/myscript5.pl?title=Japanese[/URL] women&name=?">Buy Now</a>

where, ? is whatever value name= should be.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top