Add a link

Hi,

Can anyone create an "add a link script" that generates two simple pages
at ones? The user fills in an URL in a text field and a description in a textarea  field (see below).
ONLY the URL (as a link) will then go to one page: page A. The same URL +  the description should go to page B.

Thanks

-------------

<HTML>
<HEAD><TITLE>FORM</TITLE>
</HEAD>

<BODY>

<TABLE WIDTH=600>

<TR><TD VALIGN=top><B>URL:</B><P></TD>
<TD VALIGN=top><FORM><INPUT TYPE="text" NAME="url" SIZE="35" VALUE="http://">
</TD></TR>

<TR><TD VALIGN=top><b>Description:</b></TD>
<TD><TEXAREA name="description" COLS="40" ROWS="5" WRAP="virtual">

</FORM></TEXAREA>

</TD></TR></TABLE>
</BODY></HTML>

---------
<HTML>
<HEAD><TITLE>Page A</TITLE>
</HEAD>

<BODY>
<CENTER>
<TABLE WIDTH=500>
<TR><TD><BR>
<A HREF="LINK_1.HTML">LINK 1</A><p>
<A HREF="LINK_2.HTML">LINK 2</A><p>
<A HREF="LINK_3.HTML">LINK 3</A></TD>

</CENTER>
</TR></TABLE></BODY></HTML>

----------

<HTML>
<HEAD><TITLE>Page B</TITLE>
</HEAD>

<BODY>
<CENTER>
<TABLE WIDTH=500>
<TR><TD>
<A HREF="LINK_1.HTML">LINK 1</A>: Description link one</TD>

<A HREF="LINK_2.HTML">LINK 2</A>: Description link two</TD>

<A HREF="LINK_3.HTML">LINK 3</A>: Description link three</TD>

</CENTER>
</TR></TABLE></BODY></HTML>
mail2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ozoCommented:
#!/usr/bin/perl
use CGI qw(:standard);
print header;
print start_html('FORM'),<<'END_HERE';
<TABLE WIDTH=600>

<TR><TD VALIGN=top><B>URL:</B><P></TD>
<TD VALIGN=top><FORM><INPUT TYPE="text" NAME="url"
SIZE="35" VALUE="http://">
</TD></TR>

<TR><TD VALIGN=top><b>Description:</b></TD>
<TD><TEXAREA name="description" COLS="40" ROWS="5"
WRAP="virtual">

</FORM></TEXAREA>
</TD></TR></TABLE>
END_HERE
print end_html;
if( $url=param('url') ){
  local $^I='.bak'; local $/="</TD>"; @ARGV=('pageA.html');
  while( <> ){
    if( chomp ){
      print;
      ($link)=/.*\b(\d+)/s;
      $link++;
      print qq(<p>\n<A HREF="$url">LINK $link</A>$/);
    }else{
      print;
    }
  }
  $/="\n</CENTER>"; @ARGV=('pageB.html');
  $description=param('description');
  while( <> ){
    if( chomp ){
      print;
      print qq(<TR><A HREF="$url">$description</A></TD>\n$/);
    }else{
      print;
    }
  }
}
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mail2Author Commented:
Thanks a lot ozo! Please lock the question.
0
mail2Author Commented:
Just noticed the new option to accept the comment as an answer. Thanks again.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.