-1

My problem is that the webpage that I do is in complete PHP files. Everywhere there is tutorial how to generate, but there is no instructions what to do when it is a PHP file.

The main file is also index.php. When I insert the code that is generated in HTML.

Comes with a lot of errors, so I convert it to PHP.

it will start like

echo "..bla bla" "\n" ;

echo "<div property=\"gr:legalName\" content=\"G &amp; Sziladi\"></div>\n"; 

which is good already, google recognize it, BUT this will show on the top of my page.How can i insert this markup into index.php without showing,but also google has to recognize it properly.

hakre
  • 193,403
  • 52
  • 435
  • 836
  • It is somewhat likely that you are doing it wrong. Please check the PHP manual here, because by default a PHP file is a HTML file: [Escaping from HTML](http://php.net/language.basic-syntax.phpmode) – hakre Dec 23 '12 at 22:15
  • @hakre The main problem for me is that i am not a programmer,all i know from PHP is what i learned in the last 2-3 weeks.I am rather copy paste methodist.So if i use the echo method it will write it on the main page if i use the

    method the phpdesigner8 will give me error message and the page will not work :(
    – Gábor Ifjabb Sziládi Dec 23 '12 at 22:34

1 Answers1

0

If you prefer to copy and paste HTML, the paste it into a PHP file but outside of the PHP tags:

<?php
/*
 * May brand new PHP Website 
 */

$title_prefix = '- Escaping the Tags';

?>
<html>
  <head>
    <title>Supersite Deluxe <?php echo $title_prefix; ?></title>
  </head>
  <body>
   ....
  </body>
</html>

That is especially useful if you have to a lot of HTML, because you can just paste it in.

See Escaping from HTML

hakre
  • 193,403
  • 52
  • 435
  • 836
  • OK this one is getting better,now the php doesn't throw me error codes,but still it comes visible on the homepage at the bottom.I put this code at the bottom after ?> this sign,so it is the very end,but still visible.I think i am doing something wrong,just don't know what. – Gábor Ifjabb Sziládi Dec 24 '12 at 08:17
  • If the php comes visible, you need to enable php for that file on your webserver so it gets executed instead of just passed to the browser. – hakre Dec 24 '12 at 09:26
  • @harke that is going to be tricky,cause i don't have cpanel only,file manager/ftp manager and so.essential hosting fixed me :( – Gábor Ifjabb Sziládi Dec 24 '12 at 10:47
  • Contact your hosting support and discuss the issue with them. They should be able to help you. – hakre Dec 24 '12 at 11:07
  • @harke than i am lost,their support (talking about register.com) is one of the worst one.Thank you very much for your help.Merry Christmas – Gábor Ifjabb Sziládi Dec 24 '12 at 11:30