Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to make html work in php
    primarykey
    data
    text
    <p>I am trying to get this PHP code working with my html. The PHP alone work but when im trying to use the html form and use PHP code it does not do anything at all. I've been trying to figure this out but without any success. Can somebody please explain what I am doing wrong?</p> <hr> <pre><code> &lt;?php include_once("config.php"); if(isset($_POST['submit'])){ //Perform the verification $uname = $_POST['uname']; $email = $_POST['email']; $email2 = $_POST['email2']; $pass = $_POST['pass']; $pass2 = $_POST['pass2']; if($email == $email2){ if($pass == $pass2){ //All good. Carry on. $query = $sql-&gt;prepare("INSERT INTO login (uname, email, pass) VALUES (?, ?, ?)"); $query-&gt;bind_param('sss', $uname, $email, $pass ); $query -&gt; execute(); header("Location: index.html"); }else{ echo "Passwords do not match.&lt;br /&gt;"; exit(); } }else{ echo "Emails do not match.&lt;br /&gt;&lt;br /&gt;"; exit(); } $sql-&gt;close(); $query-&gt;close(); } ?&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="UTF-8" /&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt; &lt;link rel="stylesheet" type="text/css" href="css/style.css" /&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="container"&gt; &lt;section&gt; &lt;div id="container_demo" &gt; &lt;a class="hiddenanchor" id="tologin"&gt;&lt;/a&gt; &lt;div id="wrapper"&gt; &lt;div id="login" class="animate form"&gt; &lt;form method="post" action="&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;"&gt; &lt;h1&gt; Sign up &lt;/h1&gt; &lt;p&gt; &lt;label for="usernamesignup" class="uname" data-icon="u"&gt;Username&lt;/label&gt; &lt;input id="usernamesignup" name="usernamesignup" required="required" type="text"/&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="emailsignup" class="email" data-icon="e"&gt; Your email&lt;/label&gt; &lt;input id="emailsignup" name="emailsignup" required="required" type="email"/&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="emailsignup" class="email2" data-icon="e"&gt;Confirm your email&lt;/label&gt; &lt;input id="emailsignup" name="emailsignup" required="required" type="email"/&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="passwordsignup" class="pass" data-icon="p"&gt;Your password &lt;/label&gt; &lt;input id="passwordsignup" name="passwordsignup" required="required" type="password"/&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="passwordsignup_confirm" class="pass2" data-icon="p"&gt;Please confirm your password &lt;/label&gt; &lt;input id="passwordsignup_confirm" name="passwordsignup_confirm" required="required" type="password"/&gt; &lt;/p&gt; &lt;p class="signin button"&gt; &lt;input type="submit" value="Sign up"/&gt; &lt;/p&gt; &lt;p class="change_link"&gt; Already a member ? &lt;a href="index.html" class="to_register"&gt; Go and log in &lt;/a&gt; &lt;/p&gt; &lt;/form&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/section&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload