Jump to content

l2oBiN

Members
  • Content Count

    9
  • Joined

  • Last visited

Community Reputation

0 Neutral

About l2oBiN

  • Rank
    Newbie
  1. My understanding of the script is if the p variable ($p) has been set (ie is <> null) run a switch statement which obtains value from $p and checks it against different cases to determine which code to run. If the $p=='about' then create and assign values to the $title and $content variables. These variables are then called in the <title> and <body> HTML elements. To simplify the example I have modified the code as below...which still does not seem to work =( ???? In addition...a couple of questions..1. Is there a difference between using a ' an a " mark? (thought the " marks are used for declaring string variables but I see sometimes they are used for specifying a variable?)2. I am wondering whether the code does not work because the $title and $content are only available locally thus are not able to be accessed outside of the function (as they are called by the echo)? I tried declaring them as global within the switch function but it was seen as syntax error.3. I have tried including my gallery page directly in the <body> (see below comments) but could only see place marks for the images themselves, the images were not seen at all??? they are clearly there when the html document is viewed separately. 4. What is I would like to include the associated css and Jquiry files and scripts? (I essentially would like to replace IFRAME tags above without being sandboxed so that the Lightbox2 plugin would not be clipped by the IFRAME) <?php// Select content based on query$p='about'; /* also tried "about" and about (no quotes)*/if(isset($_GET['p'])) { switch($_GET['p']) { case 'about': $title = 'About Us'; // also tried making global eg global $title='About Us' $content ="Number 1"; break; }}?><html><head><title><?php echo $title; ?></title></head><body>-- Header ---- Menu --<?php echo $content; ?> // tried <?php include 'gallery/gallery.html'; ?> but could only see photo place marks-- Footer --</body></html>
  2. Thank you. Ok I have managed to setup the MSQL+Apache server with MAMP and I have confirmed that PHP works on my computer by running the following .php file as per "Example 1" instructions from the "Your first PHP-enabled page" <html><head> <title>PHP Test</title></head><body><?php echo '<p>Hello World</p>'; ?></body></html> I have then tried running a .php file with the script "FoxyMod" mentions aboveFirstly, line 9 of the script (...) comes up as invalid syntax so I have removed it and tried running it. I just get a readout of the "-- Header -- -- Menu -- -- Footer --". I thought that perhaps replacing the $content with the dir to a html page would display it (see below), but it does not seem to work. Is there a practical example demonstrating the effect? I essentially would like to call a change in div contents through a menu click by loading different html pages... <?php// Select content based on queryif(isset($_GET['p'])) { switch($_GET['p']) { case 'about': $title = 'About Us'; $content = 'gallery/gallery.html'; break; }}?><html><head> <title><?php echo $title; ?></title></head><body>-- Header ---- Menu --<?php include $content; ?>-- Footer --</body></html> My current simplified site code <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><div id="wrapper"> <div id="logo"><a href="slideshow/slideshow.html" target="iframe_content"><img src="logo.png" alt="Photography by xxx"></a></div> <div id="navigation"> <ul> <li><a href="gallery/gallery.html" target="iframe_content">gallery</a></li> <li><a href="#">technical</a></li> <li><a href="#">info</a></li> </ul></div><!--/#navigation--> <div id="content"><iframe name="iframe_content" src="slideshow/slideshow.html" marginwidth=0px marginheight=0px frameborder=0 width=600px height=600px></iframe> <!-- width and height must match #content css--> </div> <footer id="footer">© xxx 2013. All rights reserved.</footer></div><!--/#wrapper--></body></html>
  3. I am a beginner at web design and I am trying to build a personal website. I am using an IFRAME to load different contents to the body of my webpage when a menu link is clicked. However, I came across a problem where an image gallery viewer (lightbox2) is getting "stuck" in the IFRAME (I would like it to not be stuck in the IFRAME). Trying to find out a bit more about this, it seems that replacing the iframe with a more modern alternative might be at least part of the solution. What are the modern alternatives to IFRAME? I basically want to change the contents of the middle content area of my site.
  4. l2oBiN

    problems with z-index

    I would like to have the log element float above the other elements, and positioned relatively to the wrapper. The problem is that although I can make the element come in front. The other elements within the wrapper seem to recognise and align as if there the logo element was still at z-index :0; why? <html><head><title>m2</title><link rel="stylesheet" type="text/css" href="main.css" /></head><body> <!-- Begin Wrapper --> <div id="wrapper"> <div id="logo"> logo </div> <div id="header"> header </div> <div id="navigation"> navigation </div> <div id="content"> content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content content </div> <div id="footer"> footer </div> </div> <!-- End Wrapper --></body></html> *{padding: 0;margin: 0;}body{background-color: black;}#wrapper{margin: 0 auto;width: 960px;height: 600px;background-color: orange;} #logo{ z-index: 1; float: none; position: relative; top: 120px; left: 120px; width: 100px; height: 100px; background: green; } #header{ float: left; width: 960px; height: 100px; background: #BD9C8C; } #navigation{ float: left; width: 960px; height: 50px; background-color: yellow; } #content{ float: left; width: 960px; height: 100%; background-color: #F2F2E6; } #footer{ float: left; width: 960px; height: 50px; background: #E7DBD5; background-color: white; }
  5. Hello, I am new at this so I hope this is not a dumb question..I would like to have my footer at the bottom of the page, and have only my "content" div stretch between my navigation and the footer. How can I do that? Secondly, I would like to have an additional div (which will have an image, and is not present in the below code) positioned above all the other divs, and I would like to be referencing its position to the wrapper. eg -100px from top of wrapper and 100px from left of wrapper. Thank you in advancemy html code <html><head><title>m2</title><link rel="stylesheet" type="text/css" href="main.css" /></head><body> <!-- Begin Wrapper --> <div id="wrapper"> <div id="header"> header </div> <div id="navigation"> navigation </div> <div id="content"> content </div> <div id="footer"> footer </div> </div> <!-- End Wrapper --> </body></html> My CSS Code *{padding: 0;margin: 0;}body{background-color: black;}#wrapper{margin: 0 auto;width: 960px;height: 100%;background-color: orange;} #header{ float: left; width: 960px; height: 100px; background: #BD9C8C; } #navigation{ float: left; width: 960px; height: 50px; background-color: yellow; } #content{ float: left; width: 960px; height: 100%; background-color: #F2F2E6; } #footer{ float: left; width: 960px; height: 50px; background-color: white; }
  6. Ok Got t the root of the bloody problem after painstaking deduction! It was my commenting! I never would have guessed it. "from http://htmlhelp.com/reference/wilbur/misc/comment.htmlThere is also the problem with the "--" sequence. Some people have a habit of using things like "<!-------------->" as separators in their source. Unfortunately, in most cases, the number of "-" characters is not a multiple of four. This means that a browser who tries to get it right will actually get it wrong here and actually hide the rest of the document. For this reason, use the following simple rule to compose valid and accepted comments: An HTML comment begins with "<!--", ends with "-->" and does not contain "--" or ">" anywhere in the comment. Let that be a lesson to all other newbies like myself!
  7. I have a centred div container which has four divs in it and I would like it to be like a sandwich within the container. ie top = div for site heading, second a navigation row, third the main content area and finally a tiny footnote with copyright info. How can I chase it down? i have rand the code through dreamweaver and it tells me there is no cmpatibility issues between browsers. When I open the code in Safari or in Opera there is no problem however I get a problem in Firefox. I dont understand why. Is it the way I have arranged the divs with CSS ?
  8. Hello. I am not sure if this is the right subforum for this post. I am having trouble with establishing a row layout for a website. It looks as I want it to in Safari, but not in Firefox or the DW preview. Could someone point out the reason? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Untitled Document</title><style type="text/css"><!--body { font: 80% Verdana, Arial, Helvetica, sans-serif; background: #666666; margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */ color: #000000;}#container { /* the code below will center the #container to the middle of the browser, it has been obtained from [url="http://www.infinitywebdesign.com/research/cssverticalcentereddiv.htm"]http://www.infinitywebdesign.com/research/...centereddiv.htm[/url] */ position:absolute; top:50%; left:50%; height:600px; width: 960px; /* this will create a container 960px wide */ margin-top: -300px; /*set to a negative number 1/2 of your height*/ margin-left: -480px; /*set to a negative number 1/2 of your width*/ /* the above below will center the #container to the middle of the browser, it has been obtained from [url="http://www.infinitywebdesign.com/research/cssverticalcentereddiv.htm"]http://www.infinitywebdesign.com/research/...centereddiv.htm[/url] */ background: #FFFFFF; border: 1px solid #000000; }#header { height:60px; background: #DDDDDD; padding: 0 5px 0 10px; /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. the current setting is written in shorthand, it can be viewed here [url="http://www.w3schools.com/css/css_padding.asp"]http://www.w3schools.com/css/css_padding.asp[/url], and it means 0top, 5px right and 10px left*/ } #header h1 { margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */ }#navigation { height:25px; padding: 0 5px 0 10px; /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */ background: #00FF00;}#mainContent { height:500px; padding: 0 5px 0 10px; /* remember that padding is the space inside the div box and margin is the space outside the div box */ background: #FFFFFF;}#footer { height:15px; padding: 0 5px 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */ background-color:#00FF00; } #footer p { font: 80% Verdana, Arial, Helvetica, sans-serif; margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */--></style></head><body><div id="container"><!--===============================================================================Start #container--> <div id="header"><!--------------------------------------------------------------------- #header --> <h1>Header</h1></div> <!--------------------------------------------------------------------------- end #header --><div id="navigation"><!------------------------------------------------------------- #navigation --> navigatio</div> <!----------------------------------------------------------------------- end #navigation --><div id="mainContent"><!----------------------------------------------------------- #mainContent --> <h1> Main Content</h1> test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test testtest test test test test test test test test test test test test test test test test test test test test test test test test test test test test test testtest test test test test test test test test test test test test test test test test test test test test test test test test test test test test test testtest test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test</div><!----------------------------------------------------------------------- end #mainContent --><div id="footer"><!--------------------------------------------------------------------- #footer --> <p>Footer</p></div><!---------------------------------------------------------------------------- end #footer --></div><!--=============================================================================================== end #container--></body></html>
×
×
  • Create New...