This page contains answers to some of the most frequently asked questions by people looking to purchase PHP-Keycodes. This is also a good place to start for those who are having problems with installation.
Use this list to jump to the appropriate answer below:
Do I have to enter anything into the PayPal site to identify the IPN url?
Is PHP installed on my web server and what version do I have?
My pages show fatal errors.
Why do I keep getting error messages about headers already sent?
I keep getting error messages about session_start
I get an open_basedir error message
Can I Send emails from a Windows server?
Do I have to create a new database?
How do I backup my PHPKeyCode site?
Is there a shop cart system?
Does it handle PayPal eChecks which may take days to clear?
What knowledge and what facilities do I need?
What do the admin emails mean?
What do the mySQL error messages mean ?
Modification for GoDaddy Hosting
How do I change the language code for PayPal ?
PHP 5.3 depreciated functions
The admin pages keeps on returning to the login screen
Setting a character set
Sending html email using normal non-smtp PHP email system
You do not have to do any configurations on the PayPal site for your account to identify the IPN URL. This is because the IPN URL is part of the data sent to PayPal when the customer clicks on the buy now button.
In fact, if you have set any IPN settings on the PayPal site, they will be overridden by the settings sent from PHPKeyCode.
Make a new file on your web site called info.php, containing the following text, and call it from your browser:
<?PHP phpinfo() ?>
If nothing happens then you don't have PHP installed.
If you see errors like:
Parse error: parse error, unexpected T_VARIABLE in
e:\phpfiles\withinweb\phpkeycode\config.php on line 13
Notice: Undefined variable: dbhost in e:\phpfiles\withinweb\phpkeycode\admin\a_setup.php on line 154
then it's likely you have left out a semi-colon or ending quote from a line in config.php.
Another reason could be that you have opened config.php in a program like Word to edit it, and saved it as a HTML web page, instead of a proper text file.
Always edit config.php with a text editor such as notepad or an editor designed to edit web pages such as Dreamweaver.
If you see errors like this:
Warning: Cannot add header information - headers already sent by (output started at /webfiles/phpkeycode/config.php:87) in /webfiles/phpkeycode/index.php on line 322
then you probably have blank lines or spaces after the final ?> in your config.php file. Sometimes text editors add these so you may have to try a different text editor to remove these spaces or blank lines.
If you see errors like this:
Warning: session_start() [function.session-start]: open(/tmp\sess_d40f380d37d431fc1516e9a895ad9ce0, O_RDWR) failed: No such file or directory (2) in c:\webfiles\phpkeycode\setup.php on line 123
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at c:\webfiles\phpkeycode\setup.php:1) in c:\webfiles\phpkeycode\setup.php on line 123
These are all related to PHP failing to save "session" files on your hard disk (in a directory called /tmp). Usually the reason is that you don't have a folder called /tmp on your computer. This is often the case with Windows installations.
The solution is to set the PHP setting for this path to point to a real folder. You can do this in your php.ini file:
session.save_path = C:\temp
I have created a php file to test sessions. This is located in the admin folder at : http://www.yourservername.com/phpkeycode/admin/a_session_test.php.
Your hosting provider or server administrator may have restrictions on which directories can use 'includes'. To check this, log into the administration section of PHP-KeyCodes and click on 'PHP info' link in the left hand side menu. This will display your site php info page. Find 'open_basedir' and check if the setting is something other than 'no value'. If it is something other than 'no value' then you might have to install PHP-KeyCodes in the directory shown. Check with your hosting provider.
If a user is getting this error message on the screen when trying to download a file via the Download Link (i.e. after a sale), the open_basedir setting is preventing the PHP script from writing a temporary file that's needed for the download to happen. The solution is to have your server administrator or hosting provider change the open_basedir setting to 'no value'.
The best way to send email from a Windows server is to use smtp. The smtp settings are in the config.php file. Once set, all emails from the application will be sent using smtp.
You don't have to create a new database if you don't want to. You could install the tables in an existing database providing that the table names do not clash. In version 4 onwards you can set an optional prefix for table names - this will stop table name clashes.
All of my tables are prefixed with ipn_, so providing none of the existing tables have that prefix, there should be no problem.
There are two things you need to make a copy of : the database with its data and the uploaded files. The admin scripts themselves are less important, since you should have the original files and any others you have modified to change the look of your displays.
The database can be easily backed up using the in built back up / restore facility.
No. PHP-KeyCodes does not have a shopping cart system at the moment.
If someone purchases with an eCheck, you will receive an email saying that a purchase has been made, but at that point, as the check has not cleared, the customer will not get their login details. When the eCheck has cleared, the payment process continues and the customer will receive their login details.
No, you purchase the application and install it onto your own web server.
Your system must meet the requirements of :
The application has been written to make it as easy to install as possible with minimum knowledge of PHP or mySQL. You need to be able to upload the files to your web server and to edit a configuration file with appropriate information.
You will also need to be able to integrate the store pages into your web site. If you intend to use the dynamically created button lists, it is helpful if you have a basic knowledge of PHP include files. Hand created buttons are very simple to place onto existing web pages.
The application sends emails to the administrator for each transaction and most are self-explanatory. The following describes the less obvious ones :
IPN - VERIFIED but incorrect Receiver_email address, no action taken - usually means that you have multiple email addresses in your PayPal account and you need to enter the primary PayPal email address into the Global Set Up admin section of PHP-KeyCodes.
IPN - Error : Txn_ID has been duplicated - means that a previous transaction in the saleshistory table has the same txn_id which is an error. Although this is an error, it can occasionally happen with correct transactions and appears to be caused by the web server being slow or the internet being slow so that PayPal sends out another IPN before it receives an acknowledgement from your web server. In those situations the application does not register it as another sell, but just sends out a warning email saying that it has detected a duplicate txn_ID.
The following is a list of some of the mySQL errors that can occur and which may help if you are having problems connecting to the database.
|Error message||Possible reasons|
|Warning: mysql_connect() [function.mysql-connect]: Access denied for user: 'USERNAME@localhost' (Using password: YES) in /usr/home/..../test.php on line 8||Your MySQL username/password is incorrect|
|Access denied for user: 'USERNAME@localhost' (Using password: YES)||Your MySQL username/password is incorrect|
|Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL Server Host 'HOSTNAME' (1) in /usr/home/..../test.php on line 8||Your MySQL hostname is incorrect|
|Could not connect: Unknown MySQL Server Host 'HOSTNAME' (1)||Your MySQL hostname is incorrect|
|Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /usr/home/...../test.php on line 8||Your MySQL hostname is incorrect or you do not have the MySQL service started|
|Could not connect: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)||Your MySQL hostname is incorrect or you do not have the MySQL service started|
|Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'mysql.domain.com' (60) in /usr/home/..../test.php on line 8||Your MySQL hostname is incorrect or you do not have the MySQL service started|
|Could not connect: Can't connect to MySQL server on 'mysql.domain.com' (60)||Your MySQL hostname is incorrect or you do not have the MySQL service started|
GoDaddy servers require a slight modification to the script because of their security system. In the folder 'ipncommon', remove the existing file 'com_ipnfunctions.php' and change the file name 'com_ipnfunctions_godaddy.php' to 'com_ipnfunctions.php'
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 then 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.
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.
If you login to the admin pages and then click to go to a different page in the menu it returns to the login screen. This is becuase there is something wrong with your server session variables. The server stores the sessions and for some reason this is not being done correctly. You need to contact your hosting company to sort the problem out.
There is a test at :
Which will attempt to start the sessions. It will show a link that you click and should tell you if the session has been correctly started.
If you are using extended characters in your text you may find that they display as small blocks or as question marks on the page. To overcome this you could add the following to the connect() function in the clsdatalayer.php file in the /classes/ folder.
However. this function is only available for version PHP 5.2.3 and above.
You should be able to send out emails in HTML format as it is built into the code but you will have to change the $format variable to "html".
In the misc.php file, there is a function called mailmessage_nonsmtp()
Somewhere within that function, you need to set
$format = "html"