0

I am working with several different php pages and php scripts.

For example I have the page index.php

The user can click on the link script_page.php?id=415354 on the index.php page, and the script_page.php page will check for the id and using some other scripts to verify access it will forward to employees.php using:

die(header("Location: employees.php"));

Sometimes if I click too fast or click twice, the script_page.php will stop running and never make it to employees.php

What could cause this to be happening or how could I prevent this from happening?

Thank you for your assistance.

I am using IIS7 and PHP5

4
  • Not the solution to your problem, but you should change the code to header("Location: employees.php"); die(); the form you use doesn't make sense, as header() won't return a value. Commented Oct 12, 2010 at 21:41
  • When you say "too fast", do you literally mean you click too fast on the script_page.php?id=415354 link?! How do you know script_page.php stops running? Are you sure it's even getting to script_page.php? Is it possible the request is being cancelled? Commented Oct 12, 2010 at 21:56
  • That's a good question. My browser stops at: www.my-site.com/script_page.php?id=415354. It's a blank page. I am not really sure what is happening. Commented Oct 12, 2010 at 22:02
  • All browsers? Have you checked your server error logs? Commented Oct 13, 2010 at 16:21

1 Answer 1

1

Try separating those two commands:

header("Location: employees.php");
die();
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks poke, I really appreciate your help. I separated the header and die functions. If I click really fast I can get the script_page.php to stop and not execute anything. It only seems to happen in Firefox.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.