Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PHP Coding Question


Guest

Recommended Posts

Not really good with PHP yet.

 

I had a major problem with page centering the past couple days. Corrected, not but not sure what caused it.

 

Is the following code which I had in my index.php from the English directory acceptable?? Note: The addition of the

<center></center> to the line.

 

define('HEADING_TITLE', '<center>Turkey-Ridge Only The Best For Your Pet</center>');

 

I was trying to center this text under the picture. It worked, but something made some

pages out of format. Could this have done it?

 

Thanks

 

Doug

Link to comment
Share on other sites

It could depend on just exactly where HEADING_TITLE was being used. If it was off by itself, that shouldn't cause any problem, but if it was in turn within a paragraph (<p>HEADING_TITLE</p>) or a heading (<h2>HEADING_TITLE</h2>) that might have gotten your browser confused. See where the text ends up on the page -- if it's within a heading or paragraph, you might need to change a template somewhere, to center the heading or paragraph in its entirety, not the text within the heading or paragraph.

Link to comment
Share on other sites

It could depend on just exactly where HEADING_TITLE was being used. If it was off by itself, that shouldn't cause any problem, but if it was in turn within a paragraph (<p>HEADING_TITLE</p>) or a heading (<h2>HEADING_TITLE</h2>) that might have gotten your browser confused. See where the text ends up on the page -- if it's within a heading or paragraph, you might need to change a template somewhere, to center the heading or paragraph in its entirety, not the text within the heading or paragraph.

 

Thank you

 

I am testing it now. I don't think that was the problem I was having before. As an example, I just added it to the index.php file in the includes\languages\english directory and it seems to be working fine.

 

http://turkey-ridge.com/oscommerce/index.php?cPath=6

 

Thanks again for your help with this.

 

Doug

Link to comment
Share on other sites

The center element is deprecated.

Given that osC v2 is completely table-driven (non-CSS) layout, I wouldn't get too bent out of shape over using <center>! osC v2 uses a lot of deprecated elements and attributes. osC v3 is supposedly pretty clean.

Link to comment
Share on other sites

Given that osC v2 is completely table-driven (non-CSS) layout, I wouldn't get too bent out of shape over using <center>! osC v2 uses a lot of deprecated elements and attributes. osC v3 is supposedly pretty clean.

True but still not a bad habbit to get into.

Link to comment
Share on other sites

The center element is deprecated.

 

Styling Text

 

Thanks to both of you

 

Either way I'm glad I have it working but want to try and stay as true to form on the code as possible. All I have ever done is basic html so this is difficult but interesting. Looks like I need to do a bit more reading.

 

The Styling Text link was very useful.

 

Also the other link at the bottom of your post.

 

Thanks

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...