Jump to content

[SOLVED] My code stops executing, but there are no errors posted!


macattack

Recommended Posts

I am building a simple login script that will work with a MySQL database to allow administrator access to the site. For some reason the script stops executing immediately after the title.

 

As I am currently still working on the site, error_reporting() is set to e_all and no errors come up.

 

Here is the code:

 

<?php
include ("header.php");
?>

<h2 class='center'>Administrator Login</h2><br/>

<h3>
<form action="admin_login.php?login='yes' method='POST'>
Username: <input type='text' name='login'><br/>
Password: <input type='password' name='pass'><br/>
<input type='submit' value='Login'><br/>
</form>
</h3>

<?php
include ("footer.php");
?>

 

Everything up until the <form> tags comes up just fine. After that, the page is blank. The form does not display either. This same template is used on every single page and works just fine everywhere else.

 

If anyone has an idea that may lead to a solution that would be great. Thanks in advance!

Load your page and look at the source-code.

You have a little mess with quotes.

 

use double Quotes (") for html-attributes, as

<h2 class="center">

and not single one (')

 

If this is XHTML you must use double-quotes.

 

Your problem right now is the following line:

<form action="admin_login.php?login='yes' method='POST'>

Can you see, that you closed the quote? I can't.

That was it! It actually solved an older problem with another code that I had left to die too. It's weird that such a simple mistake slipped by. Must be something to do with the fact that it's the morning after Christmas.

 

Thank you for your help.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.