Closed Thread Icon

Topic awaiting preservation: Is the server rejecting this ? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12859" title="Pages that link to Topic awaiting preservation: Is the server rejecting this ? (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Is the server rejecting this ? <span class="small">(Page 1 of 1)</span>\

 
Anne Marie
Nervous Wreck (II) Inmate

From: United Kingdom
Insane since: Aug 2003

posted posted 08-13-2003 20:12

Hi all.
Several days ago I tried to make this form work as a test for an online guestbook after repeated attempts and many changes ..not to mention an extensive search across the web for more knowledge I still come up with zero. either I get a 404 message or a Method not allowed depending on which *sample form you click*.
I wanted to use /cgi_bin/ in the form address but my server doesnt allow it.
Question :
1 : Is the form script correct even if the server rejects it. Least then I know which part of the problem to approach.
2 : If i need to install a database and have server side access to make this work PLEASE would someone tell me what I need to do regarding this in idiot form so I can understand? (this was something a friend mentioned) ...shrugs
All I want is for this simple form to work so when the page reloads the message, name etc typed in are placed on the page in sequence like a Guestbook should be.

To see the errors I'm getting, the link to my test site is http://mysite.freeserve.com/crossstitcher/index.html

<html><head>
<title></title>
</head>
<body>
<form method="POST" name="Guestbook" action="self">
<p align="center">
<b><font face="Arial" size="2"><font size="2">Name</font></b>
<p align="center">
<b><font face="Arial" size="2">
<input type="text" name="name" size="20" value="type name in here">
</font></b>
<b><font face="Arial" size="2">
<p align="center">
<input type="submit" value="Submit" name="B1">
<input type="reset" value="Reset" name="B2"></p>
</form>
<P>
<form method="post" action="/crossstitcher/guestbook.htm">
<p align="center">
<b><font face="Arial" size="2">
Name : </font></b>
<input type="text" size="40" name="name">
<p align="center"><b><font face="Arial" size="2">
<input type="submit" name="B5" value="Submit">
</font></b></p></form>
</body>
</html>

The server I'm with sadly isnt the best one on the planet and info/feedback is in short supply.

Thanks and regards
AM

silence
Maniac (V) Inmate

From: soon to be "the land down under"
Insane since: Jan 2001

posted posted 08-28-2003 08:58

The problem is that you're POSTing information to an html file.

The way a form works is that it passes the information entered to a script which then processes the information. Also, you can use the GET method for the information to show up in the address and process that on the page using javascript. The page will work if you change all the POST entries to GET, but it still won't do anything without any type of scripting.

As an example, here's a simple way to do it using perl/cgi:

If you replaced guestbook.htm with guestbook.cgi (or guestbook.pl depending on your webhost) in the following line:

<form method="post" action="/crossstitcher/guestbook.htm">

and then create a cgi file called guestbook.cgi with the following text:

code:
# format output for HTML
print "Content-type: text/html\n\n";

# replace funky chars in the input stream
$in =~ s/%(..)/pack("c",hex($1))/ge;

# replace + with a space in the input stream
$in =~ s/\+/ /g;

%entry = split (/=/, $in);

print <<END;

<html>
<head><title>something</title></head>
<body>

END

print ("Name entered: ");
print ($entry{'name'});

print <<END;

</body>
</html>

END



The guestbook.cgi file would get the information passed by the guestbook.htm file and display it in a generated html page.

« BackwardsOnwards »

Show Forum Drop Down Menu