Jump to content

Duepilind

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Duepilind's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you very much, I'll see what I can do!
  2. Hello, I've been using a rather simple tab menu/website structure. Each tab link referred to an include located within a switch statement. Thus, all page changes took place within the index file. Here is a condensed version of my Index file. <?php $highr = ($_GET['page']); ?> <ul id="nav"> <?php // This is the script for the menu // Menu items $mainMenu['Home'] = 'index.php?page=home'; $mainMenu['Music'] = 'index.php?page=music'; $mainMenu['About'] = 'index.php?page=about'; //This part creates the above menu items as tabs foreach ($mainMenu as $menu => $link) { echo '<li><a href="'.$link.'"'; //Identifies the active page, if active the tab is given the class="active" $wadr = $link; $parts = explode("=",$wadr); $wadr = $parts['1']; if ($highr == $wadr){ echo ' class="active"'; } echo '>'.$menu.'</a></li>'; } ?> </ul> <table><tr><td> <?php //This is where the pages appear switch ($_GET['page']) { case "home": include('home.php'); break; case "music": include('music.php'); break; case "about": include('about.php'); break; default: include('start.php'); break; } ?> </td><td> <?php // This content will not change include('sidebar.php'); ?> </td></tr></table> What I like about this, and want to keep, is the possibility to link directly to a tab through the address bar, for example, writing http://www.domain.com/index.php?page=home would get me to the home tab of my website. However, the current limit is that every time I click a tab, the entire website reloads. Instead, and what I need assistance with, is a method so only the switch method changes rather than the entire website reloads. Any suggestions? I'm assuming the end-result will approach something like the tab system on the following page: http://www.theoldecookerybook.com/~theopden/wiki/index.php/Colonel_Plomer%27s_Shrewsbury_Cake#tab=Original_text But I'm unsure how to go about this. Thank you beforehand for any assistance!
  3. Hi! I was wondering if someone could point me to a post or other general direction to a PHP script. I've been looking for hours to no avail and I really should consider trying programming it myself, but I thought: "why reinvent the wheel?" =) Ok, the description of what I am looking for is very similar to Google's Image linking script. After you've searched for an image using Google and you click on the image, you get a top frame with some functions and the website to the picture source in a bottom frame. In the top frame, the two functions I like is to either close the window and fill the browser frame with the source website or go back to the image results. I would like a PHP script that fulfills this function to any link. Thus, when I click a link on my website to an external website, I want a top frame with the function to return to my website or close the frame, and a bottom frame with the website I linked to. Hope this is not too unclear and I thank you very much in advance for your assistance! Cheers!
  4. I will and thank you!
  5. Ok, below is my script. The function of the script is to go into a folder (docbank2 in this case) and list the files + information and link to the files. Just a simple little thing I've put together after my second day of PHP-programming - Yay! However, for some reason my fclose function won't work. This is probably a simple problem, but I would be greatful if anyone could help me. Thank you in advance for your response! Cheers! Duepilind <table border="1" cellspacing="2" cellpadding="2"> <tr> <td><b>Nr</b></td><td><b>Filename</b></td><td><b>Filesize</b></td><td><b>Type</b></td><td><b>Last accessed</b></td><td><b>Last modified</b></td></tr> <?php function tstamp_to_date($tstamp) { return date("m-d-y g:i:sa", $tstamp); } function findexts ($file) { $file = strtolower($file) ; $exts = split("[/\\.]", $file) ; $n = count($exts)-1; $exts = $exts[$n]; return $exts; } $sub = ($_GET['dir']); $path = 'docbank2/'; $path = $path . "$sub"; $dh = opendir($path); $i=1; while (($file = readdir($dh)) !== false) { if($file != "." && $file != "..") { if (substr($file, -4, -3) =="."){ echo "<tr><td>$i.</td><td><a href=\"$path$file\" target=\"_blank\">".basename($file)."</a></td><td>"; $ed = $path . $file; $fh = fopen($ed, "r"); $fileinfo = fstat($fh); echo round(($fileinfo["size"]/1024), 2)." kb</td><td>"; echo findexts($file)."</td><td>".tstamp_to_date($fileinfo["atime"])."</td><td>".tstamp_to_date($fileinfo["mtime"])."</td></tr>"; /* This is where I need help! =) */ fclose($ed); }else{ echo "<tr><td>$i.</td><td>$file</td><td> </td><td>Folder</td><td> </td><td> </td></tr>"; } $i++; } } closedir($dh); ?> </table>
×
×
  • 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.