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?
 
ozoConnect With a Mentor Commented:
#!/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
 
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
All Courses

From novice to tech pro — start learning today.