Go Back   Computer Juice > Computer Software > Web Design & Programming
Register Members New Posts Donate Unanswered Posts Site Spy Search


Reply
 
Thread Tools
  #1  
Old 11-03-2008, 05:47 PM
Keys767's Avatar
Keys767  United Kingdom
CJ Member
 
Keys767 is offline
Send a message via MSN to Keys767
 
Join Date: Nov 2007
Last Online: 21-03-2008 11:23 PM
Posts: 24
iTrader: (0)
Keys767 is on a distinguished road
Default Help with bad website code

Hi,
I'm building a website and it was wrking fine, until i added a new page and changed some paths - like ../../css/styles.css to http://www.blah.com/css/styles.css.

It uses includes to include the header.php file and the footer.php file on each page. This error occurs in the header.

All the paths and urls seem correct, but when i view my page online, this:
HTML Code:
<table class="maintable" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td class="header" style="width: 516px">
        <img src="http://www.blah.com/home/images/banner.jpg" class="banner" alt="Bleh" /></td>
        <td class="header">
        <img src="http://www.blah.com/home/images/bannerend.jpg" width="44" height="170" alt="End" align="right" /></td>
    </tr>
    </table> 
turns into this in the source:
HTML Code:
<table class="maintable" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td class="header" style="width: 516px">
        <!--                                                                                         --></td>
        <td class="header">
        <!--                                                                                                           --></td>
    </tr>
    </table> 
Anyone know what's going on? Thanks.

Also, I can post up any other bits of the code if anyone needs to see it to find the problem.

Last edited by Keys767 : 11-03-2008 at 05:48 PM.
Digg this postDel.icio.us this postTechnorati this postNetscape this postStumble this post
Reply With Quote
  #2  
Old 11-03-2008, 08:43 PM
serverguy's Avatar
CJ Donator
Intel ATi
serverguy is online now
 
Join Date: Nov 2007
Last Online: Today 02:14 PM
Posts: 1,383
iTrader: (0)
serverguy is on a distinguished road
Default Help with bad website code

It seems to be ignoring out the line including the images.

Could be something to do with the full URLs. Do you get the same problem when they are relative?
__________________
serverguy
Digg this postDel.icio.us this postTechnorati this postNetscape this postStumble this post
Reply With Quote
  #3  
Old 12-03-2008, 08:11 AM
Keys767's Avatar
Keys767  United Kingdom
CJ Member
 
Keys767 is offline
Send a message via MSN to Keys767
 
Join Date: Nov 2007
Last Online: 21-03-2008 11:23 PM
Posts: 24
iTrader: (0)
Keys767 is on a distinguished road
Default Help with bad website code

I've just tried it on a college computer using IE and it works. I'm just going to check it at home later on and see if it works there too. God knows what happened there...
Digg this postDel.icio.us this postTechnorati this postNetscape this postStumble this post
Reply With Quote
  #4  
Old 12-03-2008, 03:06 PM
spot's Avatar
spot  Wales
CJ Donator
Intel Nvidia
spot is offline
 
Join Date: Feb 2008
Last Online: 22-07-2008 10:17 AM
Posts: 523
iTrader: (0)
spot is on a distinguished road
Default Help with bad website code

I've never seen anyone use an http address to point to a style sheet - it's meant to be a file on a directory on a server's local drive. Have you a reason for doing it? Are you sure it's valid? I'd be very surprised if it were. I'm quite sure it means that there's no way of relative addressing any other directory from it which is what you're trying to do.
__________________

My System: Tim

CPU(s):
Athlon 64 3500+
Motherboard:
Asus A8N-VM CSM
RAM:
Corsair PC3200 CL2 DDR-400 2GB
Graphics Card(s):
nVidia Geforce 6600 512MB
Sound Card:
Cherry RS 6000 M keyboard
Hard Drive(s):
Barracuda.7+ 2x200GB 58MB/s sustained
Optical Drive(s):
Samsung DVD-ROM TS-H352
Case / PSU:
Thermaltake Soprano
Cooling:
Stock
Network / Internet:
Telewest 2x20Mb/sec
Monitor(s):
SXGA flat panel
Operating System(s):
Slackware (2.6.24.3) (Fluxbox) (bash)

Want your system info in your signature?
Digg this postDel.icio.us this postTechnorati this postNetscape this postStumble this post
Reply With Quote
  #5  
Old 12-03-2008, 03:11 PM
spot's Avatar
spot  Wales
CJ Donator
Intel Nvidia
spot is offline
 
Join Date: Feb 2008
Last Online: 22-07-2008 10:17 AM
Posts: 523
iTrader: (0)
spot is on a distinguished road
Default Help with bad website code

Or maybe not. That was my first reaction but it may well be wrong and I'm just used to how I've done things. It's still an odd decision in my opinion.
__________________

My System: Tim

CPU(s):
Athlon 64 3500+
Motherboard:
Asus A8N-VM CSM
RAM:
Corsair PC3200 CL2 DDR-400 2GB
Graphics Card(s):
nVidia Geforce 6600 512MB
Sound Card:
Cherry RS 6000 M keyboard
Hard Drive(s):
Barracuda.7+ 2x200GB 58MB/s sustained
Optical Drive(s):
Samsung DVD-ROM TS-H352
Case / PSU:
Thermaltake Soprano
Cooling:
Stock
Network / Internet:
Telewest 2x20Mb/sec
Monitor(s):
SXGA flat panel
Operating System(s):
Slackware (2.6.24.3) (Fluxbox) (bash)

Want your system info in your signature?
Digg this postDel.icio.us this postTechnorati this postNetscape this postStumble this post
Reply With Quote
  #6  
Old 12-03-2008, 05:47 PM
serverguy's Avatar
CJ Donator
Intel ATi
serverguy is online now
 
Join Date: Nov 2007
Last Online: Today 02:14 PM
Posts: 1,383
iTrader: (0)
serverguy is on a distinguished road
Default Help with bad website code

Originally Posted by spot View Post
I've never seen anyone use an http address to point to a style sheet - it's meant to be a file on a directory on a server's local drive. Have you a reason for doing it? Are you sure it's valid? I'd be very surprised if it were. I'm quite sure it means that there's no way of relative addressing any other directory from it which is what you're trying to do.
Nope theres nothing wrong with that at all. You can stick the style sheet anywhere on the planet, as long as the browser has access to it.

Just like you can with a image or anything else you want to include.
__________________
serverguy
Digg this postDel.icio.us this postTechnorati this postNetscape this postStumble this post
Reply With Quote
  #7  
Old 12-03-2008, 10:04 PM
spot's Avatar
spot  Wales
CJ Donator
Intel Nvidia
spot is offline
 
Join Date: Feb 2008
Last Online: 22-07-2008 10:17 AM
Posts: 523
iTrader: (0)
spot is on a distinguished road
Default Help with bad website code

So how on earth does it pick up the includes? Surely includes have to be, relative or absolute, on the same networked drive system as the php engine.
__________________

My System: Tim

CPU(s):
Athlon 64 3500+
Motherboard:
Asus A8N-VM CSM
RAM:
Corsair PC3200 CL2 DDR-400 2GB
Graphics Card(s):
nVidia Geforce 6600 512MB
Sound Card:
Cherry RS 6000 M keyboard
Hard Drive(s):
Barracuda.7+ 2x200GB 58MB/s sustained
Optical Drive(s):
Samsung DVD-ROM TS-H352
Case / PSU:
Thermaltake Soprano
Cooling:
Stock
Network / Internet:
Telewest 2x20Mb/sec
Monitor(s):
SXGA flat panel
Operating System(s):
Slackware (2.6.24.3) (Fluxbox) (bash)

Want your system info in your signature?

Last edited by spot : 12-03-2008 at 10:05 PM.
Digg this postDel.icio.us this postTechnorati this postNetscape this postStumble this post
Reply With Quote
  #8  
Old 13-03-2008, 08:46 AM
Keys767's Avatar
Keys767  United Kingdom
CJ Member
 
Keys767 is offline
Send a message via MSN to Keys767
 
Join Date: Nov 2007
Last Online: 21-03-2008 11:23 PM
Posts: 24
iTrader: (0)
Keys767 is on a distinguished road
Default Help with bad website code

what i don't understand is how it works fine on computers at my college but not at home (in both firefox and ie). Suggests to me that it must be something to do with my computer. But i just cant figure out what.
Digg this postDel.icio.us this postTechnorati this postNetscape this postStumble this post
Reply With Quote
  #9  
Old 13-03-2008, 09:42 AM
spot's Avatar
spot  Wales
CJ Donator
Intel Nvidia
spot is offline
 
Join Date: Feb 2008
Last Online: 22-07-2008 10:17 AM
Posts: 523
iTrader: (0)
spot is on a distinguished road
Default Help with bad website code

Go on, there's lots of differences. IIS or Apache, linux or MS, even just the pathnames to the www htdocs folder. I'm not sure we can just guess, debugging this involves looking at the raw code you're storing. If we had the entire header include file, for example, we could at least check it's syntax-clean.

How about the include_path in php.ini is different?
__________________

My System: Tim

CPU(s):
Athlon 64 3500+
Motherboard:
Asus A8N-VM CSM
RAM:
Corsair PC3200 CL2 DDR-400 2GB
Graphics Card(s):
nVidia Geforce 6600 512MB
Sound Card:
Cherry RS 6000 M keyboard
Hard Drive(s):
Barracuda.7+ 2x200GB 58MB/s sustained
Optical Drive(s):
Samsung DVD-ROM TS-H352
Case / PSU:
Thermaltake Soprano
Cooling:
Stock
Network / Internet:
Telewest 2x20Mb/sec
Monitor(s):
SXGA flat panel
Operating System(s):
Slackware (2.6.24.3) (Fluxbox) (bash)

Want your system info in your signature?
Digg this postDel.icio.us this postTechnorati this postNetscape this postStumble this post
Reply With Quote
  #10  
Old 13-03-2008, 09:46 AM
spot's Avatar
spot  Wales
CJ Donator
Intel Nvidia
spot is offline
 
Join Date: Feb 2008
Last Online: 22-07-2008 10:17 AM
Posts: 523
iTrader: (0)
spot is on a distinguished road
Default Help with bad website code

Hang on, that's me maybe misreading things again. So you mean you're getting the difference when it's on two differently-located servers, or when it's on two differently-located browsers? I'd assumed two different servers but that's possibly mistaken. There are so many ways of interpreting what you've said so far.
__________________

My System: Tim

CPU(s):
Athlon 64 3500+
Motherboard:
Asus A8N-VM CSM
RAM:
Corsair PC3200 CL2 DDR-400 2GB
Graphics Card(s):
nVidia Geforce 6600 512MB
Sound Card:
Cherry RS 6000 M keyboard
Hard Drive(s):
Barracuda.7+ 2x200GB 58MB/s sustained
Optical Drive(s):
Samsung DVD-ROM TS-H352
Case / PSU:
Thermaltake Soprano
Cooling:
Stock
Network / Internet:
Telewest 2x20Mb/sec
Monitor(s):
SXGA flat panel
Operating System(s):
Slackware (2.6.24.3) (Fluxbox) (bash)

Want your system info in your signature?
Digg this postDel.icio.us this postTechnorati this postNetscape this postStumble this post
Reply With Quote
  #11  
Old 13-03-2008, 05:38 PM
serverguy's Avatar
CJ Donator
Intel ATi
serverguy is online now
 
Join Date: Nov 2007
Last Online: Today 02:14 PM
Posts: 1,383
iTrader: (0)
serverguy is on a distinguished road
Default Help with bad website code

Spot I am afraid I have no idea what you are on about TBH.

Including the style sheet is basic HTML, the PHP engine has nothing to do with including it.

If the page is built on the server using PHP includes or not then web browser will see nothing different. It will only get a plain page with whatever you got the PHP to build.

The style sheet can be located anywhere. The browser will read the request for the style sheet when it renders the page and then follow that link, whether it is on the same directory or not, and get whatever styles it needs from it. It is the same as with images, it can be located anywhere.

If you are talking about the PHP includes then they should be on the same server but can also be configured to be on a different server. In this case I think they are on the same server anyway.

For proof of concept, click here and look at where the CSS is coming from. It works in IE7 and 8 and Firefox at least.

As for the problem, considering one of the computers can see the page fine then it suggests that the actual server is serving up the pages fine. It is probably the way that the browser is interpreting the code. Have you tried it on different browsers?

It may be worth changing the style sheet back to a relative reference on the server and see what happens then.

The other thing that sometimes I have found to work is hitting refresh on the page.
__________________
serverguy

Last edited by serverguy : 13-03-2008 at 05:40 PM.
Digg this postDel.icio.us this postTechnorati this postNetscape this postStumble this post
Reply With Quote
  #12  
Old 13-03-2008, 05:43 PM
serverguy's Avatar
CJ Donator
Intel ATi
serverguy is online now
 
Join Date: Nov 2007
Last Online: Today 02:14 PM
Posts: 1,383
iTrader: (0)
serverguy is on a distinguished road
Default Help with bad website code

Could you post a copy of the actual PHP that generates this page? That might help in identifying the problem.
__________________
serverguy
Digg this postDel.icio.us this postTechnorati this postNetscape this postStumble this post
Reply With Quote
  #13  
Old 13-03-2008, 06:13 PM
spot's Avatar
spot  Wales
CJ Donator
Intel Nvidia
spot is offline
 
Join Date: Feb 2008
Last Online: 22-07-2008 10:17 AM
Posts: 523
iTrader: (0)
spot is on a distinguished road
Default Help with bad website code

The reason it made no sense to you is that I was interpreting him as saying he'd hosted the pages on different computers, not that he'd browsed them from different computers. Hence the confusion.
__________________

My System: Tim

CPU(s):
Athlon 64 3500+
Motherboard:
Asus A8N-VM CSM
RAM:
Corsair PC3200 CL2 DDR-400 2GB
Graphics Card(s):
nVidia Geforce 6600 512MB
Sound Card:
Cherry RS 6000 M keyboard
Hard Drive(s):
Barracuda.7+ 2x200GB 58MB/s sustained
Optical Drive(s):
Samsung DVD-ROM TS-H352
Case / PSU:
Thermaltake Soprano
Cooling:
Stock
Network / Internet:
Telewest 2x20Mb/sec
Monitor(s):
SXGA flat panel
Operating System(s):
Slackware (2.6.24.3) (Fluxbox) (bash)

Want your system info in your signature?
Digg this postDel.icio.us this postTechnorati this postNetscape this postStumble this post
Reply With Quote
  #14  
Old 14-03-2008, 11:41 AM
Keys767's Avatar
Keys767  United Kingdom
CJ Member
 
Keys767 is offline
Send a message via MSN to Keys767
 
Join Date: Nov 2007
Last Online: 21-03-2008 11:23 PM
Posts: 24
iTrader: (0)
Keys767 is on a distinguished road
Default Help with bad website code

Yeah, I meant viewing them fromt different computers. It works when view on both FF and IE in college (XP Pro), but on neither FF nor IE at home (Vista Premium). Must be something to do with my computer. I just need to figure out what. Cleared everything, cache etc. checked settings. dunno whats wrong.

I'll post the actual php coding as soon as i can.

thanks.
Digg this postDel.icio.us this postTechnorati this postNetscape this postStumble this post
Reply With Quote
  #15  
Old 14-03-2008, 11:48 AM
spot's Avatar
spot  Wales
CJ Donator
Intel Nvidia
spot is offline
 
Join Date: Feb 2008
Last Online: 22-07-2008 10:17 AM
Posts: 523
iTrader: (0)
spot is on a distinguished road
Default Help with bad website code

You don't suppose there's an ad-blocker somewhere between you and the server that's stripping out the graphics thinking they're advertising?
__________________

My System: Tim

CPU(s):
Athlon 64 3500+
Motherboard:
Asus A8N-VM CSM
RAM:
Corsair PC3200 CL2 DDR-400 2GB
Graphics Card(s):
nVidia Geforce 6600 512MB
Sound Card:
Cherry RS 6000 M keyboard
Hard Drive(s):
Barracuda.7+ 2x200GB 58MB/s sustained
Optical Drive(s):
Samsung DVD-ROM TS-H352
Case / PSU:
Thermaltake Soprano
Cooling:
Stock
Network / Internet:
Telewest 2x20Mb/sec
Monitor(s):
SXGA flat panel
Operating System(s):
Slackware (2.6.24.3) (Fluxbox) (bash)

Want your system info in your signature?
Digg this postDel.icio.us this postTechnorati this postNetscape this postStumble this post
Reply With Quote

Please support this forum, donate towards our running costs.


Reply


Thread Tools

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with bad code :( Breaker3D Web Design & Programming 8 08-04-2008 08:21 AM
Code 10 lynne9999 Sound, Speakers & MP3 Players 7 31-01-2008 04:07 AM
WEP Code. ComputerGuy Networking, Modems & VoIP 4 20-01-2008 10:59 PM
Best free website for hosting a website? mxmad32 Web Design & Programming 9 10-01-2008 05:58 PM
Code problem, or something else! pidge Multimedia, Drivers & Codecs 1 16-10-2007 05:18 PM


Copyright ©2006 - 2008 Computer Juice.

Powered by vBulletin® Copyright ©2000 - 2008 Jelsoft Enterprises Ltd. SEO by vBSEO ©2008, Crawlability, Inc.