Tokens for PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nparekh
Forum Commoner
Posts: 31
Joined: Fri Aug 05, 2005 2:35 am

Tokens for PHP

Post by nparekh »

Hi everyone

I have noticed programs on the net that create optimized pages for the search engines by using keywords that you enter in. e.g you can take a list of 100 keywords and the php scripts create 100 html pages optimized with those keywords. I believe it works on a token system e.g. %KEYWORD% and the php script runs through each keyword and replaces %keyword% with the actual keyword.

My question is I want to create my own tokens and run through a list of html documents which have the %token% variable and replace %token% with whatever I define the token to be.

Any ideas how I would go about it and where to look for more information?

Kind Regards,

Nikhil
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

research template engines, or the regex board ;)
nparekh
Forum Commoner
Posts: 31
Joined: Fri Aug 05, 2005 2:35 am

Regex Board?

Post by nparekh »

Hi there

Could you tell me what the regex board is:) Sorry I am new to php but want to work this out soon:)

Thanks in advance

Nikhil
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

nparekh
Forum Commoner
Posts: 31
Joined: Fri Aug 05, 2005 2:35 am

Thank you:)

Post by nparekh »

Thanks for that :)
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

uh oh, some one's planning a spam attack
nparekh
Forum Commoner
Posts: 31
Joined: Fri Aug 05, 2005 2:35 am

Post by nparekh »

Not true,

Actually What I have is about a 100 pages that I want to include a link to my main site where I sell an individual product. What I want to do is put a token inside the pages so that I can vary the "ad copy" for the product and test and measure results e.g

I'd like to test two prices $97 and $147 against each other and see which generates the more leads/sales.

To manually go through the 100 pages would take forever - I have heard of the token system but was not sure how I would use it. I could possibly use the include statement and test the two against each other.

Regards,

Nikhil
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

Well be careful, google WILL mark it as spam if you have a high levenshtein between pages.

A quick way to do it would be place
token.php

Code: Select all

<?=$token?>
for the token on each page, then include the files like so:
index.php

Code: Select all

$token = 'token';
include("token.php");
Post Reply