ztagged Posted May 15, 2006 Share Posted May 15, 2006 Hi, I'm a bit confused with PHP right now. I have a page (PHP), with links to pages that I'd like to open in a div. Below is my code. I'm hoping this is something small that I lost.[code]<html> <head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>SpazzRadio</title> <script LANGUAGE="JavaScript"> <!-- Begin function popUp(URL) { day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=300,height=150,left = 362,top = 234');"); } // End --> </script> </head> <body bgcolor="#333300"> <table border="1" width="65%" id="table1" bordercolorlight="#000000" bordercolordark="#000000" align="center" height="15%"> <tr> <td height="50%" bgcolor="#669900"> <p align="center"><b><font face="Verdana" color="#FFFFFF"> SpazzRadio.com </font></b></td> </tr> <tr> <td bgcolor="#666633"> <p align="center"><font color="#FFFFFF"><?php include 'staff/dj/overwrite.html' ?></font></td> </tr> </table> <div align="center"> <table border="1" width="65%" id="table2" height="60" bordercolorlight="#000000" bordercolordark="#000000"> <tr> <td width="141" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#669900"> <p align="center"><font face="Verdana" size="1" color="#FFFFFF"> <b>Navigation<br><br></b>+ Home<br>+ [b]<a href="green.php?page=test4">News</a[/b]><br>+ Staff<br>+ Junk!<br> + Contact<br>+ Tune in!<br>+ Legal<br>+ Boards<br>+ Habbo Canada</font><p align="center"> </td> <td bgcolor="#666633"> [b] <div align="center"><?php include "test3.html"; ?></div>[/b] <div align="center"></div> </td> </tr> </table> </div> <table border="0" width="100%" id="table3" style="border-collapse: collapse"> <tr> <td></td> <td><?php include "request/request.php" ?></td> <td></td> </tr> </table> <table border="0" width="80%" id="table4" style="border-collapse: collapse" align="center"> <tr> <td> <br><p align="center"><?php include 'stats/radio_stats.php' ?><br><td> </tr> </table> </body> </html> [/code]Any help is more than appreciated. Quote Link to comment Share on other sites More sharing options...
cunoodle2 Posted May 15, 2006 Share Posted May 15, 2006 Your post does not actually have a question. What is the EXACT problem that you are having? Are there any error messages? What is your page doing when you run it? What are you EXPECTING it to do? Quote Link to comment Share on other sites More sharing options...
jeremywesselman Posted May 15, 2006 Share Posted May 15, 2006 You need to be more specific with your problem. You didn't give us much to work with.How are you having trouble? Are you trying to open it with [b]<a href="green.php?page=test4">News</a>[/b]?[!--coloro:#990000--][span style=\"color:#990000\"][!--/coloro--]Jeremy[!--colorc--][/span][!--/colorc--] Quote Link to comment Share on other sites More sharing options...
ztagged Posted May 15, 2006 Author Share Posted May 15, 2006 Sorry about that. I'm trying to get other pages to open in a div, in a table. Possibly I'm not being too clear, but basically I'm trying to get the div to act SOMEWHAT as an iframe, but more as a content placeholder. The content being the other pages. Going into the div. Get what I'm saying? =x Quote Link to comment Share on other sites More sharing options...
trq Posted May 15, 2006 Share Posted May 15, 2006 Your in the wrong forum. This is nothing to do with php, its a client-side / javascript issue. There is a client-side specific board. Quote Link to comment Share on other sites More sharing options...
haydndup Posted May 15, 2006 Share Posted May 15, 2006 Have you considered using include()?[a href=\"http://www.php.net/manual/en/function.include.php\" target=\"_blank\"]Manual[/a] Quote Link to comment Share on other sites More sharing options...
ztagged Posted May 15, 2006 Author Share Posted May 15, 2006 [!--quoteo(post=374077:date=May 15 2006, 02:23 PM:name=WhyWindows)--][div class=\'quotetop\']QUOTE(WhyWindows @ May 15 2006, 02:23 PM) [snapback]374077[/snapback][/div][div class=\'quotemain\'][!--quotec--]Have you considered using include()?[a href=\"http://www.php.net/manual/en/function.include.php\" target=\"_blank\"]Manual[/a][/quote]I have the 'include' in there.Here's what's going wrong so far.[a href=\"http://spazzradio.com/green.php\" target=\"_blank\"]http://spazzradio.com/green.php[/a]See on the right, the "aaa"? That's where I want the other pages to open. In that div. [[ Edit: Ignore the missing image. It thinks it's still in the correct directory.]][!--quoteo(post=374075:date=May 15 2006, 02:20 PM:name=thorpe)--][div class=\'quotetop\']QUOTE(thorpe @ May 15 2006, 02:20 PM) [snapback]374075[/snapback][/div][div class=\'quotemain\'][!--quotec--]Your in the wrong forum. This is nothing to do with php, its a client-side / javascript issue. There is a client-side specific board.[/quote]Not sure how this is a javascript issue (Aside from my script at the top of the code) but alrighty then.. Quote Link to comment Share on other sites More sharing options...
jeremywesselman Posted May 16, 2006 Share Posted May 16, 2006 I understand what you are trying to do. You'll need to use a switch statement with includes.[code]<?php//use a switch statement to find out which page is in the URLswitch($_GET['Page']){ case 'About': { include('include/about.php'); } break; case 'Services': { include('include/services.php'); } break; default: { include('include/home.php'); } break;}?>[/code][!--coloro:#990000--][span style=\"color:#990000\"][!--/coloro--]Jeremy[!--colorc--][/span][!--/colorc--] Quote Link to comment Share on other sites More sharing options...
ztagged Posted May 16, 2006 Author Share Posted May 16, 2006 [!--quoteo(post=374238:date=May 16 2006, 06:38 AM:name=jeremywesselman)--][div class=\'quotetop\']QUOTE(jeremywesselman @ May 16 2006, 06:38 AM) [snapback]374238[/snapback][/div][div class=\'quotemain\'][!--quotec--]I understand what you are trying to do. You'll need to use a switch statement with includes.[code]<?php//use a switch statement to find out which page is in the URLswitch($_GET['Page']){ case 'About': { include('include/about.php'); } break; case 'Services': { include('include/services.php'); } break; default: { include('include/home.php'); } break;}?>[/code][!--coloro:#990000--][span style=\"color:#990000\"][!--/coloro--]Jeremy[!--colorc--][/span][!--/colorc--][/quote]Okay. Now, I have that. So, in the case of /includes/about.php, I'd make the link "green.php?page=about", correct? If so, I tried that, doesn't seem to work. Otherwise, the default page loads just great.Edit: Capitilization matters in life. _Thumbs up_Edit Deux: Still doesn't load, with proper capilitization. Link: "green.php?page=About" Quote Link to comment Share on other sites More sharing options...
jeremywesselman Posted May 17, 2006 Share Posted May 17, 2006 All this does is check the $_GET['Page'] variable and select which file to show. In your navigation, your links would look like this:[code]<a href="index.php?Page=green">Green</a>[/code]Then your switch would look like this:[code]<?php//use a switch statement to find out which page is in the URLswitch($_GET['Page']){ //if $_GET['Page'] is equat to 'green', display the content for that file. case 'green': { //this is where you include the file you want to display. include('green_content.php'); } break; //whatever you want displayed in the div on index.php goes here. default: { include('home_content.php'); } break;}?>[/code][!--coloro:#990000--][span style=\"color:#990000\"][!--/coloro--]Jeremy[!--colorc--][/span][!--/colorc--] Quote Link to comment 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.