Jump to content

Trouble in PHP-Land


ztagged

Recommended Posts

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>+&nbsp;[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">&nbsp;</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.
Link to comment
Share on other sites

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--]
Link to comment
Share on other sites

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
Link to comment
Share on other sites

[!--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..
Link to comment
Share on other sites

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 URL
switch($_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--]
Link to comment
Share on other sites

[!--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 URL
switch($_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"
Link to comment
Share on other sites

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 URL
switch($_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--]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.