I need a div on my site to auto refresh every two minutes or so, and I found this code which works.
<script>
var auto_refresh = setInterval(
function()
{
$('#mydiv').load('urltocontent.php').fadeIn("slow");
}, 10000);
</script>
And then I simply have a <div id="mydiv"></div>
While this works fine, I was wondering if it's possible for me to hide where the file location is at? I don't want people to be able to access urltocontent.php which can be seen when they view my source.
Is there a way to only refresh the div? (Not having to add load('urltocontent.php').) inside.
Hope to hear from you soon! Thanks!
Hey guys! Thanks for all your quick replies! I apologize for my stupid questions...
I tried Kiren Siva's method, it prevents users from directly accessing the site, but now my first load will show a 'bad request'.
The main reason I was hoping I could hide it was so it would be more 'professional'. Since it links to one of my template folders and I have other parts of my site stored in that folder. I also don't want curious people to visit that page and get greeted by an ugly un-cssed page.