Jump to content

jquery post problem


fxuser

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

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.