FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


script-get 10 FRIH$





rajhank
I want a script for a suggestion page where the visitors can fill the form and when they submit the information, the information is sent to me via email.
henrygl
hi rajhank,

here are th answers to your questions:

for the shoutbox script, i have used ShoutPro in the past, which I found to be an amazing program, even though setup could get a little tricky Wink . it is php based

for the suggestion page all you need is a form. there are many tutorials out there on google, the one i learnt from was on html goodies. dynamic drive also has amazing add ons

www.shoutpro.com
www.google.com
www.htmlgoodies.com
www.dynamicdrive.com
rajhank
but no one knows the answer of my 2nd question regarding suggestions.

hey i got the shoutbox script.
Ironz
check here: http://www.thant.net/frontmailer/

this is exactly what you are looking for.
m0u53m4t
Insert this code into the html file:
Code:
<center><br><form action="dataProcess.php" method=post>
Your name: <input maxlength=25 name=name size=45><br><br>
Your email: <input name=from size=45 maxlength=50><br><br>
Enter your message below:<br><textarea cols=40 name=message rows=8></textarea><br><br>
<input type=submit value="Submit suggestions"><input type=reset value=Reset name="reset">
</form>

Then make a file named dataProcess.php and put this in it:
Code:
<?php                            

$maxSize="500";                            // Maximum size of the letters message
$subject="Suggestions";               // The subject line of the letters that you receive
$to="you@hotmail.com";                     // The email address you want letters sent to
$HTMLmailFormat="1";                       // Do you want to use HTML mail (1 for yes and 0 for no)
$verify_referrer="1";                      // Do you want to do domain checking (1 for yes and 0 for no)
$domain="http://domain.com";               // Enter your domain here if you want to verify it
$domainAlias="http://www.domain.com";      // Enter your domains alias here if you want to verify it
$ipLogging="1";                            // Do you want to do IP logging (1 for yes and 0 for no)
$notify="1";                               // Do you want to be notified when an IP is logged  (1 or 0)
$notifyFrom="Abuse@yoursite.com";          // What do you want the notifications 'From' field to say
$notifySubject="Form abuse notification";  // What do you want the notifications 'Subject' line to say



//////////////////////    NO EDITING BEYOND THIS POINT
////////////////////// unless you know what you are doing!


// Below code may or may not be necessary for you
$name = $_POST['name']; $from = $_POST['from']; $message = $_POST['message'];

// Set IP variable based on registar globals status
$register_globals = (bool) ini_get('register_gobals');
if ($register_globals) { $ip=getenv(REMOTE_ADDR); }
else $ip=$_SERVER['REMOTE_ADDR'];

if ($register_globals) { $ref=getenv(HTTP_REFERER); }
else $ref=$_SERVER['HTTP_REFERER'];


// If webmaster wants to do domain checks
if($verify_referrer=="1")
{
        // If the domain referrer DOESN'T match either the set domain or domainAlias variable
   if(!eregi("$domain", $ref) && !eregi("$domainAlias", $ref))
        {
                $error=1;

                // If webmaster wants to log 3rd party domain attempts
                if($ipLogging=="1"){
          $date=date ("l dS of F Y h:i:s A");
         $ipLog="ipLog.htm";
         $fp=fopen("$ipLog", "a+");
         fputs($fp, "<font face=arial size=3>  >>> Logged IP address: $ip - Date: $date<br>");
         fclose($fp);

         $errorMesB="ERROR: Invalid domain.<br><br><b>NOTICE:</b> Your IP has been logged as: $ip."; $error=1;
      }
      else{ $errorMesA="ERROR: Invalid domain."; $error=1; }

                // If webmaster wants to be notified via email of 3rd party domain attempts
      if($notify=="1"){
                $subject=$notifySubject;

                        // If webmaster wants mail sent in HTML format
              if($HTMLmailFormat=="1"){
            $body=" <font face=arial size=3><br>
                    --------<font color=red>WARNING!</font><font face=arial size=3> Form abuse notification ------
                    <br><br><br><font face=arial size=2>A person has attempted to abuse the contact form.
                    <br><font face=arial size=2>Their IP address was logged as: $ip <br></font><br>";
                        }
                        // If no HTML then send as plain text
                        else{
                                 $body=" \n--------WARNING! Form abuse notification ------\n\n\n
                    A person has attempted to abuse the contact form.\n
                    Their IP address was logged as: $ip \n";
                        }
         $from=$notifyFrom;

                        // Set headers based on content type (plain / HTML)
         if($HTMLmailFormat=="1") $headers="Content-Type: text/html; charset=windows-1252 \n";
                        else $headers="Content-Type: text/plain \n";
         $headers.="From: $from \n";
         $headers.="X-mailer: \"contactMe\" published at www.digi-dl.com \n";

                        // Mail notice to webmaster
         mail($to,$subject,$body,$headers);

                        $errorMesC="An email with this information has been sent to the webmaster."; $error=1;
      }
      }
}

// Trim whitespace from user input and replace potentially harmfull charchters
$name=trim($name); $name = preg_replace("/>/","]",$name); $name = preg_replace("/</","[",$name);

// If user enters NO name
if($name==""){ $errorMes1="ERROR: You didn't write your name. "; $error=1; }

// Trim whitespace from user input
$message=trim($message); if($message==""){ $errorMes2="ERROR: You didn't write a message. "; $error=1; }

// Determine the length of the message
//elseif (strlen($message) >= $maxSize) { $errorMes3="ERROR: Your message is too long. The maximum characters allowed is $maxSize. "; $error=1; }

// If all is well so far there are no errors
else
   $error=0;

// If there IS data in the email field then check it
if ($from!==""){

        // Check email address for certain charcters
   if (!eregi("^.+@.+\\..+$", $from))
   {
      $errorMes4="ERROR: Your email address contains errors. "; $error=1;
   }

        // If email address pass check then trim whitespace
        else
      $from=trim($from);
}
else { $errorMes5="ERROR: You need to enter an email address. "; $error=1; }

// If there has been an error then display the error
if ($error=="1"){
   echo ("<title>SendMail Error</title>
        <body><br>
   <p style=\"font:11pt arial\">SendMail <font color=red> Error</font>
   <br><br>The following errors have occured:<br><br>
   $errorMes1<br>$errorMes2<br>$errorMes3<br>$errorMes4<br>$errorMes5<br>$errorMesA<br>$errorMesB<br>$errorMesC<br>
   <br><a href=\"contactMe.htm\" style=\"color:black\">Click here</a> to try again. </body></html>"); exit(0);
}

// If there has been no error then send mail
else if ($error=="0"){

        // If webmaster wants mail sent in HTML format
        if($HTMLmailFormat=="1") {
      $message = preg_replace("/>/","&gt;",$message); $message = preg_replace("/</","&lt;",$message);

      $body="<font face=arial size=2>$message</font <br><br><br>
                       <font face=\"ms sans serif\" size=2>
                       --------------- SENDER INFORMATION ------------
                         <br>This message was sent to you by $name.<br>
                         $name's email address is: $from<br>
                         $name's IP address is: $ip </font><br>";
        }
       
        // If webmaster wants mail sent in plain text format
        else{
      $body="$message\n\n\n
                       --------------- SENDER INFORMATION ------------
             \nThis message was sent to you by $name.\n
                         $name's email address is: $from\n
                         $name's IP address is: $ip \n";
        }
   $from="\"$name\" <$from>";

        // Set headers based on content type (plain / HTML)
        if($HTMLmailFormat=="1") $headers="Content-Type: text/html; charset=windows-1252\n";
        else $headers="Content-Type: text/plain \n";
   $headers.="From: $from \n";
        $headers.="X-mailer: \"contactMe\" published at www.digi-dl.com \n";

        // Send mail
   if(!mail($to,$subject,$body,$headers)){
      echo "mail error";
   }
        // display mail sent message
   else {
        echo (" <title>SendMail Notice: mail was successfully sent</title><body><br><br><br><br>
      <p style=\"font:11pt arial\" align=center>Your mail has been successfully sent...<i>Thank you</i></p>
      </body></html>"); exit(0);
   }

// exit script
} exit(0);
?>


You have to modify the bit at the top of that file depending on your email address and so on. Hope that helped!
Related topics
Next 11 members who joins comicstrips.be get 10 frih$
10 frih$ for membership
Problem: last letter of my username got cut off up-10 frih$
Sigs for sale 10 FRIH$ each!!
Your video converted into Flash 8 for 10 FRIH$
Need brushes [offer 10 FRIH$]
10 Frih$ to the first person to explain this riddle
selling sigs @ 5 FRIH$ each
Layouts!~ 10 Frih and up
What Font for 10 FRIH$ and another 5 FRIH$
convertin Html codes to javascript or php! 10 frih$ each!
10 frih if someone changes this code for me (easy)
fix this code for 10 frih, would take under a minute
fix this code for 10 frih, would take under a minute
ADVERTISE IN MY SIG >> 10 FRIH$'S
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.