Jump to content

Basic Code


Drezard

Recommended Posts

So I have 4 files all up. index.php contains the code that the end-user will see. engine.js contains the code for the AJAX request function. pagea.php and pageb.php contains the code i want it to display. Now, I have written most of the code, I just don't know how to form the basics of the engine.js. WITHOUT all the error correcting and checking if this and that is enabled, what should engine.js look like if when the user clicks the 'pagea' link it displays the php script from pagea.php in it and same except for pageb?

 

Heres what the code looks like:

index.php:

<html>

<head>
    
    	<script src='engine.js' type='text/javascript'> </script>
        
    </head>
    
    <body>
    
    	<div id='main'> </div>
        
        <a href="javascript: AjaxRequest('pagea.php')">PageA</a>
        <a href="javascript: AjaxRequest('pageb.php')">PageB</a>
    
    </body>
    
</html>

 

engine.js:

function AjaxRequest(page) {



}

 

pagea.php

<?php

echo "This is page a";

?>

 

pageb.php

<?php

echo "This is page a";

?>

 

Could you please help?

 

Thanks, Daniel

Link to comment
https://forums.phpfreaks.com/topic/96673-basic-code/
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.