Jump to content

roadhog481

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

roadhog481's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. in the function above, does it execute before the folderchange?
  2. Thanks, but how do i get it to open the folder and do this before it goes into it. I have already tried to do something like this onclick event but i can seem to get it to work. [code] <?php function myfunction(){ echo("<strong>I love PHP !</strong><br>"); } ?> <a href="<?php echo("$PHP_SELF?execute=myfunction")?>">click to execute myfunction ! </a> <p> <?php if ( isset($execute) ){ myfunction(); } ?>[/code] thanks
  3. Hi, I’m working on my company's intranet and creating a "live directory". All that means is that all of the departments have a separate directory that they can throw files into and I create a virtual directory off the "intranet" web server (IIS 5/PHP 4.4.2) to that folder/index.php. All the script does is read the directories and creates list items for them then it reads the files, excludes a few and creates another set of list items, the style sheet comes in after that. It is a work in progress and is growing as I learn how to do more things. The problem is that my users are too dumb to copy an index.php file to the new sub directory they've just created, so I was looking for a way I could have a function that upon clicking the link to get to the newly created folder it actually goes ahead and verifies that that file is in there.  If it is not in there then copy it from a master folder. Is this even possible? And if it is could someone give me a direction to go in because I’m absolutely stumped. [code]echo '<div id=path>'; echo str_replace('/', '  ', dirname($_SERVER['PHP_SELF'])); echo '</div></div>'; echo '<div id=navcontainer><ul id=tabnav>'; $handle = opendir("./"); while (($file = readdir($handle))!==false) {   if(is_dir($file)){   if($file != "." && $file != ".."){ echo "<li><a href=$file>$file</a></li>";     }   } } if ( isset($execute) ){ checkindexexists(); } echo "</ul><div class=content><ul>"; $handle = opendir("./"); while (($file = readdir($handle))!==false) { if(is_file($file)){ if($file != "." && $file != ".."){ $split = explode(".", $file); $proper = $split[0]; $ext = $split[1];  if ($ext !== 'php'){ if ($proper !== stristr($proper, '~')){ $filename = rawurlencode($file); echo "<li><a href=$filename>$proper</a></li>\n"; } } } } } echo "</ul></div>"; closedir($handle);[/code]
×
×
  • 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.