17 replies [Last post]
t-bone_two
t-bone_two's picture
Offline
Enthusiast
Los Angeles
Last seen: 6 years 41 weeks ago
Los Angeles
Timezone: GMT-6
Joined: 2009-09-26
Posts: 209
Points: 268

I recently obtained a large volume of information about some extremely amazing things you can do in terms of rankings and such using PHP.

i am trying to break my pages out into .php sections. header.php, body.php, footer.php

Then call those files from the index.html. Am I doing something wrong here? Or is there something I am doing wrong?

Does anyone know any good resources for .php? I want to essentially break each piece down into separate pages then build it with a master file.

Any help?

Tags:
Verschwindende
Verschwindende's picture
Offline
Guru
Last seen: 2 weeks 4 days ago
Timezone: GMT-4
Joined: 2009-10-09
Posts: 2053
Points: 2285

I guess you just want to look

I guess you just want to look into include() or require(). I'm not exactly sure how that does anything for SEO though as it just puts out regular old html just like it would without using PHP. The word "dubious" comes to mind.

Where are these ideas coming from?

t-bone_two
t-bone_two's picture
Offline
Enthusiast
Los Angeles
Last seen: 6 years 41 weeks ago
Los Angeles
Timezone: GMT-6
Joined: 2009-09-26
Posts: 209
Points: 268

Regarding SEO

By generating a template you are able to control how bots read the web page. And what elements are assigned the most value.

There is much literature out there regarding a general discouragement about using "absolute positioning" I am aware of the pitfalls. Many of them come from the difficulty of using it if it is not understood how it works.

But the data I am getting is from a leader in SEO and page optimization and there are tools and methods of structuring the data and by . . . yes. Using absolute positioning to influence the order in which the page is crawled.

And if pages are broken into pieces such as heading.php footer.php content.php. They can be positioned absolutely so the key content is more easily crawled.

Verschwindende
Verschwindende's picture
Offline
Guru
Last seen: 2 weeks 4 days ago
Timezone: GMT-4
Joined: 2009-10-09
Posts: 2053
Points: 2285

t-bone_two wrote: ... And if

t-bone_two wrote:

... And if pages are broken into pieces such as heading.php footer.php content.php. They can be positioned absolutely so the key content is more easily crawled.

I'm just not understanding how using PHP makes any difference to this issue.

t-bone_two
t-bone_two's picture
Offline
Enthusiast
Los Angeles
Last seen: 6 years 41 weeks ago
Los Angeles
Timezone: GMT-6
Joined: 2009-09-26
Posts: 209
Points: 268

I am reading from a 20 page

I am reading from a 20 page site evaluation from a reputable SEO company. For reasons beyond the time constraints associated with typing it out. I don't really feel like giving away information that was not free.

Verschwindende
Verschwindende's picture
Offline
Guru
Last seen: 2 weeks 4 days ago
Timezone: GMT-4
Joined: 2009-10-09
Posts: 2053
Points: 2285

That's understandable. I

That's understandable. I don't really want information for free. I do wish you'd mention the reputable SEO company though. Smile

I'm just saying that I have no idea, specifically how using PHP is supposed to increase SEO by allowing you to split the pages into parts that you put back together. Google doesn't see php, it just sees the resulting html.

I'm really not trying to be in an argument with you. I've just been the victim of a site evaluation in the past. Let's just say that the company I was working for hired out a security evaluation that was dubious at best. They stated things like

Quote:

The remote web application is using predictable cookie-based session IDs. Ideally, session IDs are randomly generated numbers that cannot
be guessed by attackers. ...

They also mentioned a non-secure database connection. The site was static and used neither sessions nor any form of database besides the session IDs would have been issued by IIS which are neither predictable nor cookie based (at least not by default). I'm sure you understand my suspicion. Also, I'm not saying that there is something wrong with what your reading, just that I want to understand it.

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 7 years 50 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

T-bone, if you don't mind me

T-bone, if you don't mind me saying, but you seem to be getting some real bull*beep* fed to you recently. Whether your page is split up into PHP includes or is just a flat HTML file has absolutely no bearing on your search ranking whatsoever and anyone who tells you that it does is nothing more than a snake oil salesman.

Search engines don't read server side languages, they just read the HTML sent to the browser. Whether that HTML is just typed out into a single HTML file or is pulled together with a bunch of PHP includes doesn't matter one inch - it's how that HTML is structured that counts. You can split up badly structured HTML into PHP includes just the same as you can type it into a single file. Just as you can split up well structured HTML into PHP includes too etc.

Using PHP includes is not the point here - well structured HTML is well structured HTML regardless of the method used to compile the pages.

Quote:

And if pages are broken into pieces such as heading.php footer.php content.php. They can be positioned absolutely so the key content is more easily crawled.

You could do that just as easily without PHP, with a single HTML file. The only advantage PHP gives you in this situation is making your site easier to maintain. Because all common sections of pages are contained within single files, it makes editing much easier.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

t-bone_two
t-bone_two's picture
Offline
Enthusiast
Los Angeles
Last seen: 6 years 41 weeks ago
Los Angeles
Timezone: GMT-6
Joined: 2009-09-26
Posts: 209
Points: 268

My Response

My response to this is simple. There is a great deal of information out there. There are alot of false leads and such that are a waste of time.

The inquiry regarding correct implementation of PHP is a fraction of the data I am moving on.

My being a skeptic my self. I would likely read an individual asking the same questions with a degree of skepticism.

But the truth is your assumption regarding the invalidity of this method is from having a sixteenth of the actual data and strategy being implemented to adhere to tactics backed by WHAT I personally see as statistically proven data.

Current SEO and effective trends involve different strategies and really small tweaks that can have noticeable results.

There are more strategized methods that involve alot of elements in play as well. Which is what I am attempting to do acting on the data.

The overall strategy could be a bust. I am well aware of it. But I have confidence in the figures I am following to act accordingly. And what you are looking at if you compare it to a painting its a square inch of the finished piece,

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 7 years 50 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Right, so if you're not going

Right, so if you're not going to listen to anything anyone says in this thread because we don't have access to the same information as you, then the point of it is...?

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

t-bone_two
t-bone_two's picture
Offline
Enthusiast
Los Angeles
Last seen: 6 years 41 weeks ago
Los Angeles
Timezone: GMT-6
Joined: 2009-09-26
Posts: 209
Points: 268

None

Your point is taken. I am asking about how to make break key sections into .php files. Which is what the thread is about. If there are any answers I share info reciprocally.

Verschwindende
Verschwindende's picture
Offline
Guru
Last seen: 2 weeks 4 days ago
Timezone: GMT-4
Joined: 2009-10-09
Posts: 2053
Points: 2285

t-bone_two wrote:... I am

t-bone_two wrote:

... I am asking about how to make break key sections into .php files. Which is what the thread is about. If there are any answers I share info reciprocally.

The answer is

t-bone_two wrote:

... i am trying to break my pages out into .php sections. header.php, body.php, footer.php

Then call those files from the index.html. Am I doing something wrong here? Or is there something I am doing wrong? ...

change index.html to index.php because unless you set up your server to parse html then it won't include the php files using include().

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 7 years 50 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

A typical 'included' PHP page

A typical 'included' PHP page that I work on would look like this:

<?php 
$pageTitle = "This goes in the title tag";
$pageDescription = "This goes in the meta description";
$page = "This can be used for setting a class or ID on the body tag or for performing any other sort of conditionals on a page.";
include ("./includes/header.htm"); 
?>
		<div id="content">
 
		</div>
		<!-- end content -->
 
<?php include ("./includes/footer.htm"); ?>

The header obviously includes all the HTML that would appear in the source before the content of each page which would be unique. Sometimes, if there is one, the sidebar would appear in the header include, sometimes it might be in the footer include, and sometimes you might have a separate include for the sidebar.

You can use PHP variables to pass information from each page into the includes which is how you get dynamic information into files that are supposed to serve up content for a whole site.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

zerobeholder
zerobeholder's picture
Offline
newbie
ohio
Last seen: 12 years 29 weeks ago
ohio
Timezone: GMT-5
Joined: 2010-03-09
Posts: 2
Points: 2

I use includes all the time

It is as simple as you have posted above to use includes in PHP.

SEO optimization still relies on the rules of the search engines that aren't as public as many would like.

As said above using 'HTML' or 'PHP to generate HTML' will generally give you the same results. It is the 'CSS' that allows your markup to be all wonky and out of order but appear logical via 'absolute positioning'. It is this absolute positioning that would allow you to put your content earlier in your page, and having your key words of your content earlier is good for SEO. It's not what I do, but I don't run a commercial site that would benefit from higher rankings.

I have mostly identical stuff in my document head section, and in my main menu, and in my footer. So, those are the three includes most of my most recent programming had. When I use an include, I know I can modify that file and change the pages that use that data across my whole site. http://bradchesney.com

PHP will allow you to do more, but you are probably going to have to hire someone to make use of the information in any kind of expedient way with more advanced programming techniques-- either that or employ beginner level PHP to do things more easily done with HTML/CSS.

I don't need to see your data to see that you are up to your eyeballs in crud you don't understand all that well. But, it's a start and I am happy to welcome you to the fold even if you are a little arrogant and untrusting. Maybe after a while you'll realize that if we aren't still, we were where you are and you will loosen up a little-- and that the report you purchased might not be everything you had hoped.

zerobeholder
zerobeholder's picture
Offline
newbie
ohio
Last seen: 12 years 29 weeks ago
ohio
Timezone: GMT-5
Joined: 2010-03-09
Posts: 2
Points: 2

Good Resources

I used w3schools.com as a primer (which the elitists here are going to say is complete garbage).

It walks you through a number of examples and has a built-in editor situation that let's you play with the code relatively safely.

The Documentation at php.net is useful sometimes. Unfortunately for me most of the time the examples are too simple or too complex to be of use.

Later the elitists pointed me to the well organized sitepoint.com, but it is hit or miss for me.

Then as any good programmer knows there is always 'The Google'. I step through every line of code on public code deposits so I understand everything it is doing. It still winds up being faster than doing it from scratch in almost every case, except when the code has difficult to fix security holes and I have to start over with different code that is or isn't my own.

In order I would learn XHTML (still HTML but applied in a more strict manner), CSS, Javascript, and then PHP. Follow that all up with SQL if it benefits your interests. Be sure to study about XSS Cross site scripting) & injection.

Don't bother sharing your SEO information with me, I probably woouldn't read it.

Verschwindende
Verschwindende's picture
Offline
Guru
Last seen: 2 weeks 4 days ago
Timezone: GMT-4
Joined: 2009-10-09
Posts: 2053
Points: 2285

Ooh, this is exciting.

Ooh, this is exciting. The train wreck sort of exciting. Laughing out loud

I'm hoping for a "fascist moderator" or maybe a "trampled rights" post. That's like cherries on ice cream.

johndept1
johndept1's picture
Offline
newbie
england
Last seen: 12 years 21 weeks ago
england
Timezone: GMT+5
Joined: 2010-05-04
Posts: 3
Points: 3

yah i agree with you. it is

yah i agree with you. it is almost same.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 38 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

johndept1 you will need to

johndept1 you will need to actively help on the forum for your two signature links to appear. Accrue sufficient number of posts and you gain the signature area but please make posts worthwhile Wink

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Verschwindende
Verschwindende's picture
Offline
Guru
Last seen: 2 weeks 4 days ago
Timezone: GMT-4
Joined: 2009-10-09
Posts: 2053
Points: 2285

Aw, I thought this hot mess

Aw, I thought this hot mess came back for a reason but it was only a spam attempt. Sad