Here's part of the code:
$sql = mysql_query($query);
$recResult = mysql_fetch_array($sql);
$existID = $recResult["uniqueID"];
if($existID=="") {
->POPUP HERE CONFIRMATION DIALOGUE "It doesnt exists, add new?"
} else {
->POPUP HERE CONFIRMATION DIALOGUE it already exists, wright over old data?
}
As PHP is running on the server side, there is no direct way to display some dialog to the user.
You need to generate a piece of user interface using HTML / CSS / Javascript that enables your user to execute the desired steps.
A very simple example could be
<?php
$sql = mysql_query($query);
$recResult = mysql_fetch_array($sql);
$existID = $recResult["uniqueID"];
if($existID=="") { ?>
<a href="your_app.php?create=1">
It doesn't exist, click to add new
</a>
<?php
} else { ?>
<a href="your_app.php?id<?php echo $existID; ?>=&overwrite=1">
It exists, click to overwrite
</a>
<?php
}
This will render a link in the HTML result, which your user can choose to open.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.