You are most probable getting a fatal error, and the way PHP is configured now, doesn't show you that publicly. Enable that setting via php.ini or directly in the script (not recommended) or check out the webserver's error_log (assuming apache and a RedHat based distro this will be on /var/log/httpd/error_log). This will tell you what is really going on because we don't even know what mySQL_user_login.inc.php looks like or what it does, we also don't know what extensions are activated. Providing that information you'll get more luck getting great answers. Also try to mention what distro you're using. Greetings. On Wed, May 29, 2013 at 8:09 PM, Jim Giner <jim.giner@xxxxxxxxxxxxxxxxxx>wrote: > On 5/29/2013 1:39 PM, Ron Piggott wrote: > >> >> Good morning all: >> >> 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? >> >> Ron Piggott >> >> >> >> www.TheVerseOfTheDay.info >> >> #1 - it's not an "include error". It's a programmer error > > #2 - that said - why would you want to do this? The release of > usernames/passwords is a dangerous practice - even in development. If all > you want to do is verify that you passed thru this bit of code, echo some > less sensitive message, such as "Connected successfully". Or even better > have the connect function return true or false and check the return. > > #3 - global > #4 - global > and #5 global. Anytime you want to use a var withing a function include > it in a global statement. > > I always forget too. But I'm getting pretty good at remembering how to > resolve it. > > PS - do you store your .inc file with this sensitive info on your server > "outside" of the web-accessible path? I hope so. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >