GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Opt-in mailing script (https://gfy.com/showthread.php?t=416237)

collegegirlvids 01-13-2005 04:08 PM

Opt-in mailing script
 
Would someone be as so kind as to point me toward an opt-in mailing script to add to my tours... the basic opt-in box for pic of the day... blah, blah...

If you can hook me up, I'll definitely do the same back =)

calmlikeabomb 01-13-2005 05:26 PM

If you use sql and php....

Code:

<!-- Begin newsletter form  -->
<form name="newsletter" action="newsletter.php" method=hahahahahaha>
<input type="text" name="email" class="newsletter" style="width:140px" maxlength="70" />
<input type="image" class="newsletter" src="images/subscribe.gif" alt="Subscribe" name="submit" />
<!-- End newsletter form -->

<?php
// Register the user in the database.
        require_once ('mysql_connect.php'); // Connect to the db.
               
        // Create a function for escaping the data.
        function escape_data ($data) {
                global $dbc; // Need the connection.
                if (ini_get('magic_quotes_gpc')) {
                        $data = stripslashes($data);
                }
                return mysql_real_escape_string($data, $dbc);
        } // End of function.

        $message = NULL; // Create an empty new variable.
       
        // Check for a email address.
        if (empty($_POST['email'])) {
                $e = FALSE;
                $message .= '<p>You forgot to enter your email!</p>';
        } else {
                $e = escape_data($_POST['email']);
        }
       
       
        if ($e) { // If everything's OK.

                        $query = "INSERT INTO newsletter set email='$e'";               
                        $result = @mysql_query ($query); // Run the query.
                        if ($result) { // If it ran OK.
                       
// Send an email
                                $body = "Thank you for subscribing to our Penis Enlargement Product newsletter!\n\n
                                                Our newsletter will be in your inbox waiting for you every Monday morning.
                                                Sincerly,\n
                                                Levi Lewis\n
                                                www.penis-enlargement-product.us";
                                mail (($_POST['email']), 'Thank you for registering!', $body,'From: [email protected]');
                                echo '<p>You have been registered!<br> Details of this registration have been sent to your email address.</p>';
                                                               
                        } else { // If it did not run OK.
                                $message = '<p>You could not be registered due to a system error. We apologize for any inconvenience.</p><p>' . mysql_error() . '</p>';
                        }               
                }
                mysql_close(); // Close the database connection.


// Print the error message if there is one.
if (isset($message)) {
        echo '<font color="red">', $message, '</font>';
}
?>

</form>



All times are GMT -7. The time now is 05:53 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123