Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * Script for BMX_ATVMAN14 to allow users to text his phone, without them knowing his number, and without spaming his text's
- *
- * You can find a full chart of all the emails to use for sending a text via email at FIX THIS URL. say if my phone number was 555-666-7239, and it was on AT&T
- * I would set the $to to 5556667239@txt.att.net
- *
- * i have fully tested this script, and it seems to work exactly how it should work, feel free to edit this code however you like.
- *
- * Hope this helps, please give some credit to me if you decide to use my script!
- *
- *By Jacob Nordquist
- *
- */
- //config
- $to = "your_email@gmail.com"; //email it will be sent to
- $from = "someonelse@myminecraftserver.com"; //email it will come from
- //starting session
- session_start();
- //vars needed to run the script properly
- $timestamp = date_timestamp_get(date_create());
- //gather POST request 'exe' to see if it is going to execute the message, or display the form
- $exe = $_POST['exe'];
- if ($exe == 'true'){
- //gathering post requests to exe into a text message
- $message = $_POST['message'];
- $type = $_POST['type'];
- //check and see if they have sent a message in the past 15 min
- //if they did, it blocks them from sending another one
- if($_SESSION['msgtime'] > $timestamp){
- echo 'You must wait 15 min before sending another message!'; //block message
- }
- //if they haven't sent a message in the past 15 min, it sends the message
- else{
- //sending email
- $subject = $type;
- $message = $message;
- $headers = "From:" . $from;
- mail($to,$subject,$message,$headers);
- echo "Thanks for your input!"; //sent successfully message
- //setting a session with there timestamp
- $_SESSION['msgtime']=$timestamp + '900';
- }
- }
- // if there was nothing in the POST request, it displays the form
- else{
- ?>
- <form action='' method='post'>
- <input type="hidden" name="exe" value="true">
- <br />
- Help: <input type="radio" name="type" value="help">
- <br />
- Bug: <input type="radio" name="type" value="bug">
- <br />
- <textarea name='message' cols='20' rows='4'>Enter text here...</textarea>
- <br />
- <input type="submit">
- </form>
- <?php
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement