dfowler Posted February 2, 2009 Share Posted February 2, 2009 Hey guys, I have setup a config file for a signup process that pulls information from a database. The user's password that I am forced to use starts with a $. My code looks something like this: CONFIG_password = "$pass2"; My problem is now I keep getting the following notice at the top: Notice: Undefined variable: pass2 in C:\root\folder\configuration.php on line 32 Why is php reading this as a variable? Quote Link to comment https://forums.phpfreaks.com/topic/143468-undefined-variable/ Share on other sites More sharing options...
premiso Posted February 2, 2009 Share Posted February 2, 2009 CONFIG_password = '$pass2'; OR CONFIG_password = "\$pass2"; Use single quotes or escape the $. Quote Link to comment https://forums.phpfreaks.com/topic/143468-undefined-variable/#findComment-752580 Share on other sites More sharing options...
dfowler Posted February 2, 2009 Author Share Posted February 2, 2009 Thanks, seems to have done the trick. I'll remember that from now on! Quote Link to comment https://forums.phpfreaks.com/topic/143468-undefined-variable/#findComment-752587 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.