Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 15th, 2003, 10:16 AM
scintilated scintilated is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Iowa, USA
Posts: 5 scintilated User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to scintilated
church site using PHP

I'm developing a site for local churches, and I need to find a way to have a drop menu that will select the church and then the main navigation will switch to the subdirectory of that church. Is there a way to do this using PHP? I'm just starting to use PHP to develop websites.
The test site is located at WileyComputers.com .

Reply With Quote
  #2  
Old July 15th, 2003, 10:27 AM
a.koepke's Avatar
a.koepke a.koepke is offline
Second highest poster :p
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jul 2001
Posts: 7,323 a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 8 h 11 m 27 sec
Reputation Power: 27
Well you can use PHP to write out the data for the popup menu. Its quite easy to write a script that lists all the files/folders in a folder and then generates links or something like that for them.

PHP Code:
<?
$d 
dir(".");
$exclude=array(".","..","index.php");
while (
false !== ($entry $d->read()))
 {
  if(
in_array($entry,$exclude)==false)
   {
    echo 
'<a href="'.$entry.'">'.$entry.'</a><br>';
   }
 }
$d->close();
?>


That little script will list all files in the folder and make them links. It will not list itself or the . and .. folders.

Reply With Quote
  #3  
Old July 15th, 2003, 11:01 AM
scintilated scintilated is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Iowa, USA
Posts: 5 scintilated User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to scintilated
Thanks! I haven't tried it out yet, but it looks like it should work for what I need it to do.

Reply With Quote
  #4  
Old July 29th, 2003, 05:58 AM
jchen_xxxx jchen_xxxx is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: CA/guam
Posts: 12 jchen_xxxx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i think you only need javascript to do that. for example: http://www.faithchurchguam.com.

Reply With Quote
  #5  
Old July 29th, 2003, 08:45 AM
ishnid's Avatar
ishnid ishnid is online now
kill 9, $$;
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Sep 2001
Location: Dublin, Eire
Posts: 5,652 ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level)ishnid User rank is General 7th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 5 Days 20 h 16 m 48 sec
Reputation Power: 1432
Andreas' code will give you a list of links. This should create a drop-down menu for you.

PHP Code:
<select name="churches" onChange=window.open(this.options[this.selectedIndex].value,"_top")>
<?
$d dir(".");
$exclude=array(".","..","index.php");
while (
false !== ($entry $d->read()))
 {
  if(
in_array($entry,$exclude)==false)
   {
    echo 
'<option value="'.$entry.'">'.$entry.'</option><br>';
   }
 }
$d->close();
?>
</select> 


I've copied your php code andreas. Hope you don't mind
~ishnid;

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > church site using PHP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT