Hi i have a php page that return a value:
dbscript.php
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
// Functions
$fname = $_GET['_fname'];
if ($fname=="GetMarkersCount") echo $markersCount = getMarkersCount();
mysql_close($con);
function getMarkersCount() {
$count = 2;
return $count;
}
?>
now i have another php page that i want to get values from a javascript code. how can i get the values from the dbscript.php page if i have to send values to it to retrieve the result.
how can i assgin the result of dbscript.php?_fname=GetMarkersCount to a variable inside a javascript code
jQuery.get()
. api.jquery.com/jQuery.get – deed02392 Mar 21 at 20:18dbscript.php?_fname=GetMarkersCount
, or is that a decision that gets made after the page gets to the browser? – AndrewR Mar 21 at 20:31GetMarkersCount()
function, there's no need for it. – AndrewR Mar 21 at 20:37