Hi. On some pages I have there is H1 tags. I want to repeat the text that is already in the H1 tag in the title of the page and one other place on the page. How can I do this with php? Is it a small code i can paste in? Sorry if the question is stupid, bur as you may understand I dont know anything about php
put something within the php stating: $keyword = "insert the keyword here"; and wherever you want it to show up put: <?php echo $keyword ?> will that help?
Make sure that the variable declaration is placed in a file that is shared among all the pages that u wanted. The first part $keyword = "insert the keyword here";
Thanks all. That keyword is a H1 tag that is different on every page. I cant just use "keyword", I need to pull the keywords from the different H1 tags.
so you want the php to scrape the page, look for the <h1></h1> tags, save what is between the tags, and place it around the same page? all without modifying the pages? ::edit:: is your site a template driven site? with header an footer templates etc?
I havent been able to create an effective scraper that pulls certain parts out of the page yet so I'm sorry I not going to be able to help.
So I found that if I just paste <?php echo $row_recipe["name"];?> around my site, the keyword I want will be there. But if I paste this code in the title tag in the template where the title is the keyword is not showing up in the title tag. Why not? This is what I have on the template where the title tag is: ///Title of the site $site_title = $row_set["site_title"]; and then: <title><?php echo $site_title; ?></title> Making the title tag like this: <title><?php echo $row_recipe["name"];?> <?php echo $site_title; ?></title> will not work.
So I dont give up on this one. I need the keywords in the h1 tag to show up in the title tag, how can I do that?