Print (" if (Confirm(\" blah blah blah
Posted: Mon Dec 09, 2002 10:20 am
Is it possible to combine php with dynamic javascript. Or do i need a rethink?
If an entered name is already on the databse, then i want to make the user aware of this and give them the option not to input the data. I have left this verification until after the input form has been submitted.
Many thanks for help and advice in advance.
// checks if the name is already in the database. If it is already there then
// it return how many times.
$NameExists = VerifyName($FName,$LName);
if ($NameExists >=1):
print(" <SCRIPT LANGUAGE=\"JavaScript\"> ");
print(" if (confirm(\" $NAME already exists in the database $NameExists
times Do you wish to continue?\")){ ");
print(" </script> ");
echo "<font face=Arial size=+0 color=\"#CC0000\"><b>$NAME has
been added to the database</b></font><br>";
AddContact($FName,$LName,$Spd,$Mbl,$E_M,$WPhone,
$Department,$JTitle,$EasyList);
print(" <SCRIPT LANGUAGE=\"JavaScript\"> ");
print(" }</script> ");
else:
echo "<font face=Arial size=+0 color=\"#CC0000\"><b>$NAME has
been added to the database</b></font><br>";
AddContacts($FName,$LName,$Spd,$Mbl,$E_M,$WPhone,
$Department,$JTitle,$EasyList);
endif;
If an entered name is already on the databse, then i want to make the user aware of this and give them the option not to input the data. I have left this verification until after the input form has been submitted.
Many thanks for help and advice in advance.
// checks if the name is already in the database. If it is already there then
// it return how many times.
$NameExists = VerifyName($FName,$LName);
if ($NameExists >=1):
print(" <SCRIPT LANGUAGE=\"JavaScript\"> ");
print(" if (confirm(\" $NAME already exists in the database $NameExists
times Do you wish to continue?\")){ ");
print(" </script> ");
echo "<font face=Arial size=+0 color=\"#CC0000\"><b>$NAME has
been added to the database</b></font><br>";
AddContact($FName,$LName,$Spd,$Mbl,$E_M,$WPhone,
$Department,$JTitle,$EasyList);
print(" <SCRIPT LANGUAGE=\"JavaScript\"> ");
print(" }</script> ");
else:
echo "<font face=Arial size=+0 color=\"#CC0000\"><b>$NAME has
been added to the database</b></font><br>";
AddContacts($FName,$LName,$Spd,$Mbl,$E_M,$WPhone,
$Department,$JTitle,$EasyList);
endif;