Jump to content

DigitalMind

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

DigitalMind's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. show full script
  2. Of course if(isset($_SESSION["username"])){ is false. You've missed out session_start();!
  3. http://www.php.net/manual/en/language.types.string.php show whole script
  4. elseif ($_SESSION["username"] == $_GET["changeinfo"]) { $sql = mysql_query("SELECT * FROM userinfo WHERE username='" . $_SESSION["username"] . "'"); while($row = mysql_fetch_array($sql)) { echo '<form method="POST" action="members.php?uname&changeinfo="' . $_SESSION["username"] . '">'; echo '<input type="text" name="name" value="' . $row["firstname"] . '">'; echo '<input type="submit" value="Change">'; echo '</form>'; $firstname = $_POST["name"]; mysql_query("UPDATE userinfo SET firstname='$firstname' WHERE username='" . $_SESSION["username"] . "'"); } }
  5. yes but after session_start();
  6. you're welcome! i hope it helped you
  7. $uname = isset($_GET['uname']) ? $_GET['uname'] : 'guest'; means if (isset($_GET['uname'])) { // if uname variable is supplied by the GET request $uname = $_GET['uname']; } else { $uname = 'guest'; // if uname was not supplied we set it to 'guest' } after that you should use ... $_SESSION['username'] == $uname (instead of $_GET['uname'])
  8. you're welcome! use isset() in a separate if () at the beginning like $uname = isset($_GET['uname']) ? $_GET['uname'] : 'guest'; (after that use $uname instead of $_GET['uname'])
  9. ($_SESSION["username"] == isset($_GET["uname"])) that's wrong. isset returns just TRUE or FALSE. remove isset() from this part of your code.
  10. or <?php if (isset($_POST['password']) && $_POST['password] == $pass) { header('Location: passed.php'); } ?> your html code
  11. or <?php if (!isset($_POST['password'])) { echo $your_html_form; } else { if ($_POST['password] == $pass) { echo "good"; } else { echo "bad"; } } ?>
  12. <?php ... if (isset($_POST['password']) && $_POST['password] == $pass) { echo "good"; } else { echo "bad"; } ?>
  13. You have a lot of html code (that's also output) before the php tag. in your case it should be: <?php session_start(); ?> html blah-blah-blah.... <?php additional php code ?>
  14. Send local time by JavaScript and set the timezone as a session variable
  15. I don't know what you want but use session_start() before any output
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.