Jump to content

Recommended Posts

Hello,

 

This is my javascript code:

$(document).ready(function(){
	$('#upd').submit(function() {
		 $.post('php.php', $('#upd').serialize(), function(data) {
			$('#error').html(data).show();
			if ($('#thinupd').val() > 3){
				$('#act').fadeOut('slow').load('includes/my_activity.include.php').fadeIn('slow');
			}
		 });
		return false;
	});
});

 

so i have 2 questions...

 

how can i secure the pages php.php and my included file above so when i go directly to disable the users to run the code by going to the url of the file?

also i do a check so if the thinupd input has more than 3 characters it will fadeout , load the included file and fadein .. which does not work.. it does work if i dont put an if statement...

 

For the page secure i figured this out which doesnt not seem to work pretty well:

if(!defined("MAIN")){

die('<tt>You cannot view this file directly!</tt>');

}

 

if  i put the above code to an included file i cant see it directly but if i try this code on the above included file i will get the "You cannot view this file directly!" inside the div i am fadingout and in ...

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/223811-jquery-post-problem/
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.