Jump to content

justAnoob

Members
  • Posts

    561
  • Joined

  • Last visited

    Never

Everything posted by justAnoob

  1. Well, good question. Guess I have some more work to do. LoL.
  2. Should there be a ";" at the end of the line that is marked below? Or are there other mistakes? <?php $host = "----------"; $username = "-------------"; $password = "-------------"; $db_name = "msimages"; $tbl_name = "UploadedFiles"; mysql_connect("$host", "$username", "$password") or die("Could not connect."); mysql_select_db("$db_name") or die("Could not find database"); if (!empty($_POST['upload'])) { foreach($_POST as $key => $value) { $$key = $value; } $connect->connect_db(mydatabase); // <----this line ??? if(isset($_POST['upload']) && $_FILES['upload_file']['size'] > 0) { $fileName = $_FILES['upload_file']['name']; $tmpName = $_FILES['upload_file']['tmp_name']; $fileSize = $_FILES['upload_file']['size']; $fileType = $_FILES['upload_file']['type']; $fp= fopen($tmpName, 'r'); $content = addslashes($content); fclose($fp); } if(!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); } $query = "INSERT INTO UploadedFiles (name, size, type, content)VALUES('$fileName', '$fileSize', '$fileType', '$content')"; $result = mysql_query($query); if (!$result) { dberror (mysql_error(), $_SERVER['PHP_SELF'] ); echo mysql_error(); } header("Location: ------------.com"); exit; } ?>
  3. Well gevans, I'm not sure if you were trying to tell me this, but I found something that works.(so far) I put this on the top of my page. <?php session_start(); if(isset($_SESSION['auth'])) { echo '<div id="reguser"><img src="------/------.png" alt="home" width="32" height="32" /></div>'; } ?> And then also I just positioned my div on the page where I wanted it and just kept it empty, like this <div id="reguser"></div> Maybe that is what you were explaining. Well anyways, maybe this can help someone else out in the future. Thanks again fellow PHPers. Oh yeh, the div name I changed after everything was working ok. That did not play a part with this not working, just to let everyone know.
  4. Thank you for the help on this. But wouldn't I also need to hide this div before I check for authentication to display it. Right now with that code, it is telling me to display the div and then if the user is authenticated, continue to display it. Right?
  5. Hi everyone. I am trying to hide a div until someone is authenticated on my page. This is what I have so far. Oh,, by the way, it doesn't work. LoL. <div id="admin"><img src="--------/---------.png" alt="admin" width="28" height="32" /> <?php session_start(); if(isset($_SESSION['auth'])) { echo <div id="admin">; } ?> </div>
  6. Sorry guys and gals. I figured it out. An obvious noob mistake. My header location was not set to the correct url. Thanks for the help though.
  7. All it shows is the session message. There is no text there for the logout link.
  8. My session message will display properly. The logout link does not display. There are no errors also.
  9. I'm having a difficult time putting these two together echo $_SESSION['message']; and <a href="logout.php">Log out</a> I would like to have the log out link echo with the session message. Anyone?
×
×
  • 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.