Jump to content

a simple way to just reload a current page.


Tokae

Recommended Posts

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?

 

 

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..

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.