- Joined
- Oct 1, 2021
- Messages
- 91
Rep Bank
$430
$430
User Power: 60%
Bonjour,
So basically there is a problem that accrued recently...
I will try my best to explain it simply and save you time.
If you have experience with it, and you have time to help me, I would absolutely appreciate it!
-------------------------------------------------------------------------------------------
I created a database in phpmyadmin,
I wrote PHP code in connect.php,
I wrote code in signin.html,
I connected them all together.
But still, this shows up:
------------------------------------------------------------------------------------------------
Here is my signin.html code:
<form method="post" action="connect.php">
<label>First Name...</label>
<input type="text" placeholder="" id="firstName" name="firstName">
<label>Last Name...</label>
<input type="text" placeholder="" id="lastName" name="lastName">
<label>Email</label>
<input type="email" placeholder="" id="email" name="email">
<label>Password...</label>
<input type="password" placeholder="" id="password" name="password">
<label>Comfirm Password...</label>
<input type="password" placeholder="">
<input type="submit" value="Submit" name="btn btn-primary">
</form>
----------------------------------------------------------------------------------------
Here is my connect.php code:
<?php
$firstName = filter_input(INPUT_POST, 'firstName');
$lastName = filter_input(INPUT_POST, 'lastName');
$email = filter_input(INPUT_POST, 'email');
$password = filter_input(INPUT_POST, 'password');
if (!empty($firstName)){
if (!empty($lastName)){
if (!empty($email)){
if (!empty($password)){
$host = "localhost";
$dbusername = "root";
$dbpassword = "";
$dbname = "accounts";
// Create connection
$conn = new mysqli ($host, $dbusername, $dbpassword, $dbname);
if (mysqli_connect_error()){
die('Connect Error ('. mysqli_connect_error() .') '
. mysqli_connect_error());
}
else{
$sql = "INSERT INTO registration (firstName, lastName, email, password)
values ('$firstName', '$lastName', '$email', '$password')";
if ($conn->query($sql))}
echo "New record is inserted sucessfully";
}
else{
echo "Error: ".$sql . "<br>". $conn->error;
}
$conn->close();
}
}
else{
echo "Password should not be empty";
die();
}
}
else{
echo "Username should not be empty"
die();
}
?>
-------------------------------------------------------------------------------------------------------
I have watched countless of videos of this problem,
but nothing seems to explain the problem.
I know really little about PHP and databases in general.
Thank you for reading through,
I hope you can help.
If you need more information, please contact me.
So basically there is a problem that accrued recently...
I will try my best to explain it simply and save you time.
If you have experience with it, and you have time to help me, I would absolutely appreciate it!
-------------------------------------------------------------------------------------------
I created a database in phpmyadmin,
I wrote PHP code in connect.php,
I wrote code in signin.html,
I connected them all together.
But still, this shows up:
------------------------------------------------------------------------------------------------
Here is my signin.html code:
<form method="post" action="connect.php">
<label>First Name...</label>
<input type="text" placeholder="" id="firstName" name="firstName">
<label>Last Name...</label>
<input type="text" placeholder="" id="lastName" name="lastName">
<label>Email</label>
<input type="email" placeholder="" id="email" name="email">
<label>Password...</label>
<input type="password" placeholder="" id="password" name="password">
<label>Comfirm Password...</label>
<input type="password" placeholder="">
<input type="submit" value="Submit" name="btn btn-primary">
</form>
----------------------------------------------------------------------------------------
Here is my connect.php code:
<?php
$firstName = filter_input(INPUT_POST, 'firstName');
$lastName = filter_input(INPUT_POST, 'lastName');
$email = filter_input(INPUT_POST, 'email');
$password = filter_input(INPUT_POST, 'password');
if (!empty($firstName)){
if (!empty($lastName)){
if (!empty($email)){
if (!empty($password)){
$host = "localhost";
$dbusername = "root";
$dbpassword = "";
$dbname = "accounts";
// Create connection
$conn = new mysqli ($host, $dbusername, $dbpassword, $dbname);
if (mysqli_connect_error()){
die('Connect Error ('. mysqli_connect_error() .') '
. mysqli_connect_error());
}
else{
$sql = "INSERT INTO registration (firstName, lastName, email, password)
values ('$firstName', '$lastName', '$email', '$password')";
if ($conn->query($sql))}
echo "New record is inserted sucessfully";
}
else{
echo "Error: ".$sql . "<br>". $conn->error;
}
$conn->close();
}
}
else{
echo "Password should not be empty";
die();
}
}
else{
echo "Username should not be empty"
die();
}
?>
-------------------------------------------------------------------------------------------------------
I have watched countless of videos of this problem,
but nothing seems to explain the problem.
I know really little about PHP and databases in general.
Thank you for reading through,
I hope you can help.
If you need more information, please contact me.
Dislike ads? Become a Fastlane member:
Subscribe today and surround yourself with winners and millionaire mentors, not those broke friends who only want to drink beer and play video games. :-)
Access Restricted: Unlock 1,000,000+ Posts
Stop Peeking Through the Keyhole.
Open the Door.
You hit a wall because the best advice isn't free—it's earned. Since 2007, MJ DeMarco has been active here daily (99.9% active rate), building a war room for entrepreneurs who refuse to settle for mediocrity.
- Active Daily: Life-changing content posted dozens of times every day. No dead threads.
- MJ's Inner Circle: Direct access to the author of The Millionaire Fastlane.
- Vetted Network: Connect with founders scaling to 7 and 8 figures.
- Proven Roadmaps: Strategy over motivation. Execution over "hustle porn."
"SCALED TO 6-FIGURE MONTHS"
"Tips and advice here saved me from huge mistakes, others allowed me to scale my business to 6-figure months."— User MitchC
"INSANE QUALITY OF PEOPLE"
"The number of high quality people I've met from this forum has been insane. All of it predicated on building real value."— User Richard Peck
"You are the average of the five people you surround yourself with."
Are you surrounding yourself with success?
