Jump to content

Archived

This topic is now archived and is closed to further replies.

IainAdams

Class Help combining HTML

Recommended Posts

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 post

Any help on this situation would be extremely welcomed. Thankyou

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.