Frequently Asked Questions: script questions: phpcalendar: page: 2
-
1
I get an error similar to this when I run create.php: “You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use.”
You most likely used a number as your table name. MySQL table names cannot consist of only numbers and cannot begin with numbers, so try adding a letter to it in config.php, and then run create.php again.
It’s also possible that you used a MySQL reserved word as the table name. This is not allowed either. A list of reserved words can be found here (scroll down).
May 21, 2004 |
By Sasha |
Filed under FA-PHPHosting: Troubles, FAQ, Flinx: Troubles, PHPCalendar, PHPCurrently, PHPFanBase: Troubles, PHPQuotes, Scripts
-
2
I keep getting the following error: “Warning: Cannot add header information - headers already sent…”!
This is usually caused by either your header.inc file or your config.php file. Try deleting all white lines (spaces, blank lines, etc.) and HTML code from header.inc. In config.php, make sure there are no white lines, spaces or HTML code before and after the opening <? and ?>. If that doesn’t work, try uploading the original, unedited config.php (with your MySQL information in it though!), header.inc and footer.inc that came with the script. If that doesn’t work either, post a message at the Forums. We’ll try to help you solve this as best as we can.
May 21, 2004 |
By Sasha |
Filed under FA-PHPHosting: Troubles, FAQ, Flinx: Troubles, PHPCalendar, PHPCurrently, PHPFanBase: Troubles, PHPQuotes, Scripts
-
3
Every time I log in, it takes me back to the login page. I know my username and password are correct, and I don’t get an error.
The most common cause of this problem is the scripts’ reliance on a PHP setting called “register_globals”. This setting is turned off by default in new versions of PHP, but at the time when most of CodeGrrl’s scripts were written, it was on.
This problem will affect you if register_globals is turned OFF on your server and if you are using any of the following scripts:
PHPCalendar, PHPClique, PHPCurrently, PHPFanBase, PHPQuotes, simpbook, Flinx and Flinx Collective.
You can do one of two things to fix this issue:
Either:
-
Use .htaccess/php.ini to turn register_globals back on. Add the following line to your .htaccess file:
php_flag register_globals on
If modifying .htaccess causes an internal server error, your host does not allow you to change these settings. Instead, you should paste this code into another blank file which you should call php.ini. This file goes into your root folder (usually called public_html):
register_globals = On
-
OR: Add the following code to config.php, placing it below the opening <?:
extract($_SERVER, EXTR_SKIP); extract($_COOKIE, EXTR_SKIP); extract($_POST, EXTR_SKIP); extract($_GET, EXTR_SKIP);
Note that this will only fix one script at a time. You will need to modify config.php for each one that is causing problems.
How do I check if register_globals is off on my server?
Add the following to a blank file, and save it as anything with a .php extension:
<?php phpinfo(); ?>
Upload it, then run it in your browser. You will get a long list of PHP settings and details. Press CTRL + F (on Windows) to find “register_globals” - you should see two columns to the right of it detailing whether the setting is on or off. If, under the FIRST column, it says “Off”, register_globals is off on your server.
If the above does NOT fix the problem, or register_globals is on on your server, there may be something to do with your computer or browser that is causing the login to fail.
Try the following solutions:
- Check that your computer’s date is set correctly. If it’s set in the future, you may have problems staying logged in.
- Delete all your Temporary Internet Files, including your cookies, clear out your cache and make sure cookies are enabled in your browser. Then reboot and try logging in again. This will solve it if it’s a cookie problem, like your browser not accepting them, or duplicate cookies being stored.
- Make sure that any ad-blocking software you have installed is allowing cookies from your domain. If it’s blocking them, you will be unable to login.
May 21, 2004 |
By Sasha |
Filed under FA-PHPHosting: Troubles, FAQ, Flinx: Troubles, PHPCalendar, PHPCurrently, PHPFanBase: Troubles, PHPQuotes, Scripts
-
-
4
Can I include two of the calendar files (such as calendar.php and calendar_year.php) on the same page?
Sorry, but no. You will get an error like this:
Fatal error: Cannot redeclare class date_calc in /home/user/public_html/calendar/calc.php on line 31
This happens because calendar.php defines the date_calc function relating it to the month, since it’s just a month calendar. The other two files (calendar_year.php and calendar_bdays.php) define the date_calc function relating it to the year. So, when you try to include them to the same page, the second file you include won’t work.
May 21, 2004 |
By Louise |
Filed under FAQ, PHPCalendar, Scripts
-
5
When I include the file, I get this error: “Warning: Failed opening ‘config.php’ for inclusion (include_path=”)…” What’s wrong?
It means the script can?¢‚Ǩ‚Ñ¢t find the config file. Try to include the full path to the config file. So, instead of
include 'config.php';
you would have
include '/path/to/folder/config.php';
For PHPCurrently, you would have to edit the second line of current.php. For PHPCalendar, it?¢‚Ǩ‚Ñ¢s the fourth line on calendar.php, calendar_bdays.php and calendar_year.php, and/or the second line of list.php, list_bday.php and list_year.
May 21, 2004 |
By Sasha |
Filed under FAQ, PHPCalendar, PHPCurrently, Scripts