PDA

View Full Version : Check over this code please!



MST123
Jan 19th, 2009, 12:17 AM
I am not good with PHP at all so if anyone can please check over this code and tell me what's wrong with it.

<div id="sidebar">
<div id="sponsors">
<div class="title">Sponsors</div>
<div id="sponsorscontent">

<img style="display:block;margin-top:0px;margin-bottom:0px;"<a href="http://www.cutoutpro.com" target="_blank"><img width="115" height="50" src="http://www.cutoutpro.com/ads/cartoon-animation-software.gif" title="Cutout Pro Stickman allows you to create cartoon movies" alt="2D Animation Software for All Age Groups"align="left">
<a href="http://saltytech.com/?page_id=95">

<img style="display:block;margin-top:0px;margin-bottom:0px;" src="SampleBanner.jpg" alt="Advertise Here"align="right">
<a href="http://saltytech.com/?page_id=95"><a href="http://saltytech.com/?page_id=95"
</div>
<!-- Sidebar content div -->
</div> <!-- Sponsors div -->

The reason why I am asking this is because on my website saltytech the sponsors box on the right looks messed up in IE, but not in Fire Fox. When I remove the sponsors box the website is shown correctly. I can't explain it too well so see for your self. Open IE and go to the site saltytech and then do the same thing in IE and you will see the difference.

If you could correct the code and post it here that would be great, if the code is not the problem then please tell me what is. Thanks in advance!

masterofollies
Jan 19th, 2009, 12:23 AM
First of all, please please please post coding using the PHP code tags. We can barely read it like that.

Second, please post the coding that pertains to what you want to fix.

Fou-Lu
Jan 19th, 2009, 02:06 AM
This is not a PHP issue, its an HTML/CSS issue. Moving the the html forum.
As well, you're links have been removed since they appear to borderline what a spam bot would do.

MST123
Jan 19th, 2009, 04:27 PM
What do you mean PHP tags, I really don't understand PHP and don't know what that means. Could you put in the tags?

abduraooft
Jan 19th, 2009, 04:38 PM
What do you mean PHP tags, I really don't understand PHP and don't know what that means. Could you put in the tags?
Since this is an HTML issue/code (as of now), you need to use the
][/COLOR] tags to wrap your code (http://www.codingforums.com/showthread.php?t=82672)
(You may edit your original post to enhance its readability.)

VIPStephan
Jan 19th, 2009, 04:42 PM
OK, first of all: It helps a lot if you posted your entire code of the document in question because the issue could be anywhere in your code, it doesn’t necessarily have to be where it becomes obvious if you view the page. For example, if you have a closing tag too much it can screw up the footer of your page but the error might be in the code for the header.

Secondly, what masterofollies meant by using PHP code tags is that you should use the BBCode tags here in the forum. For example, to post code you would put it in between
tags, or use the code button (the one with the ‘#’ sign) in the reply window.

So, as said already, I suspect that there is a closing tag of a division element too much which screws up the page. But we can only be sure if you post your entire code or a link to your site.

Excavator
Jan 19th, 2009, 04:45 PM
Hello MST123,
What do you mean PHP tags, I really don't understand PHP and don't know what that means. Could you put in the tags?
masterofollies is talking about code tags here in the forum. If you enclose your code in tags it puts a little box around it like the code I'm posting below. Use the # icon at the top of the forums new post editing window.

As for your problem, I haven't looked at it in IE but it looks like it could be as simple as clearing your floats.
First, put a background color on it like this:
#sponsorscontent{
padding: 3px 8px 0;
background: #f00;
}
That's just to show you the actual size of #sponsorscontent.


To fix it, make your CSS look like this:
#sponsorscontent{
padding: 3px 8px 0;
background: #f00;
overflow: auto;
}


Read about clearing floats here - http://www.quirksmode.org/css/clearing.html
There are also plenty of other things that could be fixed, check the links about validating in my sig below.


...

Rowsdower!
Jan 20th, 2009, 04:48 PM
Excavator briefly touched on validation errors so here is the link (http://validator.w3.org/check?uri=http%3A%2F%2Fsaltytech.com%2F&charset=%28detect+automatically%29&doctype=Inline&group=0&ss=1&verbose=1) to how your site is validating right now.

Fixing these 38 errors and 2 warnings might fix the issue so you will need to fix these first so that we don't work on finding a problem that isn't really there once the coding is valid.

For one thing, you have code for your analytics after your closing HTML tag. I'm not sure if you have control over this or not, but if you do you should move this inside of the HTML.

Aside from that, some things to note are an unclosed image tag that is also missing an image source (line 200), at least 3-4 unclosed, sometimes textless/imageless <a href...> tags, and an unclosed <center> tag. There are more, but honestly you should take a look for yourself first. I haven't tried to figure out what you wanted to display where, but I can confirm that you most definitely DO have a missing closing </div> tag issue...

If you fix all of this stuff and you still have a problem please come back and let us take a look at the repaired page.

Good luck and welcome to the forums!

MST123
Jan 21st, 2009, 01:34 AM
Is this better?


<div id="sidebar">
<div id="sponsors">
<div class="title">Sponsors</div>
<div id="sponsorscontent">

<img style="display:block;margin-top:0px;margin-bottom:0px;"<a href="http://www.cutoutpro.com" target="_blank"><img width="115" height="50" src="http://www.cutoutpro.com/ads/cartoon-animation-software.gif" title="Cutout Pro Stickman allows you to create cartoon movies" alt="2D Animation Software for All Age Groups"align="left">
<a href="http://saltytech.com/?page_id=95">

<img style="display:block;margin-top:0px;margin-bottom:0px;" src="SampleBanner.jpg" alt="Advertise Here"align="right">
<a href="http://saltytech.com/?page_id=95"><a href="http://saltytech.com/?page_id=95"
</div>
<!-- Sidebar content div -->
</div> <!-- Sponsors div -->

Arbitrator
Jan 21st, 2009, 02:46 AM
Is this better?Assuming that this code is supposed to be HTML (rather than XHTML), your code contains the following errors:


The first div element is missing an end tag.
The first img start tag is not closed with the required greater‐than sign character and is missing the required alt and src attributes.
The required white space between the alt and align attributes of the second and third img start tags are missing.
The end tags (and element text) for all four a elements are missing.

MST123
Jan 21st, 2009, 03:13 AM
Could you correct the code and paste it here? It's a little confusing to me.

VIPStephan
Jan 21st, 2009, 02:05 PM
Please don’t let us do the work for you. Rowsdower gave you a link to an HTML validator where all errors you have in your code are shown. Specifically, check for unclosed elements in your sponsorscontent div. And also remove the <center> opening tag in the .textwidget div.

An editor with syntax highlighting helps a lot.

MST123
Jan 21st, 2009, 10:02 PM
I will go through and try to fix the issues. Thanks everyone who replied I will tell you guys if it worked. Thanks Rowsdower! for the link.

MST123
Jan 21st, 2009, 10:25 PM
I fixed the issues and everything seems to work just fine now. Thanks to everyone who helped!

MST123
Jan 21st, 2009, 10:28 PM
How do I close the thread?

VIPStephan
Jan 22nd, 2009, 01:17 AM
It’s not being closed unless this turns into a flame war. You can, however, edit your first post (in the advanced mode) and change the title to “resolved”.

MST123
Jan 28th, 2009, 03:48 AM
Why can't I edit my original post?

VIPStephan
Jan 28th, 2009, 01:19 PM
Maybe:


6) Thread prefixes usage. In some forums, you can select from a list a prefix to add to your thread's title, for example, a prefix of "resolved" once you've received a satisfactory answer to your question. To add a prefix after your thread has been initially posted, click on the "Edit" button under the first post of the thread, then the "Go Advanced" button. You have 14 days to update your thread's title.

jerry62704
Jan 28th, 2009, 04:16 PM
I am not good with PHP at all so if anyone can please check over this code and tell me what's wrong with it.


<div id="sidebar">
<div id="sponsors">
<div class="title">Sponsors</div>
<div id="sponsorscontent">

<img style="display:block;margin-top:0px;margin-bottom:0px;"<a href="http://www.cutoutpro.com" target="_blank"><img width="115" height="50" src="http://www.cutoutpro.com/ads/cartoon-animation-software.gif" title="Cutout Pro Stickman allows you to create cartoon movies" alt="2D Animation Software for All Age Groups"align="left">
<a href="http://saltytech.com/?page_id=95">

<img style="display:block;margin-top:0px;margin-bottom:0px;" src="SampleBanner.jpg" alt="Advertise Here"align="right">
<a href="http://saltytech.com/?page_id=95"><a href="http://saltytech.com/?page_id=95"
</div>
<!-- Sidebar content div -->
</div> <!-- Sponsors div -->

The reason why I am asking this is because on my website saltytech the sponsors box on the right looks messed up in IE, but not in Fire Fox. When I remove the sponsors box the website is shown correctly. I can't explain it too well so see for your self. Open IE and go to the site saltytech and then do the same thing in IE and you will see the difference.

If you could correct the code and post it here that would be great, if the code is not the problem then please tell me what is. Thanks in advance!

Your code isn't PHP related. And it is wrong.

<div id="sidebar">
<div id="sponsors">
<div class="title">Sponsors</div>
<div id="sponsorscontent">
==>??? <img style="display:block;margin-top:0px;margin-bottom:0px;">
<a href="http://www.cutoutpro.com" target="_blank">
<img width="115" height="50" src="http://www.cutoutpro.com/ads/cartoon-animation-software.gif" title="Cutout Pro Stickman allows you to create cartoon movies" alt="2D Animation Software for All Age Groups" align="left">
<a href="http://saltytech.com/?page_id=95">

<img style="display:block;margin-top:0px;margin-bottom:0px;" src="SampleBanner.jpg" alt="Advertise Here" align="right">
<a href="http://saltytech.com/?page_id=95">
==>??? <a href="http://saltytech.com/?page_id=95"
</div>
==>??? <!-- Sidebar content div -->
</div> <!-- Sponsors div -->

What were you after when the questions are indicated? Further, notice that by formatting the code, the missing </div> tags become very apparent?