Can CGI create a table in a page

They have: 2 posts

Joined: Jun 2000

I have a web shop based on the Smart-Shop Perl script. But I want to create my HTML pages and just let the script add the table holding the product information (description, price, Buy me). I have tryed with the following code but can not get it to be executed.
<script language=JavaScript type="text/javascript">
<!--
document.write('<br><img width=265 height=29 border=0 src="http://cgi.algonet.se/htbin/cgiwrap/zoft80/smart.cgi?command=review&idnr=d113456"');
// -->
</script>

Is there a better way?
Lennart
mailto:[email protected]

Ken Elliott's picture

They have: 358 posts

Joined: Jun 1999

I think that this post should be in the CGI-PERL forum. But I will attempt to answer it.

I am not sure I understand what you are trying to print because I don't know squat about javascript .

This is the format for printing anything in PERL.

print "<table background=\"someimage.gif\">";

As you can see you just add your info and then be sure to escape every double and single quote within the code you are trying to print.

Use this for everything you need to print. Like this would print out a complete table.

CODE-------------------

print "<table border=0>";
print "<tr><td align=\"center\">";
print "This is the header or something";
print "</td></tr><tr><td align=\"left\">";
print "And this is just some text";
print "</td></tr></table>";

and there is your complete table.

Hope that helps.
VulKen

Pimpin like a pimp with an electrofied pimpin machine!

They have: 2 posts

Joined: Jun 2000

Hi VulKen,
Thank you for your answer. Yes, I am using Perl but that is not my problem at least I think that I can write the Perl code that is needed.
My problem is to find the right document.write() code that will activate the Perl script. The example that I gave you is placing the Html code at the page but it does not run the Perl script.
My test page is located at http://www.algonet.se/~zoft80/kontekano/test1.htm

The final result should look like http://www.algonet.se/~zoft80/kontekano/aj5.htm

Please let me know if you have any ideas about how to modify my test1.htm page so it will activate the Perl script.
Note! The current call to the Perl script will not produce the table as it should look because that function does not exist yet. It will now put out a whole web page with header, a table and a footer. But as soon as I get the Perl code to be activated from the document.write() I will modify the Perl script to put out only the table containing the order information.

Quote: Originally posted by VulKen:
[B]I think that this post should be in the CGI-PERL forum. But I will attempt to answer it.

Lennart Johansson
mailto:[email protected]

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.