FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Can someone help me??





Ohsakm
How can I do to make this?:
Put in a lttle space of a webpage, another webpage, all in php

Thanks for your help
wumingsden
Ohsakm wrote:
How can I do to make this?:
Put in a lttle space of a webpage, another webpage, all in php

Thanks for your help


I don't really know what your trying to say. Are you asking whether it is possible to use php in a html page ?
The answer is yes, and no. php has to be enabled on the server that you are using (it is here at FriHost) and the filename extension has to be re-named from .html to .php. You can then use php in the page.

A good use for this is to use includes. Lets say you have a copyright notice for all of your pages. You may want them all to stem from the same place so that for future use you can edit one file, rather than 50 or so.

To do this you will need to place your copyright code in a file (lets name it footer.php and then in every file where you want the copyright notice to be placed you need to add the following:

Code:
<?php include 'footer.php'; ?>


**Note that there are other ways to do this although I think that this is the easiest.

Is this what you was asking about ?
Ohsakm
For example, i have a page called index.php, I want to show a page called news.php in a little space of index.php
wumingsden
Ohsakm wrote:
For example, i have a page called index.php, I want to show a page called news.php in a little space of index.php


Whats the php page like ? Is it just a html page with a php include because if it is you could just use an inline frame (find out about them [urlhttp://www.w3schools.com/tags/tag_iframe.asp]here[/url]
Ohsakm
is only php, it have nothing of html
wumingsden
Ohsakm wrote:
is only php, it have nothing of html


just place this code wherever you want to but remember to edit it to suit your needs:

Code:

?>
<html>
<head>
</head>
<body>
<IFRAME SRC="index.php" WIDTH=450 HEIGHT=100>
</IFRAME>
</body>
</html>

<?php


the "?>" and "<?php" tags tell the code when the php is stopping then starting. when its stopped html can be placed
Ohsakm
Ok thanks you for your help
eepman
I wouldn't reccomend iframes, i dont personally like them and feel there are more options with divs. You could just put in your code the following.
Code:

echo '<div>';
include 'page.php';
echo '</div>';


That will put a div in with the page. Then in css or in the tag you can specify the size of the div.

Code:

echo '<div style="margin: 5px; Width 125px;">';


That will make a box 5 pixels away from other boxes that is 125 pixels wide. You can also specify information for scrolling etc.
Related topics
Can someone help me ? Com domain setup?
Why am I loosing points... PLEASE HELP!!!
can someone help me?
Flash - Photo Gallery - need help please.
phpBB2 : NEED HELP
CAN SOMEONE HELP? I DON'T UN DERSTAND HOW TO UPLOAD WEBSITE!
help with school assignment
CHMOD?! Help!
Image in title bar
Help me out on advertisements in forum....
premodded problem. Need help
someone help
Can someone help with a problem
getting pver someone help!
i am having problems with this php code.... can someone help
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.