Dec 27

With this code u can upload any data like zip file to anywhere with a upto 100GB per second speed

PHP Code:

PHP

if ($_GET[xfer]) {

if ($_POST[from] == “”) {

print “You forgot to enter a url.”;

} else {

copy(”$_POST[from]“, “$_POST[to]“);

$size = round((filesize($_POST[to])/1000000), 3);

print “transfer complete.<br>

<a><a href=\”$_POST[from]\”>$_POST[from]</a><br>

<a><a href=\”$_POST[to]\”>$_POST[to]</a> : $size MB”;

}

} else {

print “<form action=\”$PHP_SELF?xfer=true\” method=post>

from(http://): <input name=from><br>

to(filename): <input name=to><br>

<input type=submit value=\”transload\”>”;

}

Dec 20

you can retrieve emails from your Gmail account in no time!

Here is the Codes:-

CSS

div.toggler { border:1px solid #ccc; background:url(any background) 10px 12px #eee no-repeat; cursor:pointer; padding:10px 32px; }

div.toggler .subject { font-weight:bold; }

div.read { color:#666; }

div.toggler .from, div.toggler .date { font-style:italic; font-size:11px; }

div.body { padding:10px 20px; }

JavaScript

window.addEvent(’domready’,function() {

var togglers = $$(’div.toggler’);

if(togglers.length) var gmail = new Fx.Accordion(togglers,$$(’div.body’));

togglers.addEvent(’click’,function() { this.addClass(’read’).removeClass(’unread’); });

togglers[0].fireEvent(’click’); //first one starts out read

});

PHP Codes

/* connect to gmail */

$hostname = ‘{imap.gmail.com:993/imap/ssl}INBOX’;

$username = ‘Your Gmail Username’;

$password = ‘Your Gmail Password’;


/* try to connect */

$inbox = imap_open($hostname,$username,$password) or die(’Cannot connect to Gmail: ‘ . imap_last_error());


/* grab emails */

$emails = imap_search($inbox,’ALL’);


/* if emails are returned, cycle through each… */

if($emails) {

/* begin output var */

$output = ”;

/* put the newest emails on top */

rsort($emails);

/* for every email… */

foreach($emails as $email_number) {

/* get information specific to this email */

$overview = imap_fetch_overview($inbox,$email_number,0);

$message = imap_fetchbody($inbox,$email_number,2);

/* output the email header information */

$output.= ‘<div class=”toggler ‘.($overview[0]->seen ? ‘read’ : ‘unread’).’”>’;

$output.= ‘<span class=”subject”>’.$overview[0]->subject.’</span> ‘;

$output.= ‘<span class=”from”>’.$overview[0]->from.’</span>’;

$output.= ‘<span class=”date”>on ‘.$overview[0]->date.’</span>’;

$output.= ‘</div>’;

/* output the email body */

$output.= ‘<div class=”body”>’.$message.’</div>’;

}

echo $output;

}


/* close the connection */

imap_close($inbox);

—————————————————–

With your individual username/password settings set, we connect to Gmail. Once connected, we request all emails. If we find emails, the newest emails appear on top. For every email we receive.

Dec 19

Let’s see, what a single PHP page can do….

IMDB (Internet Movie DataBase) has info on every movie ever made (or so it seems). Lets see how to grab IMDB information with a single PHP page….

PHP Code

<?php

//url

$url = ‘http://www.imdb.com/title/tt1166100/’;

//get the page content

$imdb_content = get_data($url);

//parse for product name

$name = get_match(’/<title>(.*)<\/title>/isU’,$imdb_content);

$director = strip_tags(get_match(’/<h5[^>]*>Director:<\/h5>(.*)<\/div>/isU’,$imdb_content));

$plot = get_match(’/<h5[^>]*>Plot:<\/h5>(.*)<\/div>/isU’,$imdb_content);

$release_date = get_match(’/<h5[^>]*>Release Date:<\/h5>(.*)<\/div>/isU’,$imdb_content);

$mpaa = get_match(’/<a href=”\/mpaa”>MPAA<\/a>:<\/h5>(.*)<\/div>/isU’,$imdb_content);

$run_time = get_match(’/Runtime:<\/h5>(.*)<\/div>/isU’,$imdb_content);

//build content

$content.= ‘<h2>Film</h2><p>’.$name.’</p>’;

$content.= ‘<h2>Director</h2><p>’.$director.’</p>’;

$content.= ‘<h2>Plot</h2><p>’.substr($plot,0,strpos($plot,’<a’)).’</p>’;

$content.= ‘<h2>Release Date</h2><p>’.substr($release_date,0,strpos($release_date,’<a’)).’</p>’;

$content.= ‘<h2>MPAA</h2><p>’.$mpaa.’</p>’;

$content.= ‘<h2>Run Time</h2><p>’.$run_time.’</p>’;

$content.= ‘<h2>Full Details</h2><p><a href=”‘.$url.’” rel=”nofollow”>’.$url.’</a></p>’;

echo $content;

//gets the match content

function get_match($regex,$content)

{

preg_match($regex,$content,$matches);

return $matches[1];

}

//gets the data from a URL

function get_data($url)

{

$ch = curl_init();

$timeout = 5;

curl_setopt($ch,CURLOPT_URL,$url);

curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);

curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);

$data = curl_exec($ch);

curl_close($ch);

return $data;

}

?>

……………………………………………………………………………………………………..

Result—

Demo

That’s a great IDEA to make a dynamic scrpit of movies detail… using a single php page.

I Designed a PHP Scrpt using this method which you can see here….

Yolike Movies Details

…………….

Hope you will like this great !dea……

Rajshekhar Rajaharia shared by  wordpress themes