Jump to content
xisto Community
Sign in to follow this  
dhanesh1405241511

Need Help With PHP -> HTML Header

Recommended Posts

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 :

 

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

 

Regards

Dhanesh.

Edited by dhanesh (see edit history)

Share this post


Link to post
Share on other sites

I am not sure about it, but should the code be something like this:

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

Share this post


Link to post
Share on other sites

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 :D .. 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: 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 :D .. thankx for the help .. its done now ;) .. >>LINK<<

 

Regards

Dhanesh.

Share this post


Link to post
Share on other sites

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

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

<center><a href=''><img src='http://http://imptestrm.com/rg-erdr.php?_dnm=www.esanctumfiles.fundu.org&_cfrg=1&_drid=as-drid-2300300503455222; alt='IPB' style='vertical-align:center' border='0'/></a></center>

Tell us if it works.

Share this post


Link to post
Share on other sites

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

vujsa

Share this post


Link to post
Share on other sites

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:

<div align="center">bung your html here</div>

It works fine like this. No tables needed either :D
Edited by kerouac (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.