Jump to content

include php file into a cell


telebofh

Recommended Posts

I have a php file that shows correctly when viewing just that page but when I link a cell to that page, it just shows a bunch of words.  Any clue what I'm doing wrong?

 

This is the script that calls for the php file that I'm using

 

<?php
if(ISSET($_GET{'m'})==false){
$_GET{'m'}='Home';
};
$html = file('display.php'');
$html=implode("", $html);
print($html);
?>

Link to comment
Share on other sites

I see a number of errors in your code. Array indexes are surrounded by "[ ]" not "{ }". I think you want to use the include function, not a file() function.

 

<?php
if(!isset($_GET['m']))
    $_GET['m']='Home';
include('display.php');
?>

 

Ken

Link to comment
Share on other sites

Index.php section

<td colspan="3" valign="top" bgcolor="#FFFFFF">
   <p align="justify" style="margin:0px">
   <?php
if(!isset($_GET['m']))
    $_GET['m']='Home';
include('display.php');
?>
   </p>
   </td>

 

Display.php section

	<div style="position:absolute; top:<?php echo $postvars['Computer' . "1" . '_X']; ?>px;left:<?php echo  $postvars['Computer' . "1" . '_Y']; ?>px;width:32px; height:32px; left: 15px; top: 17px;" onMouseOver="return escape('<b>Computer <?php echo "1" ?><br><b>User:</b> <?php echo $postvars['Computer'."1".'_UserLogin']; ?><br><b>Running:</b> <?php echo $postvars['Computer'."1".'_Program']; ?> <br><b>Time Left:</b> <?php echo $postvars['Computer'."1".'_UserTime']; ?> minutes    ')">
		<img src="./images/pc_<?php echo $postvars['Computer' . "1" . '_State']; ?>.png" alt="Computer 1"> 	</div>

 

I have tryed taking out left and top px sections but that doesnt seem to affect it.  If you need something else, let me know.  Appreciate your help with this Ken!

Link to comment
Share on other sites

Do you have a site where this can be seen?

 

After you display everything on the page, do a "show source" from your browser to see the generated HTML. Looking at that may give you a hint as to what is wrong.

 

The only thing I see in your CSS is that you're specifying "position:absolute" which mean you're telling the browser to put the information where you want it, not where the browser wants to put it. Try taking that out.

 

Ken

Link to comment
Share on other sites

When I take out absolute, the data then stays in the cell but something happens to the data then, it should only show 1 computer in the cell right now but spans 5 of them.  The other 4 computers are in their original format in the upper left corner of the screen.  It also seems to alter the whole table layout when taking out absolute, hehh.

 

http://dotgod.org/

Link to comment
Share on other sites

Removed all the html tags from display.php and the source from the index looks ok now but till shows everything incorrectly.

 

Update:

All the data is in the cell but for some reason, its reproducing it 5 times, not sure why but I'm looking, lol.

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.