egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

tcl + php code

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
wann
Voice


Joined: 23 May 2009
Posts: 8

PostPosted: Sat Jul 04, 2009 6:40 pm    Post subject: tcl + php code Reply with quote

any one have idea for this php code??
i wanna use this php code ( song request ) and tcl.
after request at php code, 1 bot join our server and send request song over there..please help me..

this php code

[quote]<?php

// First check to see if the for has been submitted
if (isset($_POST['submitted'])) {

$errors = array(); // Initialize error array.

// Check for a name
if (empty($_POST['name'])) {
$errors[] = 'You forgot to enter your name.';
}

// Check for a valid email address
if (!preg_match("/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)*\.([a-zA-Z]{2,6})$/", $_POST['email'])) {
$errors[] = 'You need to enter a valid email address.';
}

// Check for a message
if (empty($_POST['message'])) {
$errors[] = 'You forgot to enter a message.';
}

if (empty($errors)) { // If everything is OK.

// Let's send an email
// Let's first send some email to the admin
$mailTo = "my@email.com";
$senderName = $_POST['name'];
$senderMail = $_POST['email'];
$break .= "<br/>";
$eol .= "\r\n";
$sol .= "\n";
$headers .= 'To: '.$mailTo.' <'.$mailTo.'>'.$eol;
$headers .= 'From: '.$senderName.' <'.$senderMail.'>'.$eol;
$headers .= 'Date: '.date("r").$eol;
$headers .= 'Sender-IP: '.$_SERVER["REMOTE_ADDR"].$eol;
$headers .= 'X-Mailser: MCT Adv.PHP Mailer 1.0'.$eol;
$headers .= 'MIME-Version: 1.0'.$eol;
//$headers .= 'Content-Type: text/html; charset="windows-1251"\r\n';
$headers .= 'Content-Type: text/html; charset="iso-8859-1"'.$eol;
$subject = 'New Song Request';

$msg .= '<font face=arial size=2>';
$msg .= 'You have recieved a message from SempoiBox Contact Form'.$break.$break;
$msg .= 'Please review the information below.'.$break.$break;
$msg .= '<strong>Name:</strong> '.$_POST['name'].$break;
$msg .= '<strong>E-Mail:</strong> '.$_POST['email'].$break;
$msg .= '<strong>Song:</strong> '.$_POST['phone'].$break;
$msg .= '<strong>Message:</strong> '.$_POST['message'].$break;
$msg .= $break;
$msg .= '_______________________________________________________________________'.$break;
$msg .= 'Revofm http://sempoibox.net/revofm'.$break;
$msg .= '</font>';

// Mail it
mail($mailTo, $subject, $msg, $headers);

echo '<h1 if="mainhead">Thank you!</h1>
<p class="main_txt">Thanks for contacting us. Someone will get back to you as soon as possible.</p>';

} else {
echo '<h1 id="mainhead">Error!</h1>
<p class="main_txt">The following error(s) occured.<br/>';
foreach ($errors as $errorMSG) { // Print each error.
echo " - $errorMSG<br/>\n";
} // End of Errors

echo 'Please go <a href="Javascript:history.go(-1)">back</a> and try again.</p>';

} // End of if (empty($errors)) IF Statement

} else { // Display the form.

echo'<p class="main_txt">Please take a moment to fill out the form below to contact us.<br>
<form action="formMail.php" method="post">
Name: &nbsp; *<br>
<input name="name" type="text" value="'.$_POST['name'].'" tabindex="1" size="50" />
<br>
E-Mail Address: &nbsp; *<br>
<input name="email" type="text" id="email" value="'.$_POST['email'].'" tabindex="2" size="50" />
<br>
Song:<br>
<input name="phone" type="text" id="phone" value="'.$_POST['phone'].'" tabindex="3" size="50" />
<br>
Message: &nbsp; *<br>
<textarea name="message" cols="38" rows="8" id="msg" tabindex="4" />'.$_POST['$message'].'</textarea>
<br><br>
<input name="submit" type="submit" value="Hantar" tabindex="5" /><input type="hidden" name="submitted" value="TRUE" /> &nbsp; <input name="reset" type="reset" value="Reset" tabindex="6" /> &nbsp; <em>* = required</em>
</form>
</p>';

} // End of submitted IF-ELSE statement

?> [/quote]
_________________
irc.mamakchat.org
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber