The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
|||
|
|||
![]()
Thanks for helping me out by the way--
Yup- just to control how many times they click it in an hour.. Main page is index.html- this page has the link needing to be limited... regular page with a button on it. Code:
<div class="newest-item"> <div class="newest-img"><img src="uploads/items-here/47-plastic-chair-3.png" alt="Plastic Chair" width="120" height="120"/></div> <div class="newest-desc"><p>Plastic Chair</p></div> <a class="add-cart" href="./forms/form1.html" title="Enter for you chance to win!"><span>Enter Email</span></a> </div> clicking it takes you to ./forms/form1.html (this page is a simple email form which submits/post to form1.php: Code:
<?php if(isset($_POST['email'])) { $email_to = "contact@mail.com"; // YOUR EMAIL ADDRESS $email_subject = "[_ENTRY_]"; // THE EMAILS SUBJECT function died($error) { echo "We are very sorry, but there were error(s) found with the form you submitted. "; echo "These errors appear below.<br /><br />"; echo $error."<br /><br />"; echo "Please go back and fix these errors.<br /><br />"; die(); } if(!isset($_POST['email'])) { died('We are sorry, but there appears to be a problem with the form you submitted.'); } $email_from = $_POST['email']; $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; if(!preg_match($email_exp,$email_from)) { $error_message .= 'The Email Address you entered does not appear to be valid.<br />'; } if(strlen($error_message) > 0) { died($error_message); } $email_message = "Form details below.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "Email: ".clean_string($email_from)."\n"; $headers = 'From: ' . $email_from . "\r\n".'Reply-To: ' . $email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); ?> <!-- ############################################################################################# --> <!-- ##################### BEG: Provide your custom HTML or use what's there ##################### --> <!-- ############################################################################################# --> <?php header("Location: http://site.com/"); ?> <!-- ############################################################################################# --> <!-- ##################### END: Provide your custom HTML or use what's there ##################### --> <!-- ############################################################################################# --> <?php } ?> |
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|