LOUCHATS23 Posted September 8, 2006 Share Posted September 8, 2006 Hi, I am very new to php and very familiar with html. A friend has created a dynamic web site in php and I am trying to help him change the headings for his site. I am used to index.htlm and how to use it..... but now in see index.php. Totally unfamiliar with php, how can I add some html tags to the header?????Thank you for your help!Mary Andersen Quote Link to comment https://forums.phpfreaks.com/topic/20144-php-index-file/ Share on other sites More sharing options...
wildteen88 Posted September 8, 2006 Share Posted September 8, 2006 If your friend has coded the site in PHP. Then you'll want to find the PHP file or code that creates the header. Most probably in a file called header.php or something. or if your friend uses a PHP script that s/he has installed then you'll want to login to the admin control panel or find the config file to change the header.But to add Html into a php file use echo:[code=php:0]echo "<h1>My Site heading";[/code]make sure echo is between <?php and ?>, you just add your html outside of the <?php ?> tags, eg:[code]<h1>My Site heading</h1><?php// my php?>more html[/code] Quote Link to comment https://forums.phpfreaks.com/topic/20144-php-index-file/#findComment-88554 Share on other sites More sharing options...
phporcaffeine Posted September 8, 2006 Share Posted September 8, 2006 Open up your 'index.php' file, now you can add all the HTML you want, as long as you stay outside the <?PHP ?> tags.Now if you want/need to add HTML inside the <?PHP ?>, you can but you have to do it inside an echo/print statement.It would be easier if you post the file and what you trying to put in it. Quote Link to comment https://forums.phpfreaks.com/topic/20144-php-index-file/#findComment-88556 Share on other sites More sharing options...
mewhocorrupts Posted September 8, 2006 Share Posted September 8, 2006 [quote author=LOUCHATS23 link=topic=107374.msg430763#msg430763 date=1157737236]Hi, I am very new to php and very familiar with html. A friend has created a dynamic web site in php and I am trying to help him change the headings for his site. I am used to index.htlm and how to use it..... but now in see index.php. Totally unfamiliar with php, how can I add some html tags to the header?????[/quote]If you have the HTML file ready to go, you can save some time, and make the code a little more modular, if you do something like the following:[code]<html>...<body>HTML to be displayed via a PHP script...</body></html>[/code]And the PHP:[code]<?php...include("name_of_html_file.htm");..?>Just place the aforementioned code at whatever point you require the html to be displayed. If it's in the header, then just place it at the top of the PHP file. Just remember that if you are using sessions, be sure to have the session initialize before you include the HTML file.[/code] Quote Link to comment https://forums.phpfreaks.com/topic/20144-php-index-file/#findComment-88594 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.