Jump to content

Can a javacript function terminate a php script?


ThunderAI

Recommended Posts

in the php help section there is a topic about preventing direct access to a php file unless it is in an iframe.  in order to tell this i used this function.

 

	<script>
			var youraterrorist

			if (top.location == self.location) {
					alert('your bad');
					document.write('your bad');
					youraterrorist = 1;
				}
				else {
					alert('your good');
					youraterrorist = 0;
				}
		</script>

 

is it possible for the javascript to actally terminate the rest of the file if this test fails?

JavaScript is executed by the web browser after the entire page has loaded.

You could just send them to a different location, but they could easily get around it by disabling JavaScript.

 

If you want to keep someone out of somewhere, use server-side authentication.

 

 

Bruce

JavaScript is executed by the web browser after the entire page has loaded.

You could just send them to a different location, but they could easily get around it by disabling JavaScript.

 

If you want to keep someone out of somewhere, use server-side authentication.

 

 

Bruce

 

Is just checking the value in a session user id ok.  I was able to do that and everything works how i want it to; however, would there be a better way?

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.