Results 1 to 4 of 4

Thread: More PHP Help!

  1. #1
    Join Date
    Apr 2006
    Location
    Salford
    Posts
    2,108
    Tokens
    0

    Latest Awards:

    Default More PHP Help!

    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 Code:
    <?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

  2. #2
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    er meta refresh ? :S

  3. #3
    Join Date
    Apr 2006
    Location
    Salford
    Posts
    2,108
    Tokens
    0

    Latest Awards:

    Default

    [php]<?php if($fetch->userlevel == "4"){
    echo"<meta http-equiv="refresh">mysql_query("UPDATE users SET health='999' WHERE username=$username";} ?> [/php

    ?

  4. #4
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    PHP Code:
    <?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">');

    }
     
    ?>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •