lesser-equity

Magazine
Go Back   Computer Juice > Computer Software > Web Design, Hosting & SEO

Register


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 ...


Reply
 
Thread Tools
  #1  
Old 11th Mar 2008, 11:47
Member Group
 
Posts: 21
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]<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>
[/html]turns into this in the source:
[html]<table class="maintable" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="header" style="width: 516px">
<!-- --></td>
<td class="header">
<!-- --></td>
</tr>
</table>[/html]
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.
  #2  
Old 11th Mar 2008, 14:43
Moderator Group
 
Skill Level: Advanced
Posts: 2,915
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

__________________

My System: Eclipse

Processor(s):
Intel C2D E7200 OC'd @ 3.6Ghz
Motherboard:
Asus P5Q Pro
RAM Memory:
OCZ 8GB 800Mhz
Graphics Card(s):
Saphire Radeon 4850
Sound Card:
Onboard
Hard Drive(s):
Vast
Optical Drive(s):
Sony al cheapo one.
Case / PSU:
Antec Three Hundred
Cooling:
Arctic Cooler 7 Pro, 3 case fans.
Network / Internet:
Titan ADSL
Monitor(s):
Dual 19" LCD
Operating System(s):
XP SP3
  #3  
Old 12th Mar 2008, 02:11
Member Group
 
Posts: 21
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...
  #4  
Old 12th Mar 2008, 09:06
Donor Group
 
Skill Level: Beginner
Posts: 722
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

Processor(s):
Athlon 64 3500+
Motherboard:
Asus A8N-VM CSM
RAM Memory:
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 sustain
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.27.7) (Fluxbox)
  #5  
Old 12th Mar 2008, 09:11
Donor Group
 
Skill Level: Beginner
Posts: 722
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.
  #6  
Old 12th Mar 2008, 11:47
Moderator Group
 
Skill Level: Advanced
Posts: 2,915
Default Help with bad website code

Quote:
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

  #7  
Old 12th Mar 2008, 16:04
Donor Group
 
Skill Level: Beginner
Posts: 722
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.
  #8  
Old 13th Mar 2008, 02:46
Member Group
 
Posts: 21
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.
  #9  
Old 13th Mar 2008, 03:42
Donor Group
 
Skill Level: Beginner
Posts: 722
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?
  #10  
Old 13th Mar 2008, 03:46
Donor Group
 
Skill Level: Beginner
Posts: 722
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.
Reply

Donate

Register

Bookmarks

Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding a Servers Warranty Code (asset Code) aresnalfc General Hardware Chat 0 20th Aug 2009 02:55
Help with bad code :( Breaker3D Web Design, Hosting & SEO 8 8th Apr 2008 01:21
Code 10 lynne9999 Sound, Speakers & MP3 Players 7 30th Jan 2008 22:07
WEP Code. ComputerGuy Networking, Modems & VoIP 4 20th Jan 2008 16:59
Best free website for hosting a website? mxmad32 Web Design, Hosting & SEO 9 10th Jan 2008 11:58
Thread Tools




Arabic Bulgarian Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Finnish French German Greek Hebrew Hungarian Italian Japanese Korean Latvian Lithuanian Norwegian Polish Portuguese Romanian Russian Serbian Slovak Spanish Swedish Thai Turkish Ukrainian

Copyright ©2006 - 2009 Computer Juice.

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