writing new html page through php
Moderator: General Moderators
-
sksangtani
- Forum Newbie
- Posts: 2
- Joined: Thu Nov 19, 2009 5:32 am
writing new html page through php
I want to write a new html page through php script. It is something like a redirection but not to a static page but to a page which is written through php.
- iankent
- Forum Contributor
- Posts: 333
- Joined: Mon Nov 16, 2009 4:23 pm
- Location: Wales, United Kingdom
Re: writing new html page through php
Makes no sense, could you explain in more detail?
Do you want to redirect the user, or output HTML? If you want to output HTML from a PHP script there's three ways:
1. Just make it part of the page, e.g.
2. use echo, printf or a long list of other functions to output HTML, e.g.
3. I got distracted and can't remember - will come back to this one 
Do you want to redirect the user, or output HTML? If you want to output HTML from a PHP script there's three ways:
1. Just make it part of the page, e.g.
Code: Select all
<html><head><title>blah</title</head><body>
<? your php here ?>
<b>some more html</b>
<? more of your php here ?>
</body></html>Code: Select all
echo '<html><head><title>Hello</title></head>';
$i = 1 + 5;
// more php here
echo 'more HTML here';- vargadanis
- Forum Contributor
- Posts: 158
- Joined: Sun Jun 01, 2008 3:48 am
- Contact:
Re: writing new html page through php
Ahm I am not sure if I understand your problem but I guess this is what you want.
You have some PHP files that display some HTML stuff and a 3rd one that will controll which which php files (that contain HTML) to display, right?
In that case I'd just include them as fallows:
controller.php
This will execute the PHP file and show the HTML. You might not even want to put any PHP tags in it, only pure HTML.
You have some PHP files that display some HTML stuff and a 3rd one that will controll which which php files (that contain HTML) to display, right?
In that case I'd just include them as fallows:
controller.php
Code: Select all
/* some code */
require_once 'php/file/to/display.php';