PHP Email Verification Script

Creating DB and following table

CREATE TABLE IF NOT EXISTS `users` (
`uid` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(300) NOT NULL UNIQUE,
`password` varchar(300) NOT NULL,
`activation` varchar(300) NOT NULL UNIQUE,
`status` enum('0','1') NOT NULL DEFAULT '0',
PRIMARY KEY (`uid`)
)

db.php

$dbhost = "localhost"; $dbuser= "root"; $dbpass = ""; $dbname="blockdb";
$dbprefix="bb";

// ==================== Site ====================

mysql_connect($dbhost,$dbuser,$dbpass) or die("Mysql server connection failed.");
mysql_select_db($dbname) or die("Database Not Found!");
$base_url='http://matinict.wordpress.com/email_activation/';

index.php

include 'db.php';
$msg='';
if(!empty($_POST['email']) && isset($_POST['email']) && !empty($_POST['password']) && isset($_POST['password']) )
{
// username and password sent from Form
$email=mysql_real_escape_string($_POST['email']);
$password=mysql_real_escape_string($_POST['password']);

$regex = '/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/';

if(preg_match($regex, $email)){
$password=md5($password); // Encrypted password
$activation=md5($email.time()); // Encrypted email+timestamp
$sql="SELECT uid FROM users WHERE email='$email'";
//echo mysql_query($connection,$sql);

$count=mysql_query($sql);
//echo 'Count=='.$count;
if(!@mysql_num_rows($count)){
echo $sql3="INSERT INTO users(email,password,activation) VALUES('$email','$password','$activation');";
//mysql_query($connection,$sql3);
mysql_query($sql3) or die(mysql_error());
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";

// More headers
$headers .= 'From: ' . "\r\n";
$headers .= 'Cc: suman.das@sslwireless.com' . "\r\n";
//$to = "$email";
$to=$email;
$subject = "Blockbuster BD Registered!";
$body='Hi,

We need to make sure you are human. Please verify your email and get started using your Website account.

'.$base_url.'activation.php?code='.$activation.'';

if (mail($to,$subject,$body,$headers)) {
echo("

Email successfully sent!

");
} else {
echo("

Email delivery failed…

");
}

$msg= "Registration successful, please activate email.";

}
else{$msg= 'The email is already taken, please try new.'; }

}
else{ $msg = 'The email you have entered is invalid, please try again.'; }

}
?>

PHP Email Verification Script

PHP Email Verification Script

Email

Password

activation.php

0)
{

$count=mysql_query("SELECT uid FROM users WHERE activation='$code' and status='0'");

if(mysql_num_rows($count) == 1)
{
mysql_query("UPDATE users SET status='1' WHERE activation='$code'");
$msg="Your account is activated";
}
else
{
$msg ="Your account is already active, no need to activate again";
}

}
else
{
$msg ="Wrong activation code.";
}

}
?>

PHP Email Verification Script
<link rel="stylesheet" href="style.css"/>

Download:

Download1
Download2

Refarance:

http://www.9lessons.info/2013/11/php-email-verification-script.html

Oracle Time Zone Issue

Valid Time Zones:
SQL> select tzname,tzabbrev from V$TIMEZONE_NAMES
DBTIMEZONE:
SQL> select DBTIMEZONE from dual;
SQL> ALTER DATABASE SET TIME_ZONE = ‘Asia/Dacca';
SQL> ALTER database SET TIME_ZONE = ‘Asia/Dacca';
SQL> ALTER database SET TIME_ZONE = ‘+06:00′;
SESSIONTIMEZONE:
SQL> alter session set TIME_ZONE=’+06:00′;
SQL> select SESSIONTIMEZONE from dual;
SQL> select SYSTIMESTAMP from dual;
SQL> select SYSTIMESTAMP from dual;

CURRENT_TIMESTAMP:
SQL> select CURRENT_TIMESTAMP from dual;

SQL>select dbtimezone,sessiontimezone from dual;

 

Ref:

http://www.databasejournal.com/features/oracle/article.php/3072991/Oracle-Time-Zone.htm

Products Carousel Slider – Magento Product Slider Extension

Instruction:

1) Install module via MagentoConnect

2) Go to System->Configuration->Mediasoftbd->Carousel, enabled module and setup images preload mode.

3) - Add the code below in the place you want the carousel to appear. It can be a static CMS page or a CMS block.
"{{block type="mediasoftbd_carousel/carousel" name="products.carousel" template="mediasoftbd/carousel/carousel.phtml" }}"

4) Go to products you want to use in carousel and change product's attribute "Use in Carousel" to Yes

5) Catalog ==>Manage Products ==>Add/Edit Product==> Product Information==>General(bootom) ==>Use in Carousel "Yes"
- Refresh cache and Index data

6) Support:Need help? Please contact us at ==>Contact Us: matinict@gmail.com

Remove

wp-includes/general-template.php/ change

switch ( $type ) {
case 'html':
$gen = '<meta name="generator" content="ZiaPhotography ' . get_bloginfo( 'version' ) . '">';
break;
case 'xhtml':
$gen = '<meta name="generator" content="ZiaPhotography ' . get_bloginfo( 'version' ) . '" />';
break;
case 'atom':
$gen = 'WordPress';
break;
case 'rss2':
$gen = 'http://wordpress.org/?v=' . get_bloginfo_rss( 'version' ) . '';
break;
case 'rdf':
$gen = '';
break;
case 'comment':
$gen = '';
break;
case 'export':
$gen = '';
break;
}
return apply_filters( "get_the_generator_{$type}", $gen, $type );
}

programatically change order status magento


require_once 'app/Mage.php';
umask(0);
Mage::app('default');

/*
    const STATE_NEW             = 'new';
    const STATE_PENDING_PAYMENT = 'pending_payment';
    const STATE_PROCESSING      = 'processing';
    const STATE_COMPLETE        = 'complete';
    const STATE_CLOSED          = 'closed';
    const STATE_CANCELED        = 'canceled';
    const STATE_HOLDED          = 'holded';
    const STATE_PAYMENT_REVIEW  = 'payment_review';
 */
$orderId = '200000120';
$order = Mage::getModel('sales/order')->loadByIncrementID($orderId);
$order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true);
$order->save();

echo "
Status Updated"; ?>