Link to home
Start Free TrialLog in
Avatar of shlomoy
shlomoy

asked on

FORM/file-update/new HTML

I need to update links on a web page.
I made a CGI using perl to read a test file (with descriptions and URLs) and "plant" the HTMLed links to an already-existing web-page.

now- I made a form which receives a description and a URL - the goal is to append the new data to the text file (which holds all my links) and then activate the converting  utility (which plants the data in the web-page).

my form on the web page looks like this:
---start---
<form action="http://vortex.technion.ac.il/shlomo/cgi-bin/addlink.cgi"
method=POST>
<B><U>Add a new Link:</U></B><BR>
Description: <input type=text name="description">
URL: <input type=text name="URL">
<input type=submit value="Submit this data">
</form>
----end----

and the CGI listing is:
---start---
#!/usr/bin/perl
# nameage.cgi
require 'cgi-lib.pl'

&ReadParse(*input);
$des=$input{'description'};
$url=$input{'URL'};

   print "Content-Type: text/html\r\n\r\n";
   print "<HTML><HEAD><TITLE>Error</TITLE></HEAD>\n";
   print "<BODY BACKGROUND=\"http://vortex.technion.ac.il/~shlomo/bg_marble_gre$
   print "<body>\n";
   print "URL: <B><I>$url</I></B> linked!\n";
   print "\n";
   print "<BR> <BR>\n";
   print "<CENTER><A HREF=\"http://vortex.technion.ac.il/~shlomo/home.html\">BA$
   print "<BR><BR>\n";
   print "</body> </html>\n";
open( TEXTfile,">> ~/public_html/home")||die "$!\n";
print TEXTfile "$des\n";
print TEXTfile "$url\n";
close(TEXTfile);
exec '~/makeHTMl.pl ~/public_html/home';
----end----

now:
(*)home (which resides at ~/public_html)
   is the test file with the links
(*)addlink.cgi - is the cgi

----------->
for some strange reason I get the "result" HTML on screen after submitting the data- - but I get no change in the 'home' data file and therefore no change in the web-page after executing the links->html perl utility.

What am I missing here?
ASKER CERTIFIED SOLUTION
Avatar of arnond
arnond

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ozo
Try expanding the '~'s, and checking whether die "$!" said anything
Avatar of shlomoy
shlomoy

ASKER

Want points, arnond? BEG!