Tuesday, September 13, 2011
Saturday, September 3, 2011
Tuesday, April 19, 2011
CODE FOR PHP CAPTCHA
http://www.white-hat-web-design.co.uk/articles/php-captcha.php
[1:37:18 PM] yogesh Bajpai: CODE FOR PHP CAPTCHA
<form method="post" action="reg.php">
<b>Name</b><br/>
<input type="text" name="name" /><br/>
<b>Message</b><br/>
<textarea name="message"></textarea><br/>
<img src="captcha.php" id="captcha" /><br/>
<a href="#" onclick="
document.getElementById('captcha').src='captcha.php?'+Math.random();
document.getElementById('captcha-form').focus();"
id="change-image">Not readable? Change text.</a><br/><br/>
<b>Human Test</b><br/>
<input type="text" name="captcha" id="captcha-form" /><br/>
<input type="submit" />
</form>
======================================
<?php
session_start();
if (!empty($_REQUEST['captcha']))
{
if (empty($_SESSION['captcha']) || trim(strtolower($_REQUEST
['captcha'])) != $_SESSION['captcha'])
{
$note= 'Please enter correct text code';
}
else
{
if($_SERVER["REQUEST_METHOD"] == "POST")
{
$name=htmlentities($_POST['name']);
$message=htmlentities($_POST['message']);
// Insert SQL Statement
$note= 'Values Inserted Successfully';
}
}
unset($_SESSION['captcha']);
}
?>
Thursday, January 20, 2011
Downloade php cms for job portal,
http://www.jobberbase.com/
Php mail function not working with godaddy.com
function emailHtml($from, $subject, $message, $to) {
$host = "localhost";
$username = "";
$password = "";
$headers = array ('MIME-Version' => "1.0", 'Content-type' => "text/html; charset=iso-8859-1;", 'From' => $from, 'To' => $to, 'Subject' => $subject);
$smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => false));
$mail = $smtp->send($to, $headers, $message);
if (PEAR::isError($mail))
return 0;
else
return 1;
}
$host = "localhost";
$username = "";
$password = "";
$headers = array ('MIME-Version' => "1.0", 'Content-type' => "text/html; charset=iso-8859-1;", 'From' => $from, 'To' => $to, 'Subject' => $subject);
$smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => false));
$mail = $smtp->send($to, $headers, $message);
if (PEAR::isError($mail))
return 0;
else
return 1;
}
Monday, January 17, 2011
Subscribe to:
Posts (Atom)