Hey guys. I was wondering if it's possible to have a page say /admin.php, where I can create new pages from?
I want to be able to create new pages from another page on my site, like /admin.php
On that page, I'd have a form for the page's properties, like file name. Could anyone assist me in doing this?
I'm really new to php and want to get better.
What do you consider a "page" ... not sure what you mean by that.
Are you talking about creating a text file (for content)?
Usually, you don't create a "page", as in an HTML or PHP web page ...
you create the text or content for another script to use ... which generates
the HTML "page". Typically using a database, like MySQL.
Yes. Here I'll explain.
I'm trying to make a site so that I don't have to edit it by uploading files to ftp to make small changes like adding news or links. I'd also like to be able to create a new page.
Here below is what it would look like.
<a href="http://www.MYSITE.com/home.php">HOME</a> - <a href="http://www.MYSITE.com/news.php">NEWS</a> - <a href="http://www.MYSITE.com/coollinks.php">COOL LINKS</a> -
This is the homepage.
I want to have a page, where I can edit what it says in home.php in the part where it says "This is the homepage". The same thing goes for news.php and coollinks.php.
But I'd also want to be able to add a new page, but I'll do that later when I'm able to do this.
That is called a CMS (content management system).
Somehow, you either need to use a database (like MySQL),
or a simpler text (flat-file) database, or at a minimum, some plain text files.
Let's go with the most basic, plain text files ...
The first step is to create the text you want and save it in files.
You might want to do them in sections, like:
n1.txt, n2.txt, n3.txt for paragraphs of news,
and l1.txt,l2.txt,l3.txt for paragraphs (or content) for links.
Create those text files and put text in them (you can also put HTML in them).
Upload them all into a directory called "content".
Then, wherever you want them to appear, you do this:
The PHP script will take the contents of "n1.txt" and display it at that spot.
Do that for all of your content.
The next step is to find a simple PHP editor to edit those text files,
or edit them using notepad and upload them. The PHP editor is something
you can do later, when you learn more about PHP.
But the PHP "includes" is the most basic, first step, to putting content on your page,
without using a database (like MySQL). Eventually, you'll be wanting to get more
elaborate and learn MySQL.
No I want it very simple.
I just want 4-5 pages, in which I can update regularly.. I want maybe one master paragraph for each page, where I can change and add to the paragraph (but possibly be able to add links (without coding), images, and file uploading, so in other words a veryy simple editor). But I guess those are complex, so at the moment I just want to be able to add/change text to the pages.
Thank you so much for your help!
I think I have an idea of how it would work..
What I would have is connect to the database and set up a 5 variables (each for a page paragraph). Then on the page where I edit my pages, I would have the editors. And what the editors would do is display what each variable has. Say one of the vairables is $page1, then I can view what's in it and change it/add to it.
Then on www.mysite.com/page1.php , I'd have an include statement to include the variable $page1.
But my problem is I don't know how to do it...