Click here to Skip to main content
15,868,002 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am creating a forum website and when the user signs up i want the users information to go into the databases table but i cant find a way to do it . i tried various ways like youtube tutorials and other forums but nothing is helping me . i even tried tutorials from websites tat give you the code , but nothing helps. Can someone help me with code or an error i have ? I would appreciate it a lot. This is my register.php file :


XML
<?php
include('db.php');


?>
<html>
<head>
<title>InterFace</title>
<link rel="stylesheet" type="text/css" href="css.css" >
</head>
<body bgcolor="#E6E6FA">

<nav>
    <div id="logo">
    <h1> InterFace</h1>
    </div>
</nav>

<form action="" method="POST">
  <p align="right"><input type="text" name="firstname" size="35" id="First Name" placeholder="First Name" /></p>
  <br></br>
  <p align="right"><input type="text" name="lastname" size="35" id="Last Name"  placeholder="Last Name" /></p>
    <br></br>
  <p align="right"><input type="text" name="username" size="35" id="Username" placeholder="User Name" /></p>
    <br></br>
  <p align="right"><input type="password" name="password" size="35"  id="Password" placeholder="Password" /></p>
    <br></br>
  <p align="right"><input type="password" name="password2" size="35"  id="Password2" placeholder="Confirm Password" /></p>
    <br></br>
  <p align="right"><input type="text" name="email" size="35"  id="Email" placeholder="E-mail" /></p>
  <br></br>
  <p align="right"><input type="text" name="email2" size="35"  id="Email2" placeholder="E-mail confirm" /></p>
  <p align="right"><input type="submit" name="reg" value="Submit"></p>
</form>

</body>
</html>



This is my database connection file :


PHP
<?php

$mysqli_hostname = "127.0.0.1";
$mysqli_username = "root";
$mysqli_password = "";
$mysqli_database = "interface";

$db = mysqli_connect ($mysqli_hostname, $mysqli_username, $mysqli_password)
or die("Something is broken") ;

?>
Posted

1 solution

Even though you wrote that you have tried tutorials, I'd suggest going through some, step-by-step. Don't try to solve ever aspect at once but follow the steps of the examples.

For example start from http://www.w3schools.com/php/php_mysql_connect.asp[^] and go through each page...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900