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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.