top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration
Print Preview

How to solve include() Error in PHP

+1 vote
25 views

I have recently purchased a computer and am using it as a dedicated server. A friend helped me install PHP and configure. I am saying this because I wonder if using a newer version of PHP (compared to my commercial web host) may be the reasoning behind the error I am receiving.

I created a function to generate a form submission key.
- This created hidden variable for forms
- This is also session variable

With this function I have an include for the file containing the mySQL database, username and password. I know this file is being accessed because I added:

echo $mySQL_user;
following the login credentials. 

But when I remove this line from mySQL_user_login.inc.php and place within the function on the line following the include the "echo € returns nothing.

include("mySQL_user_login.inc.php");

echo $mySQL_user;

Can any of you tell me why this is happening?

posted May 29, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

0 votes

Is the "echo $mySQL_user;" inside of a function? I believe you'll need to say "global $mySQL_user;" to gain access to it if so.

answer May 29, 2013 by anonymous
Similar Questions
0 votes

For example say I want include("abc.php") two times in a PHP page?

0 votes

I use the pretty large Library PHP Image Workshop (http://phpimageworkshop.com/) at my project. It is about 75,5 KB. Everything works fine but if I try to include a 15 KB file with country codes, it fails. With the other files I easily get over 100 KB inclusion size, so my question; Is there a size limitation for include?


Useful Links with Similar Problem
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...