Jangga
Junior Member
- Aug 8, 2016
- 196
- 11
Hello guys, I'm stuck here. I only want to check a cell in my db and if empty, there should be a prompt for user to input the detail. I want to collect the detail and store in the cell in my db. Well, it's been like I'm missing things up in my code. Please, see Wat I've got already & pls pls pls assist me. I'm ur girl....
Code:
<?
if ($_POST) {
$userdata =isset($_POST["reason"]);
//I will write a code here to store $userdata in sql db
if($rname==empty()){
echo"<a href=\"order.php\" class=\" btn btn-primary btn-lg\" onclick=\"yourname()\"> Take lectures</a>";
}
?>
<script>
function yourname() {
var fname = prompt("Input Your Full Name");
if (fname != null) {
document.getElementById("reason").value = reason; document.getElementById("form").submit(); }
<form method="post" id="form"> <input type="hidden" id="reason" /> </form>
}
</script>
Last edited: