Placeholders

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
mattjones
Forum Newbie
Posts: 2
Joined: Sun Nov 16, 2008 1:33 pm

Placeholders

Post by mattjones »

Hello everyone i am new here and quite new to PHP. I have a couple of questions and would be grateful if anyone could answer them.

I am creating a niche directory site and i have made php create a new page from some form data using the following.

file_get_contents
str_replace
fwrite

and a few things. I have used place holders to create these pages and also to create a link to these new pages.

On part where a new link is created i make the script write a new placeholder ready for the next new entry.

Hope you are still with me!! anyway my questions are..

1. Is using placeholders the best way to go about this or is there another way?

2. What is the best way to hide these placeholders on a page that people will be viewing as they are unsightly. I was thinking of making the text the same colour as the background but they will still be visible if highlighted and i have also heard i would be penalised by google for hiding text and i want my page to rank well and not annoy the search engines.

Thank you very much for any help in advance!!

Matt
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: Placeholders

Post by papa »

Any sample code?
mattjones
Forum Newbie
Posts: 2
Joined: Sun Nov 16, 2008 1:33 pm

Re: Placeholders

Post by mattjones »

This is the code creating the link on a page that already exists.

Code: Select all

 
$link1 = "<a href=\"/directory/business/";
$link2 = $html_file_name;
$link3 = "\">".$data['businessname']."</a>";
 
 
$linkplaceholder = "$region";
 
$link = $link1.$link2.$link3;
 
$linkdetails = "$link"."<br>$region"; 
 
$temp_path = "/home/zqyrdetv/public_html/directory/";
 
$temp_file = "$businesstype";
 
$temp = file_get_contents($temp_path.$temp_file);
 
$addbusiness = str_replace($linkplaceholder, $linkdetails, $temp);
                                                    
$fp = fopen($temp_path.$businesstype, "w"); 
fwrite($fp, $addbusiness); 
fclose($fp); 
 
this is an example of a page with a place holder on.

http://www.musicandmediadirectory.co.uk ... #southwest

There are going to be alot more (placeholders), one for each region but i would like to know the best way to hide them (the placeholders) .
Post Reply