|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today! |
|
#1
|
|||
|
|||
|
Frameset and PHP problem..
OS:WIN XP Pro
PHP: 4.3.4 Error Message: - Hi guys.. Can i have code like this..? code 1 -------------------------------------------- /* main.html -->which is a whole frame, it contains 3 frame, tp_fr_m.html , sd_fr.php , overview.html. Overview.html is the only file which reside in other directory, but in the same level as the sd_fr and overview. */ <html> <head> </head> <frameset rows="97,*" cols="*" frameborder="NO" border="0" framespacing="0"> <frame src="frame/tp_fr_m.html" name="topFrame" scrolling="NO" noresize > <frameset rows="*" cols="137,*" framespacing="0" frameborder="NO" border="0"> <frame src="frame/sd_fr.php" name="leftFrame" scrolling="NO" noresize> <frame src="overview.html" name="mainFrame"> </frameset> </frameset> <noframes><body> </body></noframes> </html> =========================================== code 2: ------------------------------------------- /*sd_fr.php-->which is contain php code to displaying text message, actually this is a side frame that would show a text. */ <html><head> <title></title> <style>a { color: #cccccc; text-decoration: none;} a:hover{color:"#ffffff"} a:visited:{color:#cccccc} #divControl{position:absolute; top:130; left:100; width:250; z-index:20} #divCont{position:absolute; top:56; left:349; clip:rect(0,260,175,0); height:124; width:182; z-index:20} .clScroll{ position:absolute; top:-11px; left:0; visibility:hidden; z-index:20; width: 113px; height: 370px; } #divScroll1{left:0px;} </style> <script language="JavaScript" src="file:///D|/Site%20Ex/Web%20Index%20Selection%202003/280-2/ scripts/scroll.js"> </script> </head><BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0> /* i've cut the table code to make this short code <TABLE WIDTH=137 BORDER=0 CELLPADDING=0 CELLSPACING=0> </TABLE> i've cut the table code to make this short code */ <div id="divCont" style="top: 45px; left: 10px; height: 300; width: 121px; clip: rect(0 182 350 0)"><div id="divScroll1" class="clScroll"> <table border="0" width="120" cellspacing="0" cellpadding="0"> <tr><td valign="top"><p> <p><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#cccccc"><br> </font></p> </td> </tr></table> </div> <?php require('config.php'); $filename = "article_sum_s.html"; # open article summaries if(file_exists($filename)){ $fh = fopen($filename, "r"); $old_news = fread($fh, filesize($filename)); fclose($fh); } # get first five article $articles = explode("<!--ARTICLE-->", $old_news); $i=0; foreach ( $articles as $article ){ if(count($articles)>$i){ if($max_latest >= $i++){ print $article; } } } ?> </div> </body></html> =========================================== code 3 and code 4 ------------------------------------------ tp_fr_m.html is a topframe of the site which only contain html code (a table) and overview.html is just plain html too. So i won't write it down to make this message short. ======================================== ..i mean, i really don't know to save this thing in the format of PHP or HTML (main.html)? I've tried in the HTML but the.. <frame src="frame/sd_fr.php" name="leftFrame" scrolling="NO" noresize> ..wouldn't work. Now i'm trying to build "main.php". (i keep my "sd_fr.php and "tp_fr_m.html" in different folder with overview html) But if I called the "sd_fr.php" not in the frame (not from "main.html).. it's worked! What happened to my code.. is it ok to worked with frame in PHP? many people said it's disaster to work with frameset, better with template.. why? and what kind of animal, or might be a food.. a "template" is? any body can explain it to me? which site is provide any example of "template" script, so i can learn more about it.. Thank's guys.. i hope this is not a stupid question.. I'm new learner, swear!! |
|
#2
|
|||
|
|||
|
RE: Frameset and PHP problem..
I am not sure what the mean by template, but I can guess. I think that what they mean is that you don't use frames and instead, use a single file (index.php) that will then display some html that is fixed (eg, header/menu/footer) and then display different html in the main area of the page depending on what part of the site is being viewed. This is most easily accomplished using URL variables (eg: index.php?section=home or index.php?section=contact) - see the php manual for $_GET if you want more info. The best way to include different content depending on the URL variable is to use a switch statement and include a different file depending on the value of $_GET["section"] that was obtained from the URL...
Frames are not easy or convenient for anyone to use, but they are a client-side feature and have absolutely no impact on what you can or cannot do with php... I still advise against them for aesthetic reasons although there are certain cases where they are very useful. P http://www.pmkmedia.com |
|
#3
|
|||
|
|||
|
RE: Frameset and PHP problem..
Templates are much better, cleaner and easier to use than Framesets and give them a better appearance.
If your familar with frameset, you have a main.html page that calls the other .html pages to form your web site. When you click on a link within the site it would re-load the framesets with the new page called by clicking the link. Templates accomplishes the same thing, but you don't need to use the frameset layout. Templates work more with table structures and call functions or includes. A good intro to templates and how to set one up is here in the Codewalker Tutorials at: http://codewalkers.com/tutorials.php?show=58&page=1 From what I've seen and have read, PHP does not work well as part of a frameset and really isn't needed. Good luck |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Frameset and PHP problem.. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|