am getting syntax error, can someone please explain how to insert a hyperlink into a table.
14 2647
am getting syntax error, can someone please explain how to insert a hyperlink into a table.
Is this an HTML question?
- M
Sorry about the poor topic but it is a perl question
part of my code consists of
<td><<A HREF="http://www.whatever.com">http://www.whatever.com</A></td>
And the error i get is "syntax error at line 99, near "<td><<A HREF="http""
lets see your real perl code. What you posted is an out of context line of text that is impossible to debug in relationship to your perl code.
Haven't posted the whole code because most of it is HTML
but the code concerning the error is below
print "<table border='1'>";
print "<tr><td>Type</td><td>Size</td><td>Price</td></tr>";
foreach $line (@all) {
chop($line);
($size,$price,$type=split(/\|/,$line);
print "
<tr>
<td>$type</td>
<td>$size</td>
<td>$price</td>
<td><A HREF="http://www.whatever.com">http://www.whatever.com</A></td>
</tr>";
}
print"</table>";
If needed i could post the entire code
Also could you help me change some of the table attributes such as font, font colours, bgcolor, row width, column width
Thank you
you can't use unescaped double-quotes in a print command that uses double-quotes as the string terminator, add a backslash to escape embedded double-quotes: - print "
-
<tr>
-
<td>$type</td>
-
<td>$size</td>
-
<td>$price</td>
-
<td><A HREF=\"http://www.whatever.com\">http://www.whatever.com</A></td>
-
</tr>";
-
}
perl has quote operators that make life easier: perldoc Quote and Quote like Operators
To fix your problem, either escape the double quotes inside the string, or use a different encloser. My personal preference is to use qq{my string here}. http://perldoc.perl.org/functions/qq.html -
print qq{<table border='1'>};
-
print qq{<tr><td>Type</td><td>Size</td><td>Price</td></tr>};
-
foreach $line (@all) {
-
chop($line);
-
($size, $price, $type) = split(/\|/, $line);
-
print qq{
-
<tr>
-
<td>$type</td>
-
<td>$size</td>
-
<td>$price</td>
-
<td><A HREF="http://www.whatever.com">http://www.whatever.com</A></td>
-
</tr>};
-
}
-
print qq{</table>};
-
hehehe.... that long hyper link was rather obnoxious, thanks Miller ;)
Your welcome :)
perldoc really does have the silliest anchors. Why on earth they feel it necessary to have an anchor that is 157 characters in length when the header for the section is only 30, I'll never know.
Thanks for the help
It works nicely
But any ideas on improving how the table looks (fonts, colors etc.)
Thank You
-
print "<table border='1'>";
-
print "<tr><td>Type</td><td>Size</td><td>Price</td></tr>";
-
foreach $line (@all) {
-
chop($line);
-
($size,$price,$type=split(/\|/,$line);
-
print "
-
<tr>
-
<td>$type</td>
-
<td>$size</td>
-
<td>$price</td>
-
<td><A HREF="http://www.whatever.com">http://www.whatever.com</A></td>
-
</tr>";
-
}
-
print"</table>";
-
Another question
The variable $type, how do i transfer that variable to another perl script using the hyperlink?
Most tutorials i have seen comment on forms but not hyperlinks
An suggestions
Thank You
http://www.whatever.com/cgi-bin/yourscript.pl?type=$type
Brilliant
Thanks for the help Kevin, will see if this works
This code works nicely
I have used http://www.whatever.com/cgi-bin/yourscript.pl?$type
But what if i wish to transfer more than one variable using this method, is it possible?
For example tranfer $type, and $size, $code
Thank You
- http://www.whatever.com/cgi-bin/yourscript.pl?type=$type&size=$size
or instead of '&' use ';' which to delimit for URI string: - http://www.whatever.com/cgi-bin/yourscript.pl?type=$type;size=$size
Sign in to post your reply or Sign up for a free account.
Similar topics
by: mike420 |
last post by:
I think everyone who used Python will agree that its syntax is
the best thing going for it. It is very readable and easy
for everyone to learn. But, Python does not a have very good
macro...
|
by: Peter Frost |
last post by:
Please help
I don't know if this is possible but what I would really like to do is
to use On Error Goto to capture the code that is being executed when
an error occurs.
Any help would be much...
|
by: deko |
last post by:
I'm trying to log error messages and sometimes (no telling when or where)
the message contains a string with double quotes. Is there a way get the
query to insert the string with the double...
|
by: compuglobalhypermeganetz0r |
last post by:
I am having trouble getting an adapter to update my access database, it
gives the error Syntax error in INSERT INTO statement. for
Line 98: Adapter.Update(WineDS, "tblWines")
Below is my...
|
by: DC Gringo |
last post by:
I am getting a error upon attempting a postback that causes a redirection of
the browser from http://myserver.com/ to http://myserver.com/0.
My Try Catch block with exception handler doesn't come...
|
by: amitbadgi |
last post by:
HI i am getting the foll error while conv an asp application to
asp.net
Exception Details: System.Runtime.InteropServices.COMException: Syntax
error in UPDATE statement.
Source Error:
Line...
|
by: serge calderara |
last post by:
Dear all,
I have the following item on my form :
<asp:HyperLink id="lblEvtNb" runat="server"
NavigateUrl="Event.aspx?id=">Click here</asp:HyperLink>
I need to pass as url parameter an Id...
|
by: Hansen |
last post by:
Hi!
I have a try/catch statement on my webpage, in which a create som html.
Sometimes this routine fails and the catch writes the error in an alert box.
My problem is that the only
thing the...
|
by: mesut |
last post by:
Hi there,
how are you colleagues? I try to set a linkaddress in code behind for
a <asp:hyperlinkserver control. but I think I have some syntax
problem. I don't know how to fix it.
What's...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |