My index page (index.php?profile=profilename_here) loads content into a div using jQuery's load()
function in the normal fashion and all is working fine.
$().ready(function() {
$('#details').load('pages/sidebar/details.php?profile=<?PHP echo $profile;?>').fadeIn(2000);
});
then in my pages/sidebar/details.php I have MySQL queries.
$result = mysql_query("SELECT * FROM public_profile WHERE username='$profile'") or die(mysql_error());
All the php stuff is secure and I am sanitising all varibales as I should be.... but if someone was to go to 'pages/sidebar/details.php?profile=' and change the profile name they will be bringing up other peoples details.
Is it possible to check if the page was loaded by .load()
and if not, to stop the page from loading or scripts from executing?