Jump to content

hp1

Members
  • Posts

    76
  • Joined

  • Last visited

Posts posted by hp1

  1. Even if I change the variable 'page' to 'menupage' or something it now of course just loads indexhome.php as soon as I click on the guestbook page links becuase of the else statement.What I want to happen is when I click on the guestbbook page the guestbook loads in the right column and the centre column DOESNT CHANGE. Of course at present it is trying to load 1.php or 2.php which dont exist. So i need somethign that says if $page=='an integer' reload the existing centre column content. Is that possible. Does this help explain? Would it help if I included a link to my site (it very amatuer dont laugh!)?


  2. I have a three column layout using CSS. In the left I have a menu, in the centre the main content and in the right a guestbook.The way I have structured index.php is to inlcude all the required files in <divs> based on

    <?php	if($_GET

    ){	$page=$_GET

    ;	include "$page.php";}	}else{	include ('indexhome.php');	}	?>

    My problem is that the guestbokk has links to cycle through the different pages and of course they end up trying to be included in the main div as 1.php or 2.php based on the above. I need a bit of code that basically ignores the include if $page = 0-9, i.e one of the page numbers. I want the centre div to maintain its original content regardless of what guestbook page number is clicked.I hope this is enough to explain my problem, i hope someone can help, let me know if you need any more code.cheers

  3. Hi all, I realise this is a common topic but i cant find a solution that works for me. I have a 3 column layout but only the centre column will stretch the container <div>. If content in the right or left column is longer than the centre columns content its just pokes out of the bottom of the layout and looks really rubbish.I dont use floats for my positioning. Anyway my main index page code looks roughly like:

    <div id="frame"><div id="header"></div><div id="navAlpha"><div id="update"></div></div> 		 <div class="content">Main content here	 	</div> <div id="navBeta"></div><div id="footer"></div> </div>

    and my CSS:

    body {	color:#EDEDED;	background-color:#302226;	margin:10px 100px;	padding:0px;	font:11px verdana, arial, helvetica, sans-serif;	height:500px;		}h1 {	margin:0px 0px 15px 0px;	padding:0px;	font-size:28px;	font-weight:900;	color:#ccc;	}h2 {	font:bold 12px/14px verdana, arial, helvetica, sans-serif;	margin:0px 0px 5px 0px;	padding:0px;	}p {	font:11px/20px verdana, arial, helvetica, sans-serif;	margin:0px 0px 16px 0px;	padding:0px;	}a {	color:#09c;	font-size:11px;	font-family:verdana, arial, helvetica, sans-serif;	font-weight:600;	text-decoration:none;	}input {	background-color:black;	color:white;	border:1px solid white;	}textarea {	background-color:black;	color:white;	border:1px solid white;		wrap:hard;	}a:link {color:#104E8B;}a:visited {color:#00B2EE;}/*a:hover {background-color:#eee;}*/	.content {	position:relative; 		min-width:300px;	/*height:475px;*/	margin:0px 210px 0px 150px;	padding:10px;	border-left:1px solid white;	border-right:1px solid white;	/*background-image:url(bridge2.gif);*/	z-index:0; 	}#navAlpha {	/*text-align:center;*/	color:white;	width:140px;	position:absolute;	top:95px;	left:101px;	/*border:1px solid red;*/	background-color:black;	padding:0px 0px 0px 0px;	margin:0px 0px 0px 0px;	z-index:3;	height:200px;	min-height:200px;}			#navBeta {	position:absolute;	width:190px;	top:103px;	right:120px;	/*border:1px dashed white;*/	background-color:black;	padding:0px;	float:right;	z-index:0;}  #header {	color:white;	margin:0px 0px 0px 0px;	padding:20px 0px 20px 20px;	height:40px;	border-bottom:solid white 1px;	background-image:url(header2.gif);	/*background-repeat:no-repeat;*/	background-position:center;	}	  #frame {	border:1px solid white;	background-color:black;	margin:0px;		}  #footer {	border-top:1px solid white;	/*border-left:1px solid white;	border-bottom:1px solid white;*/	background-color:black;	text-align:center;	margin;0px;	padding;0px;	}  #update {	   border-top:1px solid white;	   border-bottom:1px solid white;	   width:140px;	   margin:0px 0px 0px 0px;	   padding:10px 0px 10px 10px;	   }

    Any advice appreciated becuase at the moment I have make sure the centre content column always has more in it than the two outer columns which is not really ideal. Hope there is a simple solution.Cheers experts!HP

  4. ok, so what you would need to do, is change all your links from stuff like "index.html" or "contact.html" to this: "index.php?page=index" and "index.php?page=contact" then in the php, you would do this:CODE<?phpif($_GET['page']='index'){echo "index page content here";}elseif($_GET['page']='contact'){echo "contact page content here";}?>and so on...and you put that PHP code in the place where you usually put all the content.later, when you get into MySQL, you can store it in there, but I think this should work for yo
    Sorry for the newbie questions but when you say change the links do you mean the bit in qoutes following <a href ="this bit here.html or do i change all my html files to php files?My rough code looks like this:
    <html><head>stylesheet.css</head><body><div id=Frame><div id=menu></div><div id=content></div></div></body><html>

    Ok so my other newbie question is where do the <?php and ?> tags go in realtion to the <divs> and where does the actual php code itself goes. Do i use one set of <?php and ?> or do I need lots of them for every IF statement.I dont think I have explained myself very well. Does someone have a VERY simple example of the code should look like based on a static menu in the left column and dynamic main column?Cheers

  5. ok, so what you would need to do, is change all your links from stuff like "index.html" or "contact.html" to this: "index.php?page=index" and "index.php?page=contact" then in the php, you would do this:
    <?phpif($_GET['page']='index'){echo "index page content here";}elseif($_GET['page']='contact'){echo "contact page content here";}?>

    and so on...and you put that PHP code in the place where you usually put all the content.later, when you get into MySQL, you can store it in there, but I think this should work for you.

    Hey many thanks for the quick response, i'll start tinkering.
  6. Hi all, Just successfully (sort of) completed my first site. Its ok but maintenance heavy. I have a navigation window on the left with links in it. But because its an archive site I keep adding links meaning that I have to add the link to each HTML page that holds the menu. As I understand it, with PHP I could use IF THEN statements taht would do something like:IF this LINK is clickedTHENLoad this HTML (with external CSS) into this <DIV> and so on for each of the links and their associated HTML files. I could then do away with the HTML files because all the content stuff in them will all be contained within the PHP script to be loaded only when the appropriate link is clicked.Hope that makes sense. My problem is I dont know how to start! What function returns the TRUE or FALSE as to whether an <a href> tag has been clicked? I have managed to create a short mail() script that emails my form to me but that is the limit of my experience.Appreciate it if some of you wizard devs could help a newbie out. :) Cheers

  7. OK I have a three column layout with the manin content in the centre and a javascript navigation window on the left column. I want to be able to click on a link and only change the content of the centre coulmn. At the moment I am having to duplicate the home page to maintain Identical content in the navigation column. This is a pain as it means I have to manually change all the links when I add a new one.Hope this makes sense? I have a feeling it will only be possible with frames or php (which i dont know yet!)cheers

  8. Been scouring the forum for similar problem from other newbies. Is this a similar thing to the problem solved using 'faux' columns, i.e columns only stretching to fitthe content.If I add a background-image to the central columns css that is about the size of a screen (vertically) would that stretch the border to the bottom i.e. does that count as content?

  9. ....but not so easy when you're learining, the editor I use is a code editor but has common stuff built in such as 'insert image'. I find it a good way of learning some of the more common markup. I've no doubt that as you become more experienced the need for this goes away.But then everybody is different I guess.

  10. Hi,I'm new to this forum and very much new to web site designing. Resently I came to know that by using CSS one can save a lot of time in redesigning or maintaining a site.Could someone please explain me how to creat this CSS file and how to link HTML pages to this CSS file.I have little knowledge about CSS but don't know how to link these two ( CSS and HTML)
    Hi Win WinI'm also new to CSS. I can highly reccomend the tutorials in W3Schools. ALso once you sort of know what you're looking for, just google for it and you'll find quite a few CSS templates out there that you can modify and customise to suit your needs. I have found this the best way to get to grips with CSS. Also, I use an HTML editor with a built in viewer, this is a great way of seeing your changes straight away without having to upload them to a server or open a seperate browser.
  11. i shouldn't worry about version 5 hacks for opera or ie, as i dont think anyone uses them anymore. Opera is upto version 9, if not 10, and ie is still rubbish even after 7 attempts.The align attribute in yohr <h2> tag can be done in cssh2{text-align:center;}or, if you want it for that particular div,it'll be#NavAlpha h2{text-align:center;}those are some minor issues i can point out...but since its late, i'll have more time to look into your 3 coloumn problem tomorow.but, as a guide, in a 3 coloumned layour i did, i used absolute positioning for all 3 coloumns. the left and center positioned from the left, and the right positioned from the right. the left has a fixed width, and the other 2 use percentages.hope that helps:)
    Hey thanks for the quick reply. Yeah I wasn't sure about those hacks, they make the CSS really messy. I'll whip them out tonight. Thanks for the advice on the positioning, another newbie question, when you say use percetages, what is it a percentage of? Screen width, body width? Look forward to seeing if you can solve my border issue.HP
  12. Hello all,First Apologies for the new post, I have had a good scan through the forum but come across my specific issue. Secondly, i cant belive the patience you experts have with newbies like me!Ok so i'm dabbling withh CSS and my 'first' website. I'm trying to go for the classic three column layout. I used a basic template (as you'll see from the comments in the CSS) and have been hacking it to get it to look how I want. My problem is as I describe above.If I activate the Body border in the style sheet, it only wraps the central content column (down the page) and ignores the left and right columns meaning the left and right columns are left sticking over the bottom border which obviously looks rubbish. This is ok if the central column has more vertical content in it than the other two but it doesn't always and I also want to understand why this is happening. I'm not sure of the etiquette in pasting code so i'm just going to paste it in its entirety (its not that big) and hopefully one of you experts can let me know what i need to do get the full wrap! Incidentally, if I add a wrapper <div> the same thing happens.OK so CSS is:

    body {	border:1px solid white;	color:#EDEDED;	background-color:black;	margin:10px 100px;	padding:0px;	font:11px verdana, arial, helvetica, sans-serif;	}h1 {	margin:0px 0px 15px 0px;	padding:0px;	font-size:28px;	font-weight:900;	color:#ccc;	}h2 {	font:bold 12px/14px verdana, arial, helvetica, sans-serif;	margin:0px 0px 5px 0px;	padding:0px;	}p {	font:11px/20px verdana, arial, helvetica, sans-serif;	margin:0px 0px 16px 0px;	padding:0px;	}a {	color:#09c;	font-size:11px;	font-family:verdana, arial, helvetica, sans-serif;	font-weight:600;	text-decoration:none;	}a:link {color:#104E8B;}a:visited {color:#00B2EE;}a:hover {background-color:#eee;} 		/* All the content boxes belong to the content class. */.content {	position:relative; /* Position is declared "relative" to gain control of stacking order (z-index). */	width:auto;		min-width:120px;	margin:0px 210px 20px 170px;	border:1px solid white;	background-color:black;	padding:10px;	z-index:; /* should be set to 3  - This allows the content to overlap the right menu in narrow windows in good browsers. */	}#navAlpha {	color:white;	width:150px;	position:absolute;	top:85px;	left:100px;	border:1px solid white;	background-color:black;	padding:10px;	z-index:2;/* Here is the ugly brilliant hack that protects IE5/Win from its own stupidity. Thanks to Tantek Celik for the hack and to Eric Costello for publicizing it. IE5/Win incorrectly parses the "\"}"" value, prematurely closing the style declaration. The incorrect IE5/Win value is above, while the correct value is below. See http://glish.com/css/hacks.asp for details. */	voice-family: "\"}\"";	voice-family:inherit;	width:128px;	}/* I've heard this called the "be nice to Opera 5" rule. Basically, it feeds correct length values to user agents that exhibit the parsing error exploited above yet get the CSS box model right and understand the CSS2 parent-child selector. ALWAYS includea "be nice to Opera 5" rule every time you use the Tantek Celik hack (above). */body>#navAlpha {width:128px;}		#navBeta {	position:absolute;	width:190px;	top:82px;	right:100px;	border:1px dashed white;	background-color:black;	padding:10px;	z-index:1;/* Again, the ugly brilliant hack. */	voice-family: "\"}\"";	voice-family:inherit;	width:168px;	}/* Again, "be nice to Opera 5". */body>#navBeta {width:168px;}  #header {		color:white;	margin:10px 0px 10px 0px;	padding:10px 0px 0px 20px;	/* For IE5/Win's benefit height = [correct height] + [top padding] + [top and bottom border widths] */	height:33px; /* 14px + 17px + 2px = 33px */	border-style:solid;	border-color:black;	border-width:1px 1px; /* top and bottom borders: 1px; left and right borders: 0px */	/*line-height:11px;*/	background-color:white;	}

    And HTML for index page is:

    <html><!-- Created on: 01/12/2006 --><head> <link rel="stylesheet" href="Threecolumns.css" type="text/css" media="screen" /></head>														<body>	<div id="header">	</div>	<div id="navAlpha"><h2 align=center> Links </h2>   	</div> 		 	<div class="content"> 	 HOme Page content in here.......	</div> 	<div id="navBeta">	</div></body></html>

    The navalpha div has a javascript menu in it as well but I removed it to keep the space down. I hope this enough to go on and that I have explained myself properly. Many ThanksHP

×
×
  • Create New...