Simple Machines Community Forum

General Community => Scripting Help => Aiheen aloitti: stanni - huhtikuu 10, 2008, 10:51:52 AP

Otsikko: Force script refresh
Kirjoitti: stanni - huhtikuu 10, 2008, 10:51:52 AP
Hey guys, I got another quick question :P

Is there a way to MAKE this script refesh everytime that the page is reloaded, because it doesnt seem to be doing unless I close IE and restart it, this casues trouble when I log out and back in again on another account.

Script:
<?php
require_once('/home/r/y/ryanstaniforth/public_html/forum/SSI.php');
echo $x;
echo 'username=' . $context ['user']['name'];
?>

Thnx again
Otsikko: Re: Force script refresh
Kirjoitti: karlbenson - huhtikuu 10, 2008, 10:58:03 AP
try sending these headers at the top of your script and see if it makes any difference

header("Cache-Control: no-cache");
header("Pragma: nocache");
Otsikko: Re: Force script refresh
Kirjoitti: stanni - huhtikuu 10, 2008, 11:02:27 AP
Nope, that stops it from loading the username.
Otsikko: Re: Force script refresh
Kirjoitti: Spaceman-Spiff - huhtikuu 10, 2008, 08:55:18 IP
You have to send the headers before any outputs from the script.