Jump to content

akshay1234

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

akshay1234's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. and if it helps... Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1 MySQL client version: mysqlnd 5.0.7-dev - 091210 - $Revision: 304625 $
  2. i'm trying to send across a very simple query to mysql through php, but cannot get the variables to work. the php error i receive is "Parse error: syntax error, unexpected T_VARIABLE in C:\Program Files\XAMPP\xampp\htdocs\oauth\login\checklogin.php on line 20" i'm trying to update a field named "last_accessed" in the table. i have the connection down, and the database is all set. // time to update timestamp of LAST ACCESSED $timestamp = date("l F d, Y, h:i A"); mysql_query("UPDATE members SET last_accessed = "$timestamp" WHERE myusername = "$mygivenusername" AND mypassword = "$mygivenpassword""); earlier on in the code, $mygivenusername and $mygivenpassword are defined through a POST form. that works ok. btw the mysql_query line is line #20. thanks (:
  3. ok, i redid the code ( a little bit ) this one returns unexpected T_else in line 29. <?php $jscript = "<script type=\"text/javascript\"> <!-- if (self != top){ top.location.href = self.location;href; } //--></script>"; if(isset($_COOKIE["LOGIN"])){ echo $jscript; } if(isset($_GET['browse'])){ $key = 'myencryptionkey'; $string = $_COOKIE['LOGIN']; $decrypted_username = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($string), MCRYPT_MODE_CBC, md5(md5($key))), "\0"); $dir = "/oauth/files/".$decrypted_username; scandir($dir); echo "To upload new files, click <a href=\"account.php?upload\">here</a>."; } else { $key = 'myencryptionkey'; $string = $_COOKIE['LOGIN']; $decrypted_username = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($string), MCRYPT_MODE_CBC, md5(md5($key))), "\0"); include("/oauth/accounts/$decrypted_username.html"); exit; } else // line 29 is this line { header('Location: /login.html'); } exit; ?> thank you any help is appreciated
  4. scandir("/oauth/files/".$decrypted_username.); is line 18 here is my full code: <?php if(isset($_COOKIE["LOGIN"])) { $key = 'my_key'; $string = $_COOKIE['LOGIN']; $decrypted_username = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($string), MCRYPT_MODE_CBC, md5(md5($key))), "\0"); include("/oauth/accounts/$decrypted_username.html"); echo "<script type=\"text/javascript\"> <!-- if (self != top){ top.location.href = self.location;href; } //--></script>"; } if(isset($_GET['browse'])){ $key = 'my_key'; $string = $_COOKIE['LOGIN']; $decrypted_username = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($string), MCRYPT_MODE_CBC, md5(md5($key))), "\0"); scandir("/oauth/files/".$decrypted_username.); echo "To upload new files, click <a href=\"account.php?upload\">here</a>."; exit; }else{ header('Location: /login.html'); } exit; ?>
  5. Parse error: syntax error, unexpected ')' in C:\Program Files\XAMPP\xampp\htdocs\account.php on line 18 shows up
  6. but now, when someone is logged in, and goes to account.php, and it shows you the content of /oauth/accounts/$decrypted_username.html (line 7 of the code). it also displays Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\XAMPP\xampp\htdocs\oauth\accounts\akshay.html:1) in C:\Program Files\XAMPP\xampp\htdocs\account.php on line 27 when someone goes to account.php?browse, it shows you /oauth/accounts/$decrypted_username.html (line 7 of the code), AND asks you if you want to upload files (line 25). no sign of the scandir...
  7. the following file is /account.php it returns Parse error: syntax error, unexpected T_ELSE in C:\Program Files\XAMPP\xampp\htdocs\account.php on line 26 basically, when someone without the login cookie navigates here, they should be redirected to login.php. can anyone help me? <?php if(isset($_COOKIE["LOGIN"])); { $key = 'MY_WORKING_KEY_WHICH_DOES_WORK'; $string = ($_COOKIE['LOGIN']); $decrypted_username = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($string), MCRYPT_MODE_CBC, md5(md5($key))), "\0"); include("/oauth/accounts/$decrypted_username.html"); echo "<script type=\"text/javascript\"> <!-- if (self != top) { top.location.href = self.location;href; } //--> </script>"; } if(isset($_GET['browse'])); { $key = 'MY_WORKING_KEY WHICH DOES WORK'; $string = ($_COOKIE['LOGIN']); $decrypted_username = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($string), MCRYPT_MODE_CBC, md5(md5($key))), "\0"); scandir("/oauth/files/$decrypted_username"); echo "To upload new files, click <a href=\"account.php?upload\">here</a>."; }else{ header('Location: /login.html'); } exit; ?>
×
×
  • 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.