KidViciou$
Diamond Member
i'm writing a survey application that is using PHP for the front end, and mysql for the back end
i basically am using a php file, login.php to be my "driver"
when a person enters a username and password that is found in the DB, a function userUI() is called to display which surveys they can take.
this is presented using an html form and drop down box. when they select the survey they want, the form logic is called, and if the surveyNum isn't 0 (Reserved for a blank select option), it will call a function takeSurvey()
the problem is, i can no longer access the global $db variable which maintains my database connection. i would have to make a new connection to the database which i'm trying to avoid. i can also no longer access ANY variables in login.php
this is my first time coding php, and i know that using the form is causing this problem, but i don't know how to get around it. any help? TIA
i basically am using a php file, login.php to be my "driver"
when a person enters a username and password that is found in the DB, a function userUI() is called to display which surveys they can take.
this is presented using an html form and drop down box. when they select the survey they want, the form logic is called, and if the surveyNum isn't 0 (Reserved for a blank select option), it will call a function takeSurvey()
the problem is, i can no longer access the global $db variable which maintains my database connection. i would have to make a new connection to the database which i'm trying to avoid. i can also no longer access ANY variables in login.php
this is my first time coding php, and i know that using the form is causing this problem, but i don't know how to get around it. any help? TIA