Reply
guestbook help
Old 07-03-2004, 11:15 PM guestbook help
Average Talker

Posts: 19
hey im trying to make a real simple guestbook jus to learn and im having alot of troulbes getting things to be displayed ect. take a look

main part of guestbook.html
HTML Code:
<TABLE BORDER=0 width=100%> 
<FORM ACTION="http://localhost/cgi-bin/getlog.cgi" METHOD="post"> 

<TR><TD> First Name  <TD> <INPUT TYPE=TEXT NAME="First" SIZE=25> 
<TR><TD> Comments  <TD> 
<TR><TD COLSPAN=2><TEXTAREA NAME="comments" ROWS=6 COLS=80></TEXTAREA> 
<TR><TD><TD> <INPUT TYPE="SUBMIT" VALUE="Send my comments"> 
</FORM> 
</TABLE>
guestbook.cgi
PHP Code:
#!C:\Perl\bin\perl -wT

open(LOGFILE">>guestbook.log"); 

$newline=join('::',@value); 

print 
LOGFILE ("$newline\n"); 
close LOGFILE

print 
"<BODY BGCOLOR=\'BEIGE\'><H1>Thank you.  Your comments have been added</H1>"
and my guestcook.log

First::Comments



sry its so big can u help?
marcusami is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 07-07-2004, 04:43 AM
Average Talker

Posts: 19
come on does ne one got ne idea ???? plz
marcusami is offline
Reply With Quote
View Public Profile
 
Old 07-07-2004, 12:06 PM
Kyrnt's Avatar
The Post-Mod Years

Posts: 2,536
Location: Western Maryland
marcusami,

It might be tough to get a response to a CGI question in the PHP forum. I'll move this thread to Coding - All the Rest to try to get a better response.
__________________
—Kyrnt
Kyrnt is offline
Reply With Quote
View Public Profile Visit Kyrnt's homepage!
 
Old 07-08-2004, 06:30 AM
scottfree's Avatar
Extreme Talker

Posts: 234
Location: Hamburg
Hi there, I hope I can be of a little help.
Firstly under php code, you have a perl source code, I am not sure if this works.
Secondly, the first line in the perl document has an absolut path to the C: and I think this should be "#!/usr/bin/perl -wT" as this won´t be running locally, but on a server.
You also have "<FORM ACTION="http://localhost/cgi-bin/getlog.cgi" METHOD="post">" this address is absolute and you should stay away from absolut url´s as this will only work on your localhost and if you use it anywhere else, you will have to change the code.
try using "<FORM NAME="newGBentry" ACTION="/getlog.cgi" METHOD="post">"
Names are a good thing to use for forms, especially when you have more than on form in a document.

I hope this will help you a little bit, just wanted to add my two cents.
Gook luck.
__________________
I think, therefore I am..... I think.
scottfree is offline
Reply With Quote
View Public Profile Visit scottfree's homepage!
 
Old 07-08-2004, 12:11 PM
SN3
Novice Talker

Posts: 14
Does it display aything at all?
SN3 is offline
Reply With Quote
View Public Profile
 
Old 07-08-2004, 05:32 PM
Average Talker

Posts: 19
It doesnt really show ne of the text that im entering, but it will print out "First Comment" or "Thank you. Your comments have been added"
and i jus noticed i never showed the getlog coding maybe somehtng wrong n there, also thank you for the help, i changed them to .pl's buti have to use full addresses becuz im using a local server on my computer, and it seems to forget that if i dont and writes out the code itself, but thanks alot

this is my getlog.pl

#!C:\Perl\bin\perl -wT

use CGI::Carp qw(warningsToBrowser fatalsToBrowser);

open(LOGFILE, "guestbook.log");
@entries = <LOGFILE>;
close LOGFILE;

print "<BODY bgcolor=beige>\n";
print "<TABLE>\n";

foreach $line (@entries) {
@fields = split(/::/,$line);
print "<TR><TD>$fields[0] $fields[1]<TD>$fields[9]\n";
};

print "</TABLE>\n";
marcusami is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to guestbook help
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.14310 seconds with 12 queries