Jump to content

Class Help combining HTML


IainAdams

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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.