Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Need Help With PHP -> HTML Header
dhanesh
post Jul 13 2006, 03:54 PM
Post #1


Binary Geek
Group Icon

Group: Members
Posts: 444
Joined: 4-November 05
From: The Digital Arena
Member No.: 9,440



I am using a php script to show files on my 2nd host ... It is specially ONLY for files. >>HERE<< is the link ..

Now my problem is that i have put the banner from my main site esanctum ... and the code in my index.php for the banner to show like how it is currently is :

CODE
<html>
<head>

<table width="100%" border="0" cellspacing="0" cellpadding="3">
    <tr>
<a href=''><img src='http://dhanesh.astahost.com/wp-content/themes/rin/images/masthead.jpg' alt='IPB' style='vertical-align:center' border='0'/></a>
        <td width="*" align="center" </td>
    </tr>
</table>

    <title><?php echo $site_name;


My problem is .. how do i get it in CENTER .. i know its sumthing simple and stupid .. and i am overlooking the most obvious thing .. but if anyone notice's the mistake then please tell me .. cause i dont work much with HTML .. so lets say m still kinda n00bish tongue.gif

Regards
Dhanesh.

This post has been edited by dhanesh: Jul 29 2006, 11:27 PM
Go to the top of the page
 
+Quote Post
Vyoma
post Jul 13 2006, 04:10 PM
Post #2


Cosmic Overlord
Group Icon

Group: Members
Posts: 550
Joined: 26-November 05
From: Chennai, India
Member No.: 9,811



I am not sure about it, but should the code be something like this:
CODE
<html>
<head>

<table width="100%" border="0" cellspacing="0" cellpadding="3">
    <tr>
    <td width="*" align="center">

<a href=''><img src='http://dhanesh.astahost.com/wp-content/themes/rin/images/masthead.jpg' alt='IPB' style='vertical-align:center' border='0'/></a>

    </td>
    </tr>
</table>

    <title><?php echo $site_name;


Let me try to simpify the differnce betwee what I have said in the code and the one you indicated as follows.
Your code has something like this:

<table>
<tr>
<a><img></a>
<td> </td>
</tr>
</table>

Where as, the one that I have mentioned puts it properly:
<table>
<tr>
<td>
<a><img><a>
</td>
</tr>
</table>

More over, I have some questions.
Dont you want that banner of yours to be clickable? If yes, then I think you should put the URL in the code:
<a href=''> part. The single quotes '' should contain the URL.

And one more major doubt that arises when I checked the source of your page in an text editor is this:
Should not the table code be put at the begining of the <body> </body> block? Why do you have it in the <head> </head> block.

More over, if you want just a banner in the center, you do not need to put all those table stuff.
All you need to do is put <center><img></center> whereever (in this case, just after <body> ) you want to show the banner.

dhanesh, if it is still not clear, then do respond with your doubts and I would clear it out. Also you I think all the HTML could be cleaned up and leaner code can be used to get the same effect.
Go to the top of the page
 
+Quote Post
dhanesh
post Jul 13 2006, 04:40 PM
Post #3


Binary Geek
Group Icon

Group: Members
Posts: 444
Joined: 4-November 05
From: The Digital Arena
Member No.: 9,440



QUOTE(Vyoma @ Jul 13 2006, 08:10 PM) *
I have some questions.
Dont you want that banner of yours to be clickable? If yes, then I think you should put the URL in the code:
<a href=''> part. The single quotes '' should contain the URL.

And one more major doubt that arises when I checked the source of your page in an text editor is this:
Should not the table code be put at the begining of the <body> </body> block? Why do you have it in the <head> </head> block.

More over, if you want just a banner in the center, you do not need to put all those table stuff.
All you need to do is put <center><img></center> whereever (in this case, just after <body> ) you want to show the banner.

dhanesh, if it is still not clear, then do respond with your doubts and I would clear it out. Also you I think all the HTML could be cleaned up and leaner code can be used to get the same effect.


Yeahhh .. thankx man .. lol biggrin.gif .. i keep f'getting that tags in HTML should be closed properly .. hehe .. i feel so dumb ! ..

Newayz .. about your questions ..
<a href=''> I duno how and y .. but maybe some of the members might give an explaination to this .. but leaving it like this ALSO links to the homepage .. i guess the "" by default reditects to the main page.

Actually, i normally put the header related codes in the HEAD block .. i dunt think it makes a difference anyways .. or does it ? unsure.gif geezz .. complicated stuff never runs tru me ..

And for the center part .. ur code was right .. it just had to be put between the correct tags smile.gif .. thankx for the help .. its done now smile.gif .. >>LINK<<

Regards
Dhanesh.

Go to the top of the page
 
+Quote Post
Vyoma
post Jul 13 2006, 05:20 PM
Post #4


Cosmic Overlord
Group Icon

Group: Members
Posts: 550
Joined: 26-November 05
From: Chennai, India
Member No.: 9,811



Wow! I just learned today that even the HTML content that is put with in <head> tags are rendered by the browser. Any way dhanesh, I would suggest few more changes to your code to make it more semantcially proper, and have a cleaner code.

First of all take back up of the present code.

Next, move the following code
CODE
<table width="100%" border="0" cellspacing="0" cellpadding="3">
    <tr>
    <td width="*" align="center">

<a href=''><img src='http://dhanesh.astahost.com/wp-content/themes/rin/images/masthead.jpg' alt='IPB' style='vertical-align:center' border='0'/></a>

    </td>
    </tr>
</table>

form the <head> tags to right below the <body> HTML tag.

If that works, then you can try one more thing. Instead of having the elaborate <table>, you could simplify it by replacing it with the following code:
CODE
<center><a href=''><img src='http://www.esanctumfiles.fundu.org/resources/masthead.jpg' alt='IPB' style='vertical-align:center' border='0'/></a></center>


Tell us if it works.
Go to the top of the page
 
+Quote Post
vujsa
post Jul 14 2006, 10:55 PM
Post #5


Absolute Newbie
Group Icon

Group: Admin
Posts: 887
Joined: 20-February 05
From: Indianapolis, Indiana, USA (Midwest)
Member No.: 2,714



QUOTE(Vyoma @ Jul 13 2006, 01:20 PM) *
Wow! I just learned today that even the HTML content that is put with in <head> tags are rendered by the browser.


Most browsers today are very forgiving. Many are too forgiving. They do everything that they can to try to parse a document. In the beginning, about half of the web pages served were plain text and you could only get the browser to parse HTML if the file contained valid HTML. Otherwise the entire document was treated like a text document and all of your source code was displayed instead of a parsed HTML document.

Now we no longer have to worry about our pages showing up as raw HTML since the browsers tries to fill in the blanks as best as it can which pretty much means anything will get parsed but if you leave a closing tag out, the browser will insert it somewhere and many times not where you would want it.

Sometimes it is difficult to find the problem since we usually have a lot of HTML to look at in a single page and we usually assume it is a problem with our CSS or something else.
The easiest way to find problems is to write your code in such a way as to make it easier to read in raw form. Good Comments Make Good HTML is an article I wrote that provides tips to aid in writting cleaner code.
Using the HTML validator at W3C can help identify missing tags. This tool was created to try to help web designers write more standardized code.

Hope this helps. cool.gif

vujsa
Go to the top of the page
 
+Quote Post
kerouac
post Aug 4 2006, 08:50 PM
Post #6


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 17
Joined: 4-August 06
Member No.: 14,966



If you have a web banner you need centered you don't need to use a table. Too many pages rely heavily on tables for layout. Use this:

CODE

<div align="center">

bung your html here

</div>


It works fine like this. No tables needed either biggrin.gif

This post has been edited by kerouac: Aug 4 2006, 08:50 PM
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Bad_pool_header(8)
  2. A New Blend - Fansite Header Of The Band East 146(5)
  3. Vertical Text In Datagridview Column Header(6)
  4. How To Embed Ram File Produced By Http Header(2)
  5. Smf Theme Creation Help(13)
  6. PHP-Nuke Header Question(2)
  7. How To Get The Random.h Header(4)
  8. Tutorial: Build Pure CSS Using Online Tools - Part 1(6)
  9. Help: Removing A Specific Header With cURL(0)
  10. "Sighandler_t Typedef" Header(1)
  11. Using Blogger To Add Content(9)
  12. Php Location Header No Send Session Id ?(0)


 



- Lo-Fi Version Time is now: 6th September 2008 - 05:47 PM