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


Creating a page with php





garionw
I am wishing to have a script on my site that will create a php page. Is anyone able to help me please.

Im not sure if that is the clearst explaination. Basicly I want to create a php script that will allow me to create webpages and save them into my website directory. It would also be handy if this script could also edit existing pages but I can add it later.

Is anyone able to help me please
User_f_ps_other
I not really sure what you want to do. If you are on about just creating a standard php webpage all you need to do is add the standard extension (.php) after the name of your webpage when saving no script needed.

Example

standard extension of html :

index.html

but to make the page php use the following :

index.php

Thats about all that there is to know about it.
garionw
no i mean actually creating a page winthin a php script. I know you can create images with it and some web programs (wordpress, IPB) can create archived blogs and forum topics
User_f_ps_other
Ok I think you mean the Php Include function. With the php Include function main script added to the main page content area of your website ie (index.php) it will let you load other pages within the script on the page of the website without changing the index page.

First we will add the following code into the main content area of the the web page.

Code:
<?PHP
error_reporting (E_ALL ^ E_NOTICE);
if(!$go){ $go = $HTTP_GET_VARS['go']; }

if($go=="" or $go=="index.php"){

    include("news.php");
}elseif($go=="home"){
   include("news.php");
}elseif($go=="tutorials"){
   include("tutorials.php");
}elseif($go=="portfolio"){
   include("portfolio.php");
}elseif($go=="downloads"){
   include("downloads.php");
}elseif($go=="contact"){
   include("contact.php");
}elseif($go=="forum"){
   include("forum.php");
}elseif($go=="links"){
   include("links.php");
}
?>



Next you will next to add some new web pages to your directory i.e (news.php) and (about.php) without the (). Write news tester in the news.php page and about tester in the about.php page.

So far you should have your main page i.e index page with the php script added to the content area and some new pages i.e news and about.

Now for linking the pages. Add the following to your navigation links in the main index page.

For the home link add -

Code:
index.php?go=news


and for about link add -

Code:
index.php?go=about



Remember to alter the main script you added to the index page when adding new pages.

i.e

Code:
}elseif($go=="links"){
   include("links.php");



and change with your new page i.e adding a (blog) page.


Code:
}elseif($go=="blog"){
   include("blog.php");


If you need any more help please ask.
snowboardalliance
Do you want it more like a CMS or something? I'm not sure but that might work.
garionw
Sorry Im not very clear on this one.

There is a function on php that will let you create your own images with php (They use it for visual confirmation in these forums).

I am wondering if there is a script that will let you create you own html/php page using a script within the document
salman_500
i think i know wat he wants...

you see he wants a script that wud generate a php page for him and also allow him to edit existing php pages....

just like a php editor.... but in a webpage.....

you know like using phpnuke tools you can make a whole module... and using some text generators you can generate text with various graphic effect...

he wants a web page with a script that genrates php pages and allow him to save those pages into directories of his ite...

right ??????
sorry.... but im still a beginer at php..
garionw
Yes thats exactly what I want, thanks!
Rhysige
Now why did it take the other guys so long to pick that up Razz I figured it out off the first post...

The only functions I can find are http://au2.php.net/manual/en/function.tempnam.php and http://au2.php.net/manual/en/function.tmpfile.php both of which are temporary.. I suggest you store the data in the database and query it up from there Smile
garionw
thanks a lot for that, Ill bookmark those pages now and have a look.

I think I will still have it in a mysql database and whenever they type in the page, It can attemp to find that infomation in the database. Its only for my games site and rather than people having to type in: /viewgame.php?game=thisgame people could just type in /game.php and get a game.
Related topics
PHP Toturail
Executing a .sql file through PHP
PHPBB
Php - Basic Encryption site
PHP MySQL Commands Question
[php] including from lib folder impossible
Getting a URL with PHP
Simple membership system needed
PHP VS ASP
comment integrer une page html dans pcnuke
comment integrer un script dans une page php
Why is creating a PHP class useful?
IE8 not allowing new random image on each page (PHP and CSS)
PHP error page, die()
Need Help on creating a validation script
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.