SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Member
    Join Date
    Oct 2003
    Location
    NYC
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question OK, Making a form post to the page AKA: GUESTBOOK

    How do I do this? I have a simple contact form and I want it to post the comments entered by the viewer into a column on the same page.

    THanks in advance for your advice and help

    Luana
    http://www.godbox.org

  2. #2
    SitePoint Zealot
    Join Date
    Oct 2003
    Location
    USA
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This depends on the language. Is this PHP? Formmail?
    .
    2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
    2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
    2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

  3. #3
    SitePoint Member
    Join Date
    Oct 2003
    Location
    NYC
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    eeek I guess I could have given more information
    here is the html code for the form, and the CGI script, maybe you can tell me how to specifiy the post to: web page??
    I want JUST THE COMMENTS and name field to post to a specified web page...comments.html

    THIS IS MY FIRST EXPERIENCE WITH CGI.
    Got the CGI script plugged in and it appears to be working as when I press post on the form it says THANKS for posting!! and offers to take me back....

    ONLY it DOES NOT POST TO A WEB PAGE...

    Where do I specify where the comments from the form get posted?
    Can I ALSO have the info sent to us via email??


    THANKS.

    html form=
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    <html>
    <head>
    <title>Blame Show Comments</title>
    <div align="center"><strong>Your Voice is Needed! Speak Out Here</strong> </div>
    <FORM method="post" Action="http://www.godbox.org/cgi-bin/gb.cgi">
    <div align="left">
    <B>Your Name</B><INPUT NAME="name" Size=50 Type="text">
    <BR>
    <B>E-Mail Address</B><INPUT NAME="email" Size=50 Type="text">
    <BR>
    Would you like to join our mailing list?
    <INPUT TYPE="radio" NAME="add me" VALUE="yes">
    <B>Yes</B>
    <INPUT TYPE="radio" NAME="add me" VALUE="no">
    <B>No</B><br>
    Would you like to participate in our next film?
    <INPUT TYPE="radio" NAME="shoot me" VALUE="yes">
    <B>Yes</B>
    <INPUT TYPE="radio" NAME="shoot me" VALUE="no">
    <B>No</B> <br>
    <br>
    <!-- This is the spot to specify your email address. -->
    <INPUT TYPE="hidden" NAME="submitaddress" VALUE="godbox@godbox.org">
    <B>Your Comments/B> <br>
    <TEXTAREA NAME="feedback" ROWS=10 COLS=50></TEXTAREA>
    </div>
    <P align="center">
    <INPUT TYPE=submit Value="SEND">
    <INPUT TYPE=reset Value="CLEAR">
    </FORM>


    !!!!!~~~~~~~~~~~~~~~~~~~~~~~~.CGI file
    @pairs = split(/&/, $buffer);

    # Load the FORM variables

    foreach $pair (@pairs) {
    ($name, $value) = split(/=/, $pair);
    $value =~ tr/+/ /;
    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

    $FORM{$name} = $value;
    }


    open (MESSAGE,"| /usr/lib/sendmail -t");

    # Format email header information

    print MESSAGE "To: $FORM{submitaddress}\n";
    if ($FORM{email} ne "") {
    print MESSAGE "Reply-To: $FORM{email}\n";
    }

    # Write the actual email message

    print MESSAGE "Subject: Feedback from $FORM{name} at $ENV{'REMOTE_HOST'}\n\n";
    if ($FORM{email} ne "") {
    print MESSAGE "Email: $FORM{email}\n"; }
    if ($FORM{reply} eq "yes") {
    print MESSAGE "Please reply.\n\n"; }
    print MESSAGE "What sayeth thou?\n\n";
    print MESSAGE "$FORM{feedback}\n";
    close (MESSAGE);
    # Thank the user and acknowledge
    # the feedback
    &thank_you;
    }

    "_error;

    sub sub_error {
    # Format an error message for the user

    print "Content-type: text/html\n\n";
    print "<HTML>\n";
    print "<HEAD>\n";
    print "<TITLE>Request Form Error</TITLE>\n";
    print "</HEAD>\n";
    print "<BODY>\n";
    print "<H1>Request Form Error</H1>\n";
    print "<HR>\n";
    print "<P>\n";
    print "Form input was not proccessed. Please mail your ";
    print "remarks to $FORM{submitaddress}\n";
    print "</BODY>\n";
    print "</HTML>\n";
    }
    sub evil_characters {

    print "Content-type: text/html\n\n";
    print "<HTML>\n";
    print "<HEAD>\n";
    print "<TITLE>Illegal Email Address</TITLE>\n";
    print "</HEAD>\n";
    print "<BODY>\n";
    print "<H1>Illegal Email Address</H1>\n";
    print "<HR>\n";
    print "<P>\n";
    print "The Email address you entered contains illegal";
    print "characters. Please back up and correct, then resubmit.\n";
    print "</BODY>\n";
    print "</HTML>\n";
    }
    sub thank_you {

    print "Content-type: text/html\n\n";
    print "<HTML>\n";
    print "<HEAD>\n";
    print "<TITLE>Thank You!</TITLE>\n";
    print "</HEAD>\n";
    print "<BODY BGCOLOR=#FFFFFF TEXT=#000000>\n";
    print "<H1>Thank You!</H1>\n";
    print "\n";
    print "<P>\n";
    print "<H3>Your feedback is greatly appreciated.<BR>\n";
    print "Click here to <A HREF=$ENV{'REFERRER'}>Back</A>.\n";
    print "<P>\n";
    print "</BODY>\n";
    print "</HTML>\n";
    exit(0);
    }

    <!---WHEW! THANKS FOR ANY INPUT>
    Last edited by GodboX; Nov 7, 2003 at 19:28.

  4. #4
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    If you want to post that form to a webpage, that page should be ASP or PHP or CGI, etc.
    just change the post attribute to the location of the webpage like
    If you are making a guest book or want one, you can get a free one at www.hotscripts.com in any language you want like ASP, ASP.net, PHP, CGI-Perl, ColdFusion, etc.
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!

  5. #5
    SitePoint Member
    Join Date
    Oct 2003
    Location
    NYC
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks....

    Quote Originally Posted by asp_funda
    If you want to post that form to a webpage, that page should be ASP or PHP or CGI, etc.
    just change the post attribute to the location of the webpage like


    If you are making a guest book or want one, you can get a free one at www.hotscripts.com in any language you want like ASP, ASP.net, PHP, CGI-Perl, ColdFusion, etc.
    OK, so do I need to upload another .cgi file that includes the blank html page that the info gets posted to and then specifiy that page within the original cgi form??

    ERRR>>... talk to me like I'm an infant At this I am.

  6. #6
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by GodboX
    OK, so do I need to upload another .cgi file that includes the blank html page that the info gets posted to and then specifiy that page within the original cgi form??
    A CGI or for that matter any file will not show up the contents of the form that you posted it to unless & until you retrieve them. Means that you have to make two pages. One with a form that posts the data to another page & the second page to which the data is posted. This second page of yours should contain the code that retrieves the data posted to it by the previous page & then process it(enter in database or email it or display it). Since you are working with CGI-Perl, I would recommend that you post this question in the Perl Forum.
    I can show you how its done in ASP or JSP but I'll leave CGI to others. But still, as I said, you'll get quicker answer in the Perl Forum.


    Quote Originally Posted by GodboX
    ERRR>>... talk to me like I'm an infant At this I am.
    No problem in that. No one starts as a pro, everyone's an infant in the beginning.
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!

  7. #7
    SitePoint Addict
    Join Date
    Sep 2003
    Location
    Europe
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yup, since you're doing CGI with Perl now, ask in that forum.

    But I know it can be done within one page with PHP (it will reload itself after the data is posted).

  8. #8
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    So it can be done with all the server-side languages, be it ASP, PHP, JSP, ColdFusion or for that matter CGI-Perl too.
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!

  9. #9
    SitePoint Member
    Join Date
    Oct 2003
    Location
    NYC
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    WAaaaaaaaa

    I appreciate your time in trying to help me, it still feels like I"m a total dork since your answers seem to help me get more confused, lol.

    I guess if you just try to keep speaking the language, eventually it starts to not sound so greek.


  10. #10
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by GodboX
    I appreciate your time in trying to help me,
    Thanks for appreciation but I am just giving back what I got from these forums, help. I got help from here when I needed it & thus it seems fair enough that I help anyone whom I can here.

    Quote Originally Posted by GodboX
    it still feels like I"m a total dork since your answers seem to help me get more confused, lol.

    I guess if you just try to keep speaking the language, eventually it starts to not sound so greek.
    Yeah that can happen here if you are asking questions about something on which you have just started.
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •