Urgent help needed with php code issue

I am in need of some help with a coding issue as i am unable to proceed with my project and i was wondering if youd be able to help me?

As seen below i have copied the exact code from your video and its still coming up with an error message saying i have an undefined array key “email” whilst trying to run the signin.php page,

would really appreciate some help with this as i have been stuck trying to trouble shoot this for over a week.

Thank you for your time,

I think your post is missing crucial infos, like what is your code, what is the video you are talking about, what errors you are getting etc

1 Like

im getting an error message about an undefined array in my code but im sure i have done it all correctly, i will try and send over some screenshots and the video i refer to in an hour or so once i have access to the workstation again, thank you

Please send your actual code instead of screenshots of the code!

1 Like

here’s the code from my account.php page:

		<!-- Login Form -->
		<div class="p-4">
			<form action="./signin" method="post" id="signin">
				<div class="form-outline mb-4">
					<input type="email" name="email" id="emailInput" class="form-control" />
					<label class="form-label" for="emailInput">Cyfeiriad Ebost</label>
				</div>
		</div>
		<div class="p-4">
		<div class="form-outline mb-4">
					<input type="password" name"password" id="passwordInput" class="form-control" />
					<label class="form-label" for="passwordInput"> Cyfrinair</label>
				</div>
				<input type="submit" class="btn btn-primary btn-block mb-4" />
			</form>
			<div class="row">
				<div class="text-center">
					<a href="forgotPassword.php">Wedi anghofio cyfrinair?</a>
					<p>Ddim yn aelod?<a href="./register.php">Cofrestru</a></p>
				</div>
			</div>
		</div>
		<!-- End of Login Form -->

here’s the code from my connection.php page:

<?php
//this is my server address
$server = "localhost";
//this is my SQL username
$user = "macsen";
//this is my SQL password
$password = "root";
//this is my SQL database
$db = "stadiumtours4youreal";

//this is a conection to my database in SQL
$connection = new mysqli($server,$user,$password,$db);

if($connection->connect_error)
{
	die("Connection Failed".$connection->connect_error);
}
?>

here's the code from my signin.php page:
<?php
session_start();
include 'config/connection.php';

print_r($_POST['email']);

and heres a screenshot of the error:

Hi,
Your links don’t work and screenshots are also not shown here.
I think the problem is with your form.
You seem to have one input and the name attribute is = “password”. But then you are printing out the email which is nowhere to be found here.

This is because you don’t have any input tag with name = "email" .

Can you share the complete code of what your form looks like?

And what video are you following for this project?

im following a video by ‘James Jones’ it a series of videos for an a level course, i have tried to paste the url below but it says im unable to share with this host?

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

Okay, so i checked your code and it works for me.
Just make sure to correct this part:

it should be name="password".
And also, you will only recieve that error if you go the signin.php page without submitting the form.
Right now, if you submit the form in the login page you will be redirected to the signin.php page without recieving any errors.
Hope this helps