Hey Guys,
I have a strange issue that is going on here, and I am missing it. Let me lay down the example:
I have an index.php:
PHP Code:
$postdata = isset($_POST['sysinfo']) ? $_POST['sysinfo'] : include('javascript.php');
echo "Returned from Javascript :".$postdata."<br /><br />";
Basically this is testing POST['sysinfo'], if it is set, then it will equal the value and then it should display the results with the echo, if not it should include the javascript.php file.
javascript.php:
Code:
<script type="text/javascript" src="js/jquery.js"></script>
$.post("index.php", { sysinfo: 'HELLO WORLD'});
This file should load jquery, and send POST back to the index.php with sysinfo='HELLO WORLD'
Using Firebug, I see the POST data is this:
Returned from Javascript :HELLO WORLD<br /><br />
and the screen is blank, so basically it sent the POST back to the PHP file, although it is placing all of the file in POST, instead of just displaying it. Can someone point me in the direction of what I am doing wrong?
Thanks,
Jeff