[Solved] php radio buttons submit form issue

You have to add attribute , ” required ” to all the input fields so that an error message will be displayed when one is empty!! To check if the answer is correct, you can use php! $name=$_GET[“name”]; $email=$_GET[“email”]; $ans=$_GET[“ans”]; if($ans==’correct’){ // you can use mail command here header(“location:correct.php”); }else{ header(“location:incorrect.php”); } solved php radio … Read more

[Solved] How can I save the id of a div tag to a database when clicked and without refresh? [closed]

jQuery, or javascript in general, can’t really connect directly to a database like you are describing. If you have an endpoint to hit, then jQuery (or vanilla javascript, really) could just fire a request to that endpoint with the specific data: $(‘input:file’).on(‘change’, function(event) { $.ajax({ url: ‘/path/to/endpoint’, type: ‘post’, data: { filename: $(this).val() } }); … Read more

[Solved] php username that checks on database “username already taken” [duplicate]

Please use below code to fix your problem <?php if(empty($_POST[‘username’])){ $username_error = “Please Input Username”; }else{ if( 6 > mb_strlen($_POST[‘username’]) || 20 < mb_strlen($_POST[‘username’])){ $username_error = “username must be at least 6 characters.”; }else{ $username = $_POST[‘username’]; $sql = “SELECT members.username FROM members WHERE username=””. $username.”””; $res = mysql_query($sql); if($res && mysql_num_rows($res) > 0){ $username_exists … Read more

[Solved] Populate second select list based on first select list value [duplicate]

you have to get the choice from the url by GET method. <?php include “../areashoppers/includes/cs_functions.php”; $choice = $_GET[‘choice’]; $sql = “SELECT distinct town FROM oic_areas_full WHERE region=’$choice’ ORDER BY town ASC”; $st = $sc_conn->query($sql); while ($r = $st->fetch()) { echo “<option>” . $r[‘town’] . “</option>”; } ?> 3 solved Populate second select list based on … Read more

[Solved] How to reuse a form ( and change its context when needed) to avoid multiple identical forms? C# [closed]

Why do you need a new form class for each country? The idea of a class is that it holds common behaviours. A form is a class. just instantiate an instance of the class with the data that it needs to display. Create a data class to encapsulate the data that the form shows (like … Read more

[Solved] html forms that update in real time [closed]

Something like this, maybe? function addNumbers(){ var input1 = Number(document.getElementById(‘input1’).value); var input2 = Number(document.getElementById(‘input2’).value); document.getElementById(‘output’).value = input1 + input2; } <input type=”text” onkeyup=”addNumbers()” id=”input1″ placeholder=”enter a number”><br /> <input type=”text” onkeyup=”addNumbers()” id=”input2″ placeholder=”enter another number”><br /> <input type=”text” id=”output” disabled> 1 solved html forms that update in real time [closed]

[Solved] php Contact Form Coding Issues [duplicate]

This is because you are using ; in every if statement instead of if { .. } statements try this code <?php if (isset($_POST[‘your_name’])) { $your_name = $_POST[‘your_name’]; } if (isset($_POST[‘your_email’])) { $your_email = $_POST[‘your_email’]; } if (isset($_POST[‘subject’])) { $subject = $_POST[‘subject’]; } if (isset($_POST[‘message’])) { $message = $_POST[‘message’]; } $to = “email.co.uk”; $subject = … Read more