1

I created a little DIV in HTML which gets filled by a main_login.php main_login.php loads the homepage with member content on the side if there is a session started If there is no session started, the main_login.php file loads the homepage with loginfields.html on the side

Now whenever loginfields.html is loaded, the button on that page doesnt execute whenever I press it. When I open the localhost/loginfields.html it works like a charm.

What is preventing the login_check.php to load?

1
  • codes are on pastebin. Links are in the opening post Commented May 3, 2012 at 22:49

2 Answers 2

2

I'm going to take a wild guess here, and say that you're loading in main_login.php via AJAX and using innerHTML (or jQuery's html()) to put it into the page. I'm also guessing that your button is powered by a <script> tag.

<script> tags loaded with innerHTML are not executed. You have to either load it in as an external script (even then I'm not sure if innerHTML will load it in), or use proper DOM functions to append the script to the page, or separate the HTML and JavaScript from the response and run the JS through eval.

Sign up to request clarification or add additional context in comments.

3 Comments

yes I am using innerHTML via Ajax but im not using script tags. I used a form.
Have you ran the main_login.php alone to check it read the html file correctly?
Nothing happening. I opened the console on Opera, Firefox and Chrome. Chrome seems to let me login btw, which is odd..
1

If you're simply trying to load loginfields.php into the page, you could just use include('loginfields.php') instead of your fopen() function.

2 Comments

Because he wants to get the text and insert it to a div using innerHTML, its an ajax call.
Ah, I misunderstood. Sorry about that.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.