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:
// Connect to the database
// 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 '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?
1 Year Ago
Related Article:Functions is php
is a PHP discussion thread by rotten69 that has 6 replies, was last updated 7 months ago and has been tagged with the keywords: functions.
You can only run a php function whilst the page is being generated - it is a server side script.