Hi
I've read through the posting regarding 'actions on a link' but as my function is not in javascript I didn't want to confuse the conversation.
I was wondering how/if it is possible to call a function from a text link, button, image etc via something like this:
<?php if (isset($_POST["condo_nm"]))
echo condoavailable($_POST["condo_nm"]) ;?>
The actuaal function is this:
function condoavailable($condo_nm)
{
// Connect to the database
require_once ('myaccess/dbc.php');
// Make sure a review doesn't already exist for this Condo
$query = "SELECT * FROM condo_reviews WHERE condo_nm = '$condo_nm'";
$data = mysqli_query($dbc, $query);
if (mysqli_num_rows($data) == 0)
{
echo 'Available';
}
else {
echo 'Review Complete';
}
}
}
What I'm trying to do is allow users to check to see whether a review has already been submitted for a particular name and if it has echo back to the screen: 'Review Complete' and if it does not exist echo to the screen 'Available'.
I just want users to be able to do this check before clicking on the 'submit' button at the end of the form.
Is there a way?
Mamy thanks