Showing posts with label script. Show all posts
Showing posts with label script. Show all posts

Saturday, March 19, 2011

FPSP - Flat File Php Shopping Page

It's a very long time since I blogged. The reason is that I was working on this.
Today on Holi this is my present to all of you. Maybe the last version of my Php Shopping Script.
I have been working on this for the past few months and now it is ready for you all to download and use.
This script comes with a lot more than any of my previous script. It includes:

1) Flat file databases (as the name suggested)
2) Products are divided into categories for easy access
3) Much more information about the product can be stored in flat files.
4) Very easy to update and use.

WOW! That is a lot. Also because the coding in this script is much more complicated, I have decided to give it pre packed. So just go to http://www.titan4119.110mb.com/fpsp/index.php and download FPSP.zip.

It is really easy to use, you can understand it completely. Just use it and if possible send me some traffic here.

Tuesday, February 15, 2011

FPSP - Flat File Php Shopping Page v 4.0

Have you enjoyed my Php Shopping Page Scripts v 2.0 and v 3.0 ?
Then you would love perhaps the last version of Php Shopping Page script FPSP v 4.0.
Yes the last and the best. It has so many new features that it may be the biggest script that I have ever written.
The features include:
1) It uses text files as database, so NO Sql or Access requried.
2) The products or scripts can be uploaded and the database can be updated online.
3) After a successful transaction, the user is asked to enter an email address where an email is sent containing a download code. The user clicks on the code to download the file.
4) The download code is different for each transaction and once downloaded then it becomes invalid.
5) The file to be downloaded is first copied to a download folder and given a random name, so that any user cannot trace the file to the folder where all your download files are located.
6) It also logs the date and time of download, IP address of the user, name of the product, file name and much more so that you know how much you sold.
7) All the important pages accessed by the admin are password protected.

This is just the summary of all the things that I've added, it took me months to come up with a script that was complicated enough to solve all your problems as well as simple enough for the average user to use.
It is still in Alpha testing stage. To go to Beta stage I need volunteers who can test the script and tell me the result. So if you want to test it for me, then leave a comment along with an email address and I'll send you a copy.

Thursday, February 3, 2011

LogIt v1.0

Even if you have a free site or blog like mine, you still advertise it don't you?
The cheapest and easiest way to advertise your site is by asking others to post a banner of your site on theirs and adding a link back to your site or simply a text link on their site
e.g.- <a href="www.mysite.com"><img sre="mybanner.jpg"></a>
Although easy it has one big problem, how would you know how many users visited your site, from which site and which pages were visited the most?
You might have a visitor counter on your site, so do I. But that also won't give you all the details, so here is a script that not only records the date of the visit, but also the user's IP address, from which site they came and which page they visited.
click.php
<?php
// LogIt v1.0
// Script Written By Tanmay Das
// Script © Copyright Design Inline.com

// Opening Databse file
$dbase = 'dbase.txt';
$data = file($dbase);
// Creating array
$array = explode("||", $data[0]);
$today = $array[0]; // Today's date
$ipad = $array[1]; // IP of the user
$reff = $array[2]; // Site from the user came
$frurl = $array[3]; // Page the user wished to go
$today = date("l, F j, Y, g:i a");
$ipad = getenv("REMOTE_ADDR");
$reff = getenv("HTTP_REFERER");
$default0 = home;
$frurl = isset($_GET['url']) ? $_GET['url'] : $default0;
if($frurl != 'home')
{
$insertdata = $today."||".$ipad."||".$reff."||".$frurl."\n";
// Writing data to file
$fp = fopen($dbase,"a");
fputs($fp,$insertdata);
fclose($fp);
header("Location: ".$frurl); // Redirecting user to specified page
}
else
{
$userinfo = file('dbase.txt'); // Opening Database file
// Creating Table
echo '<table border = "1">';
echo '<tr><td>Date</td><td>IP Address</td><td>Referrer Address</td><td>Forwaded URL</td></tr>';
foreach($userinfo as $key => $val)
{
//explode that data into a new array:
$data[$key] = explode("||", $val);
}
for($k = 0; $k < sizeof($userinfo); $k++)
{
echo '<tr><td>'.$data[$k][0].'</td><td>'.$data[$k][1].'</td>';
echo '<td><a href="'.$data[$k][2].'">'.$data[$k][2].'</a></td><td><a href="'.$data[$k][3].'">'.$data[$k][3].'</a></td></tr>';
}
echo '</table>';
}
?>

Just save it as say click.php upload it on your server along with a blank text file named dbase.txt.
While giving someone link to post on their site, instead of
<a href="www.mysite.com"><img sre="mybanner.jpg"></a>, give
<a href="www.mysite.com/click.php?url=page.html"><img sre="mybanner.jpg"></a>
Try it out.

Meta Tag Generator

When coding a site in HTML or  PHP, meta data is really important. If you have read about SEO (Search Engine Optimization) then you would know that search engine like Google™ and Yahoo™ first read the meta data so adding it in your page makes your page even more easy for search engines to find.
But if you don't know how to write meta data then here is my Meta Tag Generator v1.0. Just enter the following data and hit Generate. Your code would be ready, just copy and paste the code between the <head></head> tags and you are done.

Meta Tag Generator v1.0
Written By Tanmay Das
Title of the Page :
Name of the Author :
E-Mail of the Author :
Robots Permission :
Copyright Date :

Character Set Info
Page Expires on :
Refresh Period :
Reload URL :
Description :
Keywords :

Saturday, January 15, 2011

Simple Shopping Cart with Alertpay™

Many of you must be thinking about putting a shopping cart on your site, blog to earn some cash, sell your HTML templates or images or scripts. But shopping cart takes a little effort to run. I mean My SQL or a flat file database. Also many free scripts use a .cgi file, if you have paid hosting then no problem, but if you have free hosting (like my www.designinline.elementfx.com ) then you are not given access to any .cgi file on the server.
So after fiddling around with PHP, I made a script that uses neither a database (My SQL or flat file) nor .cgi file. It is a simple PHP file that calls the variable from the link to load data and sends the user to your AlertPay page to buy your file. So all you have to do is upload the screenshot image file, flash files (if any) and the zip file to be downloaded and using only three files you can sell all your files. I have used AlertPay because I have an account there also I tried to open a PayPal™ account but I didn't succeed. So here is my script.
You might remember earlier I had posted a tutorial I modified to make PHP Templates. The script is more or less the same but I modified it more so that instead of calling a php file. It calls .jpg preview of the template and inserts all the data from the link into itself. Sample.
To start just copy and paste this code in the body tag and save it as say cart.php.
// Simple PHP Shopping Page Script
// © Copyright, Design InLine.com
// Script created by Tanmay Das
<?php
$default1 = 'test';
$furl = isset($_GET['id']) ? $_GET['id'] : $default1;
$furl = basename($furl);
$default2 = 'Name of the Template';
$fname = isset($_GET['name']) ? $_GET['name'] : $default2;
$fname = basename($fname);
$default3 = 'Tanmay Das';
$author = isset($_GET['aut']) ? $_GET['aut'] : $default3;
$author = basename($author);
$default4 = '0';
$price1 = isset($_GET['r1']) ? $_GET['r1'] : $default4;
$price1 = basename($price1);
$default5 = '0';
$price2 = isset($_GET['r2']) ? $_GET['r2'] : $default5;
$price2 = basename($price2);
if (file_exists('download/'.$furl.'.zip'))    {
echo('<table width="1000" border="0" cellspacing="0" cellpadding="0">');
echo('<tr><td width="75%"><img src="preview/'.$furl.'.jpg" /></td>');
echo('<td width="25%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">');
echo('<tr><td>'.$fname.'</td></tr><tr><td>&nbsp;</td></tr>');
echo('<tr><td>Author : '.$author.'</td></tr><tr><td>&nbsp;</td></tr>');
echo('<tr><td>Commercial Licence (Price : $'.$price1.')</td></tr><tr><td align="center">');
echo('<form method="post" action="https://www.alertpay.com/checkout" >');
echo('<input type="hidden" name="ap_purchasetype" value="item-goods"/>');
echo('<input type="hidden" name="ap_merchant" value="yourmail@yoursite.com"/>');
echo('<input type="hidden" name="ap_itemname" value="'.$fname.' (Commercial Licence)"/>');
echo('<input type="hidden" name="ap_currency" value="USD"/>');
echo('<input type="hidden" name="ap_returnurl" value="http://www.yoursite.com/c_download.php?id='.$furl.'"/>');
echo('<input type="hidden" name="ap_itemcode" value="'.$furl.'"/>');
echo('<input type="hidden" name="ap_quantity" value="1"/>');
echo('<input type="hidden" name="ap_amount" value="'.$price1.'"/>');
echo('<input type="hidden" name="ap_cancelurl" value="http://www.yoursite.com/c_cancel.php?id='.$furl.'"/>');
echo('<input type="image" name="ap_image" src="buy.gif"/>');
echo('</form></td></tr><tr><td>&nbsp;</td></tr>');
echo('<tr><td>Developer&acute;s Licence (Price : $'.$price2.')</td></tr>');
echo('<tr><td align="center"><form method="post" action="https://www.alertpay.com/checkout" >');
echo('<input type="hidden" name="ap_purchasetype" value="item-goods"/>');
echo('<input type="hidden" name="ap_merchant" value="yourmail@yoursite.com"/>');
echo('<input type="hidden" name="ap_itemname" value="'.$fname.' (Developer&acute;s Licence)"/>');
echo('<input type="hidden" name="ap_currency" value="USD"/>');
echo('<input type="hidden" name="ap_returnurl" value="http://www.yoursite.com/d_download.php?id='.$furl.'"/>');
echo('<input type="hidden" name="ap_itemcode" value="'.$furl.'"/>');
echo('<input type="hidden" name="ap_quantity" value="1"/>');
echo('<input type="hidden" name="ap_amount" value="'.$price2.'"/>');
echo('<input type="hidden" name="ap_cancelurl" value="http://www.yoursite.com/d_cancel.php?id='.$furl.'"/>');
echo('<input type="image" name="ap_image" src="buy.gif"/>');
echo('</form></td></tr></table></td></tr></table>');
}
else
{
echo('The template you are looking for was not found');
}
?>

Now for the link.
http://www.yoursite.com/cart.php?id=12345&name=Name of the Template&aut=Author's Name&r1=10&r2=20
OK the "id" is the name of your screenshot file (the image file that you'll give for preview) which should be in the "preview" folder also the name of the .zip/.rar file (the one that others will download) which should be in the "download" folder. You can change the folders by changing their paths.
The "name" in the link is the name you want to give to the template or script to download to make it look fancy. The "aut" is the name of the author of the file and "r1" and "r2" are the variables carrying the price to Alertpay™.

The download file is also very simple. Just copy and paste this code in download .php.

<?php
$default = 'home';
$furl = isset($_GET['id']) ? $_GET['id'] : $default;
$furl = basename($furl);
header('Location: http://www.yoursite.com/download/'.$furl.'.zip');
?>
<div align="center"><b>Download is in progress</b><br />
<img src="load.gif" width="32" height="32" /><br />
If the download doesn't starts in 5 sec then <a href="<?php echo('http://www.yoursite.com/download/'.$furl.'.zip'); ?>">Click Here</a> to download manually.</div>

It is a simple script right just make the files, upload them and test them out. You'll figure it out very easily.

P.S.- The script is still a work in progress. I have still some work to do on it to make it secure. It is basically for those who want to earn some cash, if you really want to earn your living of selling the I suggest you look for a more secure shopping cart.

Monday, November 1, 2010

SWF rotator version of the Ad Rotator script

Earlier I posted a simple script 2 rotate banner ads randomly by javascript.
U can use it 2 place jpgs, gifs & pngs, but 2 place flash files U need some changes 2 B done in them, so I M posting this version 4 placing swf files.
Again this is very simple script & in no way I M sure that it might B appealing 2 U. But it will work & I have tested it on many browsers and it is simple.
So here is D code

// Swf rotator script created by Tanmay Das
// Script © Copyright, Tanmay Das.com
// Visit http://tj4119.blogspot.com/
// Ad your swfs here

// e.g. 'ad1.swf',

// DO NOT PUT a (,) at the end

randomAd(['swf1.swf','swf2.swf','swf3.swf']);

// DO NOT EDIT ANYTHING BELOW

function random(limit){
return Math.floor(Math.random()*limit);
}
function randomSwf(swfArr)
{
var swfSrc, swfW, swfH, r;
r = random(swfArr.length / 1);

swfSrc = swfArr[r * 1];
swfW = 180; // You can change the swf width
swfH = 150; // You can change the swf height
document.write('<embed src='+swfSrc+' width='+swfW+' height='+swfH+' autostart=true loop=true></embed><br>
<a href="www.tj4119.blogspot.com" title="Created By Tanmay Das" target="_blank">Designed By Tanmay Das</a>');
}

Sunday, October 31, 2010

Simple Ad Rotator Script

Sorry I was offline 4 some time but that time gave me some thought & I went creative. I designed 30 web-templates ready to B sold. But also have created a simple script to rotate image banners.

It is not required if U use Google™ Adsense, but if U have your own ads than It'll B very useful. It is simple to use & doesn't requires any database or PHP.

So if U want it then here it is.

// Ad rotator script created by Tanmay Das
// Script © Copyright, Tanmay Das
// Visit http://tj4119.blogspot.com/
// Ad your images, links and title here

// e.g. 'ad1.jpg','www.link1.com','Title Goes here',

// DO NOT PUT a (,) at the end

randomAd([
'ad1.jpg','link1','title1',
'ad2.jpg','link2','title2',
'ad3.jpg','link3','title3'
]);

// DO NOT EDIT ANYTHING BELOW

function random(limit){
return Math.floor(Math.random()*limit);
}

function randomAd(imgArr)
{
var imgSrc, imgW, imgH, imgUrl, imgTit, r;
r = random(imgArr.length / 3);
imgSrc = imgArr[r * 3];
imgW = 180; // You can change the ad width
imgH = 150; // You can change the ad height
// I decided that all D banners in one area of a site will B of D same size, so I made the size universal 4 all.
imgUrl = imgArr[(r * 3)+1];
imgTit = imgArr[(r * 3)+2];

document.write('<a href='+imgUrl+' title='+imgTit+' target=_blank><IMG SRC='+imgSrc+' WIDTH='+imgW+' HEIGHT='+imgH+'></a><br><a href="www.tj4119.blogspot.com" title="Created By Tanmay Das" target="_blank">Designed By Tanmay Das</a>');
}

Just save it as adfile.js and add the link to anywhere on your site where U want the ads.
Remember that all the banners should B of D same size & change the width & height at imgW &imgH.