Visualizzazione risultati 1 fino 1 di 1

Discussione: Mandare commenti

  1. #1
    Guest

    Predefinito Mandare commenti

    Allora io ho scaricato da internet un esempio di come mandare un commento al sito ...

    Il codice è questo :

    <!--this template is for if you dont know anything bout html or not that much-->
    <!--very basic layout-->
    <center>

    <!-- Start of FORM -->
    <form method="POST" action="fmail.php" name="t">
    Name:&nbsp;<input type="text" name="name" value="">
    <br>
    Email:&nbsp;<input type="text" name="email" value="">
    <br>
    Subject:&nbsp;<select name="subject">
    <option selected value="Friendly Email">----Friendly E-mail----</option>
    <option value="Business E-mail">----Business E-mail----</option>

    </select>&nbsp;&nbsp;&nbsp;
    <br>
    Comments:
    <br>
    <textarea name="message" rows="6" cols="35"></textarea>

    <br>
    <!--change the recipient below to your email address-->
    <input type="hidden" name="recipient" value="webmaster@elementaluk.net">

    <!--change the redirect to your thank you page-->
    <input type="hidden" name="redirect" value="example2.html">

    <input type="submit" value="Send">&nbsp;&nbsp;<input type="reset" value="Clear">
    <input type="hidden" name="width" value="not supported">
    <input type="hidden" name="height" value="not supported">
    <input type="hidden" name="color" value="not supported">
    <input type="hidden" name="pix" value="not supported">
    </form>
    <!-- End of FORM -->
    <br>
    <br>
    <!-- DO NOT REMOVE THIS COPYRIGHT NOTICE!! -->
    <center><b><i><font size="1" font face="mistral"><A HREF="http://www.elementaluk.net">Powered By Elementaluk - Form mail</a></i></b></center></font>
    <!-- START RES & COLOR - NEEDED! -->
    <script>
    <!--
    function show(){
    if (!document.all&&!document.layers)
    return
    document.t.width.value=screen.width
    document.t.height.value=screen.height
    document.t.color.value=screen.colorDepth
    document.t.pix.value=screen.pixelDepth
    }
    show()
    //-->
    </script>
    <!-- END RES & COLOR - NEEDED! -->

    e questi sarebbero i campi da compilare...

    poi c'e un altro file .php ovvero :


    <?php
    //Eleuk - Formmail - By Vince Mitchell - Fuckin SCOTTISH! Psyco!!
    /*
    ################################################## ##########################
    # Ok so i made a few mistakes in v1.1 and had to re-write the code so #
    # shit happen's right? ok this HAS been tested on 3 different servers #
    # and it works, so it SHOULD work on you's. #
    # so...anyway what the fuck you doin in this file piss off before you #
    # fuck it up :P na its cool...if you edit dont complain to me ok? aight #
    # ok updates are @ http://www.elementaluk.net/yourwebtools/script.shtml #
    # and problems goto webmaster@elementaluk.net #
    # ok enjoy the script and if your ever @ elementaluk.net support us and #
    # CLICK THE FUCKIN BANNERS!!! #
    # #
    # if you find my swearing offensive please send a email to - #
    # #
    # like_i_give_a_shit@elementaluk.net #
    # #
    # and i'd be happy to give a load of abuse...anybody try's to send a email #
    # to that address please tell me so i can take the piss oot you, hahaha #
    # aight chill, PEACE, ENJOY!!! #
    # #
    # P.S - Released under the GNU Licence which was included with this script #
    ################################################## ##########################
    */

    //honest ta fuckin god there is fuck all to edit here!!!

    // DONT EDIT UNLESS YOU KNOW WHAT ANY O THIS SHIT MEANS

    // Oi i mean it LEAVE IT ALONE!!!


    //this is kinda plain english
    //basicly it check's the recipient address...if you where wondering what it does
    $recipient_in = split(',',$recipient);
    for ($i=0;$i<count($recipient_in);$i++) {
    $recipient_to_test = trim($recipient_in[$i]);
    if (!eregi("^[_\\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\\.)+[a-z]{2,3}$", $recipient_to_test)) {
    print_error("<b>I NEED A VALID RECIPIENT EMAIL ADDRESS ($recipient_to_test) TO CONTINUE</b>");
    }
    }
    //change require to required
    if ($required)
    $require = $required;

    if ($require) {
    //this is kinda plain english
    $require = ereg_replace( " +", "", $require);
    $required = split(",",$require);
    for ($i=0;$i<count($required);$i++) {
    $string = trim($required[$i]);
    if((!(${$string})) || (!(${$string}))) {
    if ($missing_fields_redirect) {
    header ("Location: $missing_fields_redirect");
    exit;
    }
    $require;
    $missing_field_list .= "<b>You Did Not Enter: $required[$i]</b><br>\n";
    }

    /* for php programmers only
    if variables are'nt gettin sent you can just
    uncomment this line and include this code which will get all variables sent
    in the form and put them all in the message variable */

    //$message = parse_form($HTTP_POST_VARS);

    /* if underscore's dont appear, put them in, its just may editor is SHIT */

    /*
    i dont use this because i need some variables and its not very reliable this was used in v1.0 & v1.1 */

    }
    }

    //if no subject use $othersub
    if (!$subject)
    $subject = "$othersub";
    //if no $othersub & no $subject use form submission as subject
    else if ((!$othersub) && (!$subject))
    $subject = "Form Submission";

    //Send E-mail
    //other = if you added a extra field to the form call them other - other4
    // dont worry bout the $other variables if you dont have them in the form nothing will show in the email

    mail("$recipient","$subject","

    $name used your contact page...he/she wrote...

    $message

    $other
    $other2
    $other3
    $other4

    $name was so kind to give you all his/her browser info -

    Browser Info: $HTTP_USER_AGENT
    IP Address: $REMOTE_ADDR
    Resolution: $width x $height
    Screen Colour: $color
    Pixel Depth: $pix


    From:
    $name
    $email

    -----------------------------------------------------------------------------------------------
    Mailed to you by the simple But Powerful Formmail!
    Eleuk - Formmail - http://www.elementaluk.net/yourwebtools/index.shtml
    ----------------------------------------------------------- ----------------------------------

    ","From: $name <$email>");
    // END send e-mail

    // if redirect tag is send to script, redirect to specifyed page
    if ($redirect) {
    header ("Location: $redirect");
    exit;
    } else {
    print "<h1 align=\"center\"><i>Thank you</i></h1>\n";
    echo "<br><br>\n";
    echo "<center>We Will Contact You ASAP...<a href=\"index.html\">Home</a></center>\n\n";
    echo "<br><br><center>Brought to you by the good people @ <a href=\"http://www.elementaluk.net/yourwebtools/index.shtml\">Yourwebtools</a></center>";
    exit;
    }
    ?>

    Ora come faccio a fare in modo che il commento che mando vada nel mio sito?
    Ultima modifica di marketweb : 21-12-2008 alle ore 12.07.31

Regole di scrittura

  • Non puoi creare nuove discussioni
  • Non puoi rispondere ai messaggi
  • Non puoi inserire allegati.
  • Non puoi modificare i tuoi messaggi
  •