Using Ajax i have a index.php page displaying output from response.php page.
I have an admin section in an admin folder.
admin\index.php also using ajax to display results form admin\response.php.
I want to be able to pass 'commands' from the admin\response.php to response.php so i thought i would use cURL for the first time.
within admin\response.php
Code: Select all
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,'http://localhost/IPOfficeConfigurator/response.php?command=LOAD_CONFIG&data1='.$data1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$buffer = curl_exec($ch);
curl_close($ch);
Code: Select all
@$command=addslashes($_GET["command"]);
@$data1=addslashes($_GET["data1"]);
switch ($command){
case "LOAD_CONFIG":
$_SESSION['header_display']->set_load_config($data1);
$_SESSION['ipo']->check_capacity();
$fil = @fopen('test.txt', w);
@fwrite($fil, $data1."\r\n");
@fclose($fil);
break;
}
If i were to within admin\index.php output the curl result then yeah i can actually see the change being effected to $_SESSION['header_display']. But from index.php $_SESSION['header_display'] isnt altering.
What am i missing?
ps: i hope ive written my question out well enough to follow.