Hi,
I'm facing a problem with require_once.
Here is how my files were,
- 3 files of first.php and second.php and common.php
- my first.php has require_once('common.php'); so does my second.php
- However, when I ran both first and second.php together on one single web page, my second.php was unable to retrieve any information from common.php. The string returned was empty.
Though, the above example doesn't really explain things well, but it has more or less what I am facing.
Here is a live view of my problem,
http://zepx.co.cc
As you can see at the sidebar, under New Links, you will see that second.php managed to obtain information from common.php, with the condition, first.php was not loaded at all. So only second.php was loaded on the index page.
http://zepx.co.cc/links/
As you can see, this time, I included both first.php and second.php. first.php retrieved the information, thus echoing what was written in common.php. second.php failed, it just gave out an error.
Can someone tell me what is wrong?
For those who would like to know what I've did,
I was basically modifying linkman 1.7 (from phpjunkyard.com), to be compatible with wordpress. Linkman is an automatic reciprocal script. So, I created a new page in Wordpress's Admin panel. I also installed a plugin called exec-php (This plugin allows me to run php script by just using <?php and ?>). With that, my new page had this,
require_once('links.php');
links.php was a form interpreter and a form itself. You can see the form here, http://zepx.co.cc/links/ The output was exactly what I wanted.
Following that, created a new widget, and added the following,
<?php
require('autolink.php')
?>
Now autolink.php has require_once('common.php'), which couldn't retrieve any information.
My scenario was something like that.
Regards,
Zepx