IainAdams Posted May 9, 2006 Share Posted May 9, 2006 Ok, first of all i have an HTML form. This form requires bits of information put into it from a database. I need to pass this form a ProjID when i click on a button somewhere else and that projID then needs to be used to create the queries. So i need a class that's constructor takes a variable that is the project ID. Then that ProjID is used to get different query results and those results are used in the form.My form code looks a lil like this:<html><head><h1><center>STH NHS Foundation Trust</center></h1><h1><center>Research Department</center></h1><body><form action="updateDatabase1.php" method ="Post"><p>STH Number : <?php echo "default" ?></p><p>Ethics Number: <?php echo "default" ?></p><p>Project Title : <?php echo "default" ?></p><p>Patients : (Please supply patient population Information here)<h3>-------------Status------------------</h3><p>Status <?php echo "default" ?><p>New Status <input type="text" name"status" ></p>...so when a button is clicked elsewhere it creates an instance of this form and gives it the variable (projID) this variable then needs to be accessible in the HTML form.Original plan was <?php class Questionnaire1{ var $ProjID = "hello"; function Questionnaire1($PID){ $this->$ProjID = $PID; }}?> add this at the top. That would allow me to call the class and pass the ProjID. However the projID is not accessible in the form becuase the form is not "in" the class.Sorry for the long postAny help on this situation would be extremely welcomed. Thankyou Quote Link to comment 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.