The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    School Website

    Discussion in 'Windows OS and Software' started by hehe299792458, Feb 1, 2007.

  1. hehe299792458

    hehe299792458 Notebook Deity

    Reputations:
    175
    Messages:
    1,571
    Likes Received:
    0
    Trophy Points:
    55
    My teacher wants me to create a website for the school. However, I'm horrible at making websites, especially form (which he wants me to do). Does anyone know form where the user fills out gets sent to a predefined e-mail?
    Thanks a lot,
    Edward
     
  2. usapatriot

    usapatriot Notebook Nobel Laureate

    Reputations:
    3,266
    Messages:
    7,360
    Likes Received:
    14
    Trophy Points:
    206
    Why would he ask you if you don't know how to do it?

    I would say to tell him you cannot because you do not know how.

    Or hire a company to do it for you.
     
  3. Gautam

    Gautam election 2008 NBR Reviewer

    Reputations:
    1,856
    Messages:
    3,564
    Likes Received:
    0
    Trophy Points:
    105
    You are going to need to learn about form processing. If you know HTML and CSS, that won't cut it for forms. Do you know any PHP or Perl, or CGI for that matter? I use Perl scripts for my forms.
     
  4. hehe299792458

    hehe299792458 Notebook Deity

    Reputations:
    175
    Messages:
    1,571
    Likes Received:
    0
    Trophy Points:
    55
    Yes, I know HTML won't cut it and that's why it's causing me so much trouble... To be exact, he want "a form where the user fills out a comment box and send it to a pre-destined e-mail".

    I got myself into this because 1) there's bonus marks involved and 2) i want a challenge and thought a simple google search would do the trick. So far, I've found guides for frontpage, but nothing for dreamweaver (the only thing I have right now).
     
  5. hondamxer82

    hondamxer82 Notebook Enthusiast

    Reputations:
    0
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    5
    Here is a very basic php script to process a form.

    First you need to create the form to process.
    HTML:
    <html>
    <body>
    <form name="frmContact" method="post" action="path/to/mail.php">
    	<label for="name">Name: </label>
    	<input type="text" name="name" />[br][/br][br][/br]
    	<label for="email">Email: </label>
    	<input type="text" name="email" />[br][/br][br][/br]
    	<label for="comments">Comments: </label>
    	<textarea name="comments" rows="10" cols="40"></textarea>
    </form> 
    </body>
    </html>
    Then creat a file called mail.php.
    PHP:
    <?
    function 
    checkOK($field)
    {
    if (
    eregi("\r",$field) || eregi("\n",$field)){
    die(
    "Invalid Input!");
    }
    }

    //set the variables
    $name=$_POST['name'];
    checkOK($name);
    $email=$_POST['email'];
    checkOK($email);
    $comments=$_POST['comments'];
    checkOK($comments);
    //email address you want the form to be sent to
    $to="[email protected]";
    //the contents of the email message
    $message="$name just filled in your comment form. Their said:\n$comments\n\nTheir e-mail address is: $email";
    if(
    mail($to,"Website Comments",$message,"From: $email\n")) {
    //Thank them if it went through
    echo "Thanks for your comments.";
    } else {
    //give them an error if it didn't
    echo "There was a problem sending the mail. Please check that you filled in the form correctly.";
    }
    ?>
    Also, you might consider using a CMS as a starting point. I personally would highly recommend ModX CMF as it is user friendly but also very flexible for developers. You can get the newest version (0.9.5) here. Then you can grab the eForm snippet for it here, which makes it easy to create even very complex forms. There is also a great community, if you have any questions or need help.
     
    Last edited by a moderator: May 7, 2015
  6. hehe299792458

    hehe299792458 Notebook Deity

    Reputations:
    175
    Messages:
    1,571
    Likes Received:
    0
    Trophy Points:
    55
    Thanks a lot!
     
  7. benna

    benna Notebook Evangelist

    Reputations:
    1
    Messages:
    341
    Likes Received:
    0
    Trophy Points:
    30
    well, i have made one for my school, very easily with php coding. it has most of the functions. the webiste is www.almajdsc.edu.tf - the school is buying for me a premium server this week and will change to .com