Jump to content

Tokae

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by Tokae

  1. Thank you, That does the job! I was hoping to use a session though so the directories were not listed in URL. Is there a way to just reload the page after setting a session variable? I am just drawing a blank and admittedly not the best with php yet I had my conditional line calling a function if a directory was found: <a href=" <?php ChangeFolder($file) ?>"> directory name here</a> <?php function ChangeFolder($file) { $_SESSION['workingfolder'] = $_SESSION['workingfolder']."/".$file; *** refresh page or reload page here*** } ?> I just cant for the life of me figure out the simple way to reload the page :/ Once again thank you though for your solution..
  2. I have an html table that is being populated with links from a specific directory.. I would like the user to be able to click the link and if its a file they will download the file. If its a directory, I woudl like to reload the current page but this time show the contents of the directory. My main issue is that I have a session variable called 'workingdirectory' that I need to update before I reload the page. I have tried setting it and then calling Location('page.php') but I get the 'cannot change header information' error. I realized I was getting this because I had begun to call HTML code before the PHP was finished. Is there a way to just simply update the session variable, and then make the page reload when the user clicks on a link?
  3. Thank you once again! I will check up on sessions..
  4. Thank you for the quick response! How would you suggest I check to make sure the proper user is still logged in, instead of storing the info in cookies..
  5. Hello all, I am trying to get a simple members.php page to show some HTML but I cannot figure out why it will not display.. <?php mysql_connect("myserver", "myname", "mypass") or die(mysql_error()); mysql_select_db("mydb") or die(mysql_error()); if(isset($_COOKIE['ID_my_site'])) { $username = $_COOKIE['ID_my_site']; $pass = $_COOKIE['Key_my_site']; $check = mysql_query("SELECT * FROM Users WHERE name = '$name'")or die(mysql_error()); while($info = mysql_fetch_array( $check )) { if ($password != $info['password']) { header("Location: login.php"); } else { ?> <html> <body> <h1>WHY</h1> </body> </html> <?php } } } else { header("Location: login.php"); } ?> I was googling and read somewhere that it might be a session bug after the initial '<?php tag'? Any help would be greatly appreciated Tokae
×
×
  • 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.