PDA

View Full Version : More PHP Help!



Assassinator
17-09-2007, 03:06 PM
Ok i want it so when my userlevel 1 refresh's the page it set's there health to 999, ive done the php and query but how do i go about doing the refresh bit?


<?php if($fetch->userlevel == "1"){
echo"mysql_query("UPDATE users SET health='999' WHERE username='$username");";} ?>
What i need is when they refresh the page it does that, thanks;)

Jackboy
17-09-2007, 03:13 PM
er meta refresh ? :S

Assassinator
17-09-2007, 03:19 PM
[php]<?php if($fetch->userlevel == "4"){
echo"<meta http-equiv="refresh">mysql_query("UPDATE users SET health='999' WHERE username=$username";} ?> [/php

?

Invent
17-09-2007, 09:11 PM
<?php

if($fetch->userlevel == "1")
{
mysql_query("UPDATE `users` SET `health` = '999' WHERE `username` = '$username'");

/* only do this if no other data is outputted to the browser above this line */
header("location: page.php");

/* do this if data HAS been outputted */
echo('<meta http-equiv="refresh" content="0; URL=page.php">');

}
?>

Want to hide these adverts? Register an account for free!