ok thanks for your help.
dynamically add new html pages?
Hi these all seem to complicated. All i want to do is have a page where you can view the links to all the html pages you have on a website, if you click the link then you can view the main content and can edit it in a textarea / form then resubmit it. Obviously you can use html tags in it as well. Then you can also create new html pages as well with two forms, one which asked for the title which will ultimately be the link on the menu and another form to write the content?
I suppose these will be stored in a flat file or database?
Hi.
Well, you willl find the tools to do that in the manual, with examples.
If you have questions I think you are welcome to post them here.
The sections covering what you need are "file functions" to access, open and save the content, "array" and "string" functions to work with it, respecively analyse and order the input.
And the general sections of course.
As I said, many people will like to help you, but first you will have to try for yourself.
jakob
yes of course im not sure where to start but you have given me some guidence thanks.
regards,
If the online manual is too confusing for you or you'd rather have a book... go to Borders or Barnes and Noble and get a good PHP/MySQL book. Those could help you a lot more since there are usually better examples and explanations than in the manual.
I got most of my (limited) knowledge from "PHP/MySQL Programming for the Absolute Beginner" by Andy Harris. It's an easy to understand guide book for learning the language and it really gives you a good head start so that browsing the manual doesn't seem so overwhelming.
good luck
Ok Mike will give it a go, thanks for the advice.
A good way to start out is to come up with a template for the pages your app is going to create. The admin page could have text fields and areas for the content. When the data is submited, just insert the data in to your template and create a new html file on your server. The only problem with this method is that the data is fairly static. Insead of creating html files you might want to create a simple text file that contains all the info you want in the page. Then you would only need one php template page. You could view the content such as:
templatepage.php?content=someFile
Hope this helps.
Sermolux.
Yes, Sermolux that is exactly what i want to do. But will i just write the file 'somefile.txt and it gets included in the url as you did?
Im not sure how it would all link together, i cannot visualise it, although i can understand the theory.
hey guys,
i have tried it and works for me so fine:
1- you have files on the server in a folder as example the file test.html
2- you create a page as example called : readhtml.php
3- in this pafe (php) create a form with a TEXTAREA in it
4- in the same page also, use the "read file" functions to open tht HTNL page test.html (give the page the proper permissions) and read its contents and assign them to a variable as example $page_code
5- view the page code in the TEXTAREA:
echo("<textarea name='code'>".$page_code."</textarea>");
wish that helps ...
5-
If your going the text file include rout, you could create a function that would search a directory for .txt files, take the names of those files and dynamically create links. That way if you add or delete and files, your link page will always be accurate.
-Sermolux
Sermolux that is exactly what i want to do, but what is rout, please give me a pointer as to how i can start. I cant visualise how i can generate links, the actual url?
If you were to go with my method, the URL for each link would be:
http://www.somepage.com/template.php?content=someFileName
you could use readdir to load all the text files in to an array, then loop through that array to create the links.