Jump to content

assigning a list to a table on a different page when a link is clicked


leijae

Recommended Posts

I have 2 pages index.php and classes.php

 

This is the code i want to configure in index.php:

<li>
				<h2>Education Classes</h2>
				<ul>
					<li><a href="classes.php">K. - 4th</a> <span>All K. through 4th grade ed. sites listed here.</span></li>
					<li><a href="classes.php">4th - 8th</a> <span>All 4th through 8th sites listed here.</span></li>
					<li><a href="classes.php">8th - 12th</a> <span>All 8th through 12th sites are listed here.</span> </li>
					<li><a href="classes.php">other</a> <span>Special education sites listed here.</span> </li>
				</ul>
			</li>

 

This my code being used in classes.php:

 

<?php
$dirname = "classes/k4/";
$dir = opendir($dirname);
?>

//more html and stuff here

<h1 class="title"><a href="#">K-4th Education Websites</a></h1>
				<div class="entry">
				<p><?php
					while(false != ($file = readdir($dir)))
					{
					if(($file != ".") and ($file != ".."))
					{
					echo("<a href='$dirname$file'>$file</a> <br />");
					}
					}
					?>
				</p>
			</div>

 

When I click 4-8, I want the contents, aka $dirname, of folder "48" to be listed.

for 8-12: folder 812, and other: other

 

any help would be appreciated. thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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