Help with navigation site

Hey guys I’am new to this and i have idea how to do my counter strike web site :slight_smile: got some design at the moment and im gonna try to explain to you what i want to do so :slight_smile: .

The picture with my design:
http://s16.postimg.org/pw6f19511/image.jpg

to include another web pages only into black space . At the moment when u are in HOME PAGE in the black space its shown stats.php … but how to make it when i click to NEWS to show me news.php whithout changing the page ?

Sorry for my stupid explanation :slight_smile:

There are many ways to do this. Many are insecure. One easy way is to use AJAX. You can load a

tag
with an external page using JQuery/AJAX. It basically allows you to load any external PHP file into any place on
your current page. In the external PHP code, you can access your database or do anything else you normally do
in a PHP file. You can pass items to the PHP file as posted data. Here is a sample I found on Stackoverflow that
gives you the basics… Hope that helps…

[php]
var somevariable = 1; // data sent to externalPHP file
$(’#my_div’).html(‘Downloading…’); // Show “Downloading…” if your external file is large
// Do an ajax request
$.ajax({
url: “externalpage.php?somevariable=”+somevariable
}).done(function(mydata) { // data what is sent back by the php page (mydata is a variable holding output)
$(’#my_div’).html(mydata); // display data
});
[/php]
This is just a sample. You can place it into the code section for a button, have it processed when a drop-down
changes or just about anything…

A note on security: Since Javascript/JQuery/AJAX is client-side code, it is in your browser. This means that
someone can view-source of the page and see this code. Therefore, you should place some security into the
external page to check that the request came from the original page and not an outside page. This would be
a way to protect the code from being hacked. Hope that makes sense!

Sponsor our Newsletter | Privacy Policy | Terms of Service