kate_rose Posted December 28, 2007 Share Posted December 28, 2007 Hey I think I need to explain more fully what I am trying to do. I have a web page with a whole bunch of definitions on it for a glossary. Each definition has an anchor and since sometimes there are words in the definitions which themselves need defining (I try to avoid this but can't do it all the time) there are links inside the definitions too. I currently have this page as a small part of a larger project which I have organized using frames. So currently when a link is clicked it just goes to a different location on the same page but only the 1 definition shows up at a time in the small frame. I am trying to convert to a CSS layout but unlike frames, CSS boxes will overflow. My thought was that I would set all the definition displays to hidden except that of the definition I wanted to show up in the box. So when a link was clicked the name would load into a php variable and then everything that didn't have an anchor of that name would be hidden. Since I am so new to PHP and have only really coded in Basic and some weird sound analysis system. I don't know another way to do this. Initially of course I thought of the GOTO command which would allow me to skip over sections of code so that the definitions wouldn't be displayed but from what I have read PHP doesn't do this. I would rather not put the definitions all into seperate files but I guess I could. I am probably reinventing the wheel to some extent. Can someone throw me an example I could chew on a bit to help me figure this out. Thanks again, Kate Quote Link to comment https://forums.phpfreaks.com/topic/83449-a-better-explanation/ Share on other sites More sharing options...
corbin Posted December 28, 2007 Share Posted December 28, 2007 So how exactly is the html laid out? Is every word just on one page or are they seperated into A, B, C blah blah? And where is the frame? I think I get what you're trying to do now, but I don't get where you're trying to get the content to go.... Hrmm.... Is an example possible? I'm probably having a slow moment x.x lol Quote Link to comment https://forums.phpfreaks.com/topic/83449-a-better-explanation/#findComment-424541 Share on other sites More sharing options...
PHP_PhREEEk Posted December 28, 2007 Share Posted December 28, 2007 The BASIC equivalent of GOTO is a function in PHP. Functions more closely mirror GOSUB in that they return to where they were called from (typically), but in the end, if a function is called, the code jumps to that function. IF branches can also be treated as low level GOTO's. I used BASIC throughout my Commodore 64 and 128 days, and the first time I was exposed to PHP I swore that it was some sort of enhanced BASIC! heh I can tell you that any logic you are used to in BASIC is absolutely possible in PHP, times a thousand... although you may seem overwhelmed, if you are an ex-BASIC programmer, I highly recommend you try to stick with the PHP until it sticks to you; because it will eventually! PhREEEk Quote Link to comment https://forums.phpfreaks.com/topic/83449-a-better-explanation/#findComment-424544 Share on other sites More sharing options...
corbin Posted December 28, 2007 Share Posted December 28, 2007 Hrmmm everything I've ever read about GOTOs (C, C++) has advised against them if avoidable.... In PHP as far as web dev'ing goes, the page is usually quite procedural in a very broad sense, so I can't think of when a GOTO would really be that useful.... Then again, I haven't coded much in anything that has GOTOs, so I guess I'm not used to the logic flow behind them.... This post was kinda off topic and entirely pointless, but oh well ;p. Quote Link to comment https://forums.phpfreaks.com/topic/83449-a-better-explanation/#findComment-424545 Share on other sites More sharing options...
kate_rose Posted December 28, 2007 Author Share Posted December 28, 2007 OK lets see how I can explain this. I don't have an web based link that you can go to because I am not to the stage yet where I have learned how to do that bit so I will try to give a quick example here This is a chunk of the code from the glossary. Basically if you looked at this page it would just display a long list of terms & definitions in alphabetical order [<body> <a name="abaxial" id="abaxial"></a> <p class="style2"><strong>ab•ax•i•al</strong> (ăb-ăk׳sē-əl) <i>adj</i></br the side of an organ situated away from the <a href="#axis">axis</a><br /> (<i>i.e.</i> the bottom surface of a leaf) <br /> (<i>syn</i> anterior, ventral, lower) </p> <br /> <a name="abscission" id="abscission"></a><br /> <p class="style2"><strong>ab•scis•sion</strong> (ăb-sĭzh׳ən) <i>n</i> <br /> the normal shedding from a plant of an organ that is mature or aged<br /> (<em>i.e.</em> a ripe fruit or an old leaf) (<i>v</i> abcise) </p> <br /> etc. etc. (I am having trouble getting this code to display correctly - I am not sure how to get it to just display the code text without interpreting any of the html) Here is a screenshot of what my current layout looks like You can see that there are 3 content areas. What I am currently doing is causing my glossary definition page to display in the lower right hand frame. In frames the content will not spill out so I am navigating to different definitions in the glossary page with links & anchors all in that page. I wanted to KIS so I don't have a billion different files each with a seperate definition in it. Maybe I can't do this sort of simple navigation in php & css without having overflow. It seems like I should be able to though. I am sort of using dreamweaver as a jumping off point. It will say create a menu for me & then I go look at the code to see how it was done. I can then modify it a bunch. I guess you could say I am learning the language of html & css that way partially. Also through a bunch of reading (So far just online but I have some books coming in the mail). Dreamweaver seems to do things the hard way in a lot of cases so I often end up looking for a simpler/neater way to do it (was it developed by Microsoft? ) Any thoughts. I know this is probably a really basic question and may have to do with the fact that I don't totally grasp the possibilites of php & css but I could use help. Thanks, Kate Quote Link to comment https://forums.phpfreaks.com/topic/83449-a-better-explanation/#findComment-424740 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.