telebofh Posted March 14, 2008 Share Posted March 14, 2008 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); ?> Quote Link to comment https://forums.phpfreaks.com/topic/96155-include-php-file-into-a-cell/ Share on other sites More sharing options...
kenrbnsn Posted March 14, 2008 Share Posted March 14, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/96155-include-php-file-into-a-cell/#findComment-492227 Share on other sites More sharing options...
telebofh Posted March 14, 2008 Author Share Posted March 14, 2008 Genius! Thanks Ken!! Quote Link to comment https://forums.phpfreaks.com/topic/96155-include-php-file-into-a-cell/#findComment-492247 Share on other sites More sharing options...
telebofh Posted March 14, 2008 Author Share Posted March 14, 2008 Well, it does display the data correctly but now it breaks out of the cell and just displays the data in the upper left region of the page. Any way to force it to stay in the cell region? Quote Link to comment https://forums.phpfreaks.com/topic/96155-include-php-file-into-a-cell/#findComment-492266 Share on other sites More sharing options...
kenrbnsn Posted March 14, 2008 Share Posted March 14, 2008 We need to see more of your code. Ken Quote Link to comment https://forums.phpfreaks.com/topic/96155-include-php-file-into-a-cell/#findComment-492267 Share on other sites More sharing options...
telebofh Posted March 14, 2008 Author Share Posted March 14, 2008 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! Quote Link to comment https://forums.phpfreaks.com/topic/96155-include-php-file-into-a-cell/#findComment-492281 Share on other sites More sharing options...
kenrbnsn Posted March 14, 2008 Share Posted March 14, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/96155-include-php-file-into-a-cell/#findComment-492290 Share on other sites More sharing options...
telebofh Posted March 14, 2008 Author Share Posted March 14, 2008 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/ Quote Link to comment https://forums.phpfreaks.com/topic/96155-include-php-file-into-a-cell/#findComment-492302 Share on other sites More sharing options...
kenrbnsn Posted March 14, 2008 Share Posted March 14, 2008 Looking at the HTML source for your link, I noticed that you have multiple <head><html><body> tags, therefore the HTML is invalid. Clean up the HTML and you're problems will probably go away. Ken Quote Link to comment https://forums.phpfreaks.com/topic/96155-include-php-file-into-a-cell/#findComment-492329 Share on other sites More sharing options...
telebofh Posted March 14, 2008 Author Share Posted March 14, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/96155-include-php-file-into-a-cell/#findComment-492354 Share on other sites More sharing options...
kenrbnsn Posted March 14, 2008 Share Posted March 14, 2008 You have a <center> tag before the <body> tag which is illegal. I suggest you get the HTML markup looking the way you want. Add in the items manually and then use PHP to add them. Ken Quote Link to comment https://forums.phpfreaks.com/topic/96155-include-php-file-into-a-cell/#findComment-492363 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.