1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
$('#button1').click(function() {
var prefix = $('#prefix').val();
if ((prefix >= 65512) && (prefix <= 65535))
{
alert('Please select a public ASN.');
history.back();
}
else if ((prefix < 1) || (prefix > 65535))
{
alert('Invalid ASN.');
history.back();
}
else // à partir d'ici je le code ne fonctionne pas
{ <?php
$as_selected = $_POST['prefix'];
$chercher = mysql_query("SELECT Number_of_Prefixes from Route_Per_AS where AS_num='".$as_selected."'");
while($donnees2 = mysql_fetch_array($chercher)) {
$nb = intval($donnees2["Number_of_Prefixes"]); }
?>
var final = "<?php echo $nb; ?>";
if (final != null)
{
$('#result').html(final);
}
else
{
alert('No data currently available for this AS.');
history.back();
}
}
}); |