Results 1 to 9 of 9

Thread: How do make a simple Reply\Feedback Box on a Site?

  1. #1
    100%'s Avatar ╚════╩═╬════╝
    Join Date
    Jan 2003
    Posts
    13,383
    I dont want to use the contact via email method - i would like a small box at the bottom of the Site - where people can write in comments etc



    I found this type here - http://www.linkboxed.com/contact.php

    i would like the written info to be sent elsewhere so i can read it privatly and that it is not displayed on the actual site.
    In the above link where does this info get sent to?
    I am not a web expert (and yes i am working on my other post)
    Thanx

  2. Internet, Programming and Graphics   -   #2
    100%'s Avatar ╚════╩═╬════╝
    Join Date
    Jan 2003
    Posts
    13,383
    ok i found this - looks simple enough - http://phpformgen.sourceforge.net/phpform/

  3. Internet, Programming and Graphics   -   #3
    orcutt989's Avatar Blargh
    Join Date
    Dec 2003
    Location
    States
    Posts
    2,186
    Alright then.

  4. Internet, Programming and Graphics   -   #4
    I've seen you asking a lot of html questions lately, mr. 15%, and I wondered if you knew about the site http://www.w3schools.com ?
    they have tutorials and hands-on examples of everything from html to basic html to server scripting.

    Anyway, what you're talking about is a form...
    but you're going to need a way to store the comments. I can be a text file or a database or XML or whatever. And you'll need some scripting to handle the form data.

    There is a crack in everything.
    That's how the light gets in.

  5. Internet, Programming and Graphics   -   #5
    100%'s Avatar ╚════╩═╬════╝
    Join Date
    Jan 2003
    Posts
    13,383
    -yes i just decided to get into learning this stuff -itll take years-once you learn one thing - you discover a whole new problem and so forth
    Thanks for the link-good stuff-guess you dont want me coming back asking more questions

    anyway found a simple script for the Report reply form thing

    save this into the html page you want it on
    Code:
    <html>
     
     <head>
     
        <title>Feedback Form</title>
     
     </head>
     
     <body>
     
     
     
     <h1> Fill in the form below to send us your comments <h1>
     
     
     
     <form method="post" action="feedback.php">
     
       Name: <input name=”name” type=”text” /><br />
     
       Email: <input name="email" type="text" /><br />
     
       Comments:<br />
     
       <textarea name="comments" rows="15" cols="40">
     
       </textarea><br />
     
       <input type="submit" />
     
     </form>
     
     
     
     </body>
     
     </html>
    and save this as feedback.php in the actual folder

    Code:
    <?php 
     
     
     
     $msg = "Name:t$namen";
     
     $msg .= "Email:t$emailn";
     
     $msg .= "Comments:t$commentsn";
     
     
     
     $recipient = "[email protected]";
     
     $subject = "New Feedback from my site";
     
     
     
     $mailheaders = "From:$emailn";
     
     $mailheaders .= "Reply-To:$emailnn";
     
     
     
     mail($recipient, $subject, $msg, $mailheaders);
     
     header("Location: http://www.yoursite.com/thankyou.html");
     
     ?>

  6. Internet, Programming and Graphics   -   #6
    I didn't intend to imply that your questions are unwanted or an annoyance...quite the opposite. I, and I'm sure others, enjoy exchanging their knowlege on the subject, and teaching others only helps us learn better.
    But it is nice to have a resource to fall back on for many of the simple things when first beginning...then you can save the really perplexing troubles for posting

    anyway...that script is not going to work on most servers now, as it requires REGISTER_GLOBALS to be on in php.ini...and for security purposes it's been set to 'off' by default in php version 4 and above...
    there are two solutions.
    the first is not recommended, but you can enable REGISTER_GLOBALS if you're hosting on an Apache server. Just add the following line to a text file, and save it as .htaccess
    there is no file name, just the extension .htaccess

    Code:
    php_value register_globals 1
    *note: .htaccess files can be used for many, many things..including banning users, setting directories, custom error pages, etc.
    There's plenty of information about .htaccess files

    or, the better solution would be to modify the script.
    this is what you'd want.

    PHP Code:
    <?php
     
    $c_name 
    $_POST['name'];
    $c_email $_POST['email'];
    $c_comments $_POST['comments'
     
    $recipient "[email protected]";
     
    $subject "New Feedback from my site";

    $mailheaders "From:$email";
     
    $mailheaders .= "Reply-To:$email";

    mail($recipient$subject$msg$mailheaders);
     
    header("Location: http://www.yoursite.com/thankyou.html");
     
     
    ?>
    or something of the like.
    as you see, the main change is that $_POST['fieldname'] is used to harvest the data from the form.
    with register_globals on, the data is made into fieldname variables automatically...which is not really a good idea, as someone could simply create a form, point it to your script, and insert who knows what type of data .

    There is a crack in everything.
    That's how the light gets in.

  7. Internet, Programming and Graphics   -   #7
    100%'s Avatar ╚════╩═╬════╝
    Join Date
    Jan 2003
    Posts
    13,383
    Brilliant - id probably walk into the glitch as soon as id implemented it
    one more question though
    in the actual "reply box" on the screen do users "HAVE to" put in their email or else it dont work?
    id prefer to only have only the reply box (and not the name and email part) so users simply put what ever they want in it and if they want to put in email etc?
    id prefer it looking like this
    Code:
    <html>
         
         <head>
         
        	<title>Feedback Form</title>
         
         </head>
         
         <body>
         
         
         <form method="post" action="feedback.php">
         
         
           Comments:<br />
         
           <textarea name="comments" rows="15" cols="40">
         
           </textarea><br />
         
           <input type="submit" />
         
         </form>
    hope this is perplexing enough for you


    Edit:
    I gues then i should change the your php to....?
    Code:
     <?php 
       
      $c_name = $_POST['name']; 
      $c_email = $_POST['email']; 
      $c_comments = $_POST['comments']  
       
      $recipient = "[email protected]"; 
       
      $subject = "New Feedback from my site"; 
       
      $mailheaders = "From:$email"; -DELETE THIS???????
       
      $mailheaders .= "Reply-To:$email"; - AND DELETE THIS????????????
       
      mail($recipient, $subject, $msg, $mailheaders); 
       
      header("Location: http://www.yoursite.com/thankyou.html"); 
       
       ?> 
    Forget it ill work it out - thanx anyway
    Last edited by 100%; 10-17-2004 at 10:11 AM.

  8. Internet, Programming and Graphics   -   #8
    exactly. with a form that contains only your comment field you could remove all teh variables except for your email address, the actual comment, and..anyway, it would look like this.

    PHP Code:
    <?php 

      $c_comments 
    $_POST['comments']  
       
      
    $recipient "[email protected]"
       
      
    $subject "New Feedback from my site";
       
      
    mail($recipient$subject$c_comments); 
       
      
    header("Location: http://www.yoursite.com/thankyou.html"); 
       
       
    ?>
    nice & simple script

    There is a crack in everything.
    That's how the light gets in.

  9. Internet, Programming and Graphics   -   #9
    100%'s Avatar ╚════╩═╬════╝
    Join Date
    Jan 2003
    Posts
    13,383
    ZEN script - very nice - cheers

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
  •