[Developer Shed Network] Server Side - PHP - Building a Generic Error Reporting Class in PHP
[Developer Shed Network] Server Side - PHP - Commercial Break - A PhpAds Primer
-
Upload
seher-kurtay -
Category
Documents
-
view
222 -
download
0
Transcript of [Developer Shed Network] Server Side - PHP - Commercial Break - A PhpAds Primer
-
7/30/2019 [Developer Shed Network] Server Side - PHP - Commercial Break - A PhpAds Primer
1/19
By Harish Kamath
This article copyright Melonfire 20002002. All rights reserved.
http://www.melonfire.com/http://www.melonfire.com/ -
7/30/2019 [Developer Shed Network] Server Side - PHP - Commercial Break - A PhpAds Primer
2/19
Table of Contents
Money Money Money.........................................................................................................................................1
Getting Started....................................................................................................................................................2
The Toy Store......................................................................................................................................................4
Different Strokes.................................................................................................................................................6
Room With A View()..........................................................................................................................................8
The Advanced Course.......................................................................................................................................12
Access Denied....................................................................................................................................................14
The Number Game...........................................................................................................................................15
Endgame............................................................................................................................................................17
Commercial Break (A phpAds Primer)
i
-
7/30/2019 [Developer Shed Network] Server Side - PHP - Commercial Break - A PhpAds Primer
3/19
Money Money Money
So you've finally set up your Web site, plugged in some interesting content, and got yourself into the Google
database. And, against all your expectations, the public actually likes your Web site. People are telling each
other about it, and visiting it again and again. Slashdot decided to review it, and the results almost melted your
ISP's network. And wonder of wonders people have started emailing you about advertising on yoursuddenlypopular Web site.
It doesn't take an Einstein to see that, somehow, you lucked out and hit on a good thing. Now, you need to
start making some moolah. Those guys who wanted to advertise on your site? Drop them a line, tell them how
much to pay, and ask them to send you their ads. And while you're waiting for the wire to hit, go and get
yourself a copy of phpAds. Don't worry if you don't know what to do with it I'll show you everything you
need to know in the next couple of pages.
Money Money Money 1
-
7/30/2019 [Developer Shed Network] Server Side - PHP - Commercial Break - A PhpAds Primer
4/19
Getting Started
Let's start with the basics what the heck is phpAds, anyhow?
phpAds, in the words of its author, is "a banner management and tracking system" for Web sites. It allows
Web administrators to manage advertisers and advertiser banners on a Web sites, display them in a random orpredefined arrangement, and deliver reports based on user impressions per banner. It's also pretty popular,
and quite a few Web sites use it to manage their online advertising activities.
The first thing is to make sure that you have everything you need for a successful installation of phpAds.
Typically, you'll need a PHPcompliant Web server (I'm using Apache), and a MySQL database server. Most
Web hosting providers already offer these three components; however, in case yours doesn't, you can get
Apache from http://www.apache.org, PHP from http://www.php.net and MySQL from
http://www.mysql.com.
Once you've got all three packages configured and installed, download a copy of phpAds from the official
Web site at http://www.phpwizard.net/, and uncompress it to a location under your server root.
$ tar xzvf phpAds_1.4.0.tar.gz
Next, create a MySQL database to store all the application information. Drop to a command prompt, and start
up the MySQL client.
$ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 7311 to server version: 3.23.39
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
Create a new database for the application (I've called mine "phpads").
mysql> CREATE DATABASE phpads;
With the database created, it's time to set up all the required tables. This isn't as hard as it sounds the
phpAds distribution comes with a single SQL file, "all.sql", which contains all the SQL commands needed to
set up the application's database tables. All you need to do is execute these commands via the MySQL's
server's client program.
Getting Started 2
http://www.apache.org/http://www.php.net/http://www.mysql.com/http://www.phpwizard.net/http://www.mysql.com/http://www.php.net/http://www.apache.org/ -
7/30/2019 [Developer Shed Network] Server Side - PHP - Commercial Break - A PhpAds Primer
5/19
$ mysql D phpads u root p