PHP 5.3 and Depreciated Functions

Version PHP 5.3 has a number of functions that are depreciated and earlier versions of PHPeSeller, PHPSecureArea and PHPKeyCodes will display warning messages identifying those depreciated functions when installed on PHP 5.3.  It will still work as the functions are still there although they will be removed in PHP 6

To overcome this for earlier versions of the applications, in the error.php file just use

error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);

This will stop the depreciated warning messages being displayed.

Sell software licence codes with PHP-KeyCodes

PHP-KeyCodes is a is used to sell software key codes or pin numbers using PayPal or Google Checkout.  The key codes are entered into the item details and when a customer makes a purchase, the first key code is removed and sent by email to the customer. This leaves the next key code ready for the next purchase. When the number of codes reach a lower limit, an email is sent to the site administrator.  This functionality can be changed because code hooks are available.

The PayPal and Google Checkout ‘buy now’ buttons can be displayed in the admin interface and then copied on to your web pages.

PHP-KeyCodes is based PHP-eSeller and includes many of its features including transaction list, sales reports and email newsletter facility.

For details refer to http://www.withinweb.com/phpkeycodes/

How to set up an external smtp service

This describes how to set up the SMTP email for use with PHP-eSeller, PHP-SecureArea, PHP-KeyCodes.

You may find that you web server is not sending out emails as well as you would like.  Shared web servers sometimes have issues with how quickly the email is sent out and the headers in the emails.

To use an external SMPT service all you have to do is change the config.php file.

If you look at the config.php file there are some settings near the bottom of the page which should explain it.

$smtpuse    =     false;                                     //set to true if you are going to use smtp
$smtphost    =    “smtp_server_host_here”;    //The smtp host that you are using
$smtpusername     =     “smtp_user_name_here”;        //Your smtp username
$smtppassword    =    “smtp_passord_here”;             //Your smtp password

You change the smtpuser to true and you need a host name, username and password for the SMTP service.

PHP-Keycodes now with Google

PHP-KeyCodes is now able to use Google checkout as well as PayPal. 

In some ways Google checkout provides a better user experience than PayPal as the key code can be displayed to the customer on their Google checkout page. 

PHP-Keycodes can be used with a response handler (the code that monitors the transaction returned from Google checkout) but this requires SSL (a site that has https) or it can be used without the response handler and so your web site does not require SSL to handle the return data from Google.  Without a response handler you do not get the updates of Google sales back at your web site, but otherwise it operates in the same way.

Installing on Windows Web Server

PHP-eSeller and PHP-KeyCodes can both be installed on a Windows Web Server which runs PHP and has a mySQL database.  This is quite a common arrangement now, and many hosting companies provide this, enabling PHP applications to be installed on Windows Web Servers. 

Both of the applications work fine on Windows servers and normally work straight out of the box installation.

The only possible issue is sending emails.  Both applications need to send out emails from the server and this can be done by configuring PHP-eSeller and PHP-KeyCodes to use SMTP if the standard PHP email has not been set up.  This requires minor configuration changes to the config file which means entering the SMTP host, username, password.  All of these details should be available from your web site host if you donot know them.

You do not have to use the web server SMTP details, you can use an external SMTP mail service such as http://www.authsmtp.com.  Sometimes, these provide a better mail service than your host and may be more reliable.

Can different applications use the one PayPal IPN account

Can I use the same PayPal account for different PayPal applications.

Yes you can. The way you do it is to pass the url of the IPN script in the purchase button using the notify_url field.  PHP-eSeller, PHP-SecureArea and PHP-KeyCodes are all able to operate on the same PayPal account because they all send the IPN confirm url within the button.  This means that if you an application that uses your IPN PayPal account, you can still use withinweb.com applications on your site. 

In fact, withinweb.com applications create the and post the data to PayPal dynamically.  The relevant information is extracted from the database and, collected together and then posted to PayPal.  This method means that you can control the data centrally using the admin panel.

How do I change the language code for PayPal?

The language code for the PayPal site is defined in the button using a hidden field.

So for English language use
<input type=’hidden’ name=’lc’ value=’US’ />

Possible values are France(FR), Spain (ES), Italy (IT), Germany (DE), China (CN), English (US).

The customer should hopefully see the login page in the defined language.

To change the language code, go to the file ipnfunction.php open in a text editor and you should see the default language code of
<input type=’hidden’ name=’lc’ value=’US’ />

Change the value to what ever code you require and upload the file back to your server.

Creating a mySQL Database in cPanel (new style)

Log in to your Cpanel

Log into cPanel and click on the mySQL database link.

Create A New Database

Scroll down to where it says ‘new database’ and enter your choosen database name in the field and click on ‘Create Database’

MySql Account Maintenance Page 

Each step in the process will take you back and forth to the mySQL Maintenace page to verify that you have set up the process correctly and you will be able to see the information you have created.

Here you will see you have added the database.

Click on the Go Back button.

Enter Username and Password

Scroll down to username and password and enter your information.  Click on create user.

Back to MySql Account Maintenance Page 

The username and password have been created for you database.  Click on the Go Back button to return.

Add username to database

Scroll down to add users to your databases.

If there are no users or databases previously created you will only see one in each selection.

Choose the username that you want to add.  Note that the username previously created “myusername” has been shortened to “myusern”  This is the name that you need to use in the config.php file. 

Example: “vonnamia_myusern” not “vonnamia_myusername”

Select the Database you created from the list.

Select the Checkbox “All Privileges”.

Click Add User To Database

MySql Account Maintenance 

This will take you back to the MySql Account Maintenance page for verification, you will see the shortened Username there.

Click on the Go Back button and you will see the contents of your finished Database.

Running the install.php file

At this point you have created the database, created a user and allocated the user to the database.

You can now create the tables using the install.php script supplied with the zip file.

You will need to have the following information available :

database name
database username
database password
database host (usually local host but refer to your host documentation if you are not sure)

When you run the install.php file in your browser you will be presented with boxes as follows :