$_Post and function()
Posted: Tue Jul 20, 2010 9:12 am
Is it possible to use $_POST to pass information into a function?
e.g. on page 1 I have a form which passes the value 'DBSchema' when the box is ticked.
On page 2 I then pick that up using
This all works fine on various pages I have designed. However I now want to incorporate it into a function, e.g:
so I was wondering if it was possible (as so far it doesn't seem to work).
e.g. on page 1 I have a form which passes the value 'DBSchema' when the box is ticked.
On page 2 I then pick that up using
Code: Select all
if (isset($_POST['DBSchema'])) {
$db = $_POST['DBSchema'];
} else {
$db = "Database Not Set"; }
Code: Select all
function fQuery() {
if (isset($_POST['DBSchema'])) {
$db = $_POST['DBSchema'];
} else {
$db = "Database Not Set"; }
}
<Body>
<p><?php fquery() ?></p>
</body>