/    Sign up×
Community /Pin to ProfileBookmark

User Control with PHP?

I am a freelance web designer. My clients are mostly non-technical and need an easy way to maintain their websites. I usually refer them to the hosting control panel but when they try to update the pages they often screw up the design and I end up fixing it over and over again. :rolleyes:

I know that with ASP you can build user controls which lets admins update web pages without interefering with the design itself. I was wondering if this is possible in PHP. I have been researching the web for weeks but not found anything. I’m just not advanced enough to take bits and pieces from different scripts to build an application like that. ?

Having worked with PHP I know that this should be possible and that it should not be very difficult as I don’t need security and such.

I was wondering if anybody knows about a tutorial that helps me with this.

to post a comment
PHP

21 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceMar 03.2005 — [i]Originally posted by Illufox [/i]

[B]I know that with ASP you can build user controls which lets admins update web pages without interefering with the design itself.[/B][/QUOTE]

Unless you're talking about the use of templates (which PHP can do, too), then I don't know to what you're referring -- though I have been proramming in ASP for more than five years. Care to explain further? Having started programming in PHP a few months ago, perhaps I can suggest an equivalent (once I know to what I'm comparing). ?
Copy linkTweet thisAlerts:
@IllufoxauthorMar 03.2005 — No, I'm not referring to templates. I use Dreamweaver to build templates but when the user opens the pages in another HTML editor they can manipulate the template.

What I'm looking for is a web application that lets users update their website via the web instead of via an HTML editor. In ASP its called "User Control" and it's written in aspx. I'm looking for something similar in PHP.
Copy linkTweet thisAlerts:
@NutterMar 03.2005 — It sounds like you're looking for a simple CMS program. You set up the site and they can add / remove / edit articles as they need. If you can find one with a WYSIWYG editor, then they won't have to know HTML at all.
Copy linkTweet thisAlerts:
@IllufoxauthorMar 03.2005 — Yes, exactly! I want something very simple just for adding or removing text and images. No font styles and such, it's all controlled by CSS.
Copy linkTweet thisAlerts:
@JonaMar 03.2005 — [font=trebuchet ms]Try checking out [url=http://www.textpattern.com/]TextPattern[/url] (very useful and flexible CMS) or [url=http://www.wordpress.org/]WordPress[/url] (mostly blogging, but can be used as a CMS as well).[/font]
Copy linkTweet thisAlerts:
@IllufoxauthorMar 03.2005 — Thanks, I was actually looking for a tutorial on how to build this application myself....but I guess this just doesn't exist in PHP....bummer....
Copy linkTweet thisAlerts:
@JonaMar 03.2005 — [i]Originally posted by Illufox [/i]

[B]Thanks, I was actually looking for a tutorial on how to build this application myself....but I guess this just doesn't exist in PHP....bummer.... [/B][/QUOTE]


[font=trebuchet ms]If you really want to, go for it. You'll need a MySQL database and hours upon hours of extra time. You have to start with the basics - starting out writing a CMS isn't recommended. I don't know how well you know PHP, but even a moderately skilled PHP programmer might have difficulty writing a CMS. In addition to just writing one, you have lots of other important things that you cannot ignore, such as security.[/font]
Copy linkTweet thisAlerts:
@IllufoxauthorMar 03.2005 — Well, my intention was not to build a CMS but just to simply build a page where users can select the pages of their websites, then it pops up a text field which is linked to the actual web page. When they hit the submit button, the page is updated. Seems very simple, but I guess it's not.

Security would not be an issue as I would put the application into a protected folder....
Copy linkTweet thisAlerts:
@JonaMar 03.2005 — [i]Originally posted by Illufox [/i]

[B]Well, my intention was not to build a CMS but just to simply build a page where users can select the pages of their websites, then it pops up a text field which is linked to the actual web page. When they hit the submit button, the page is updated. Seems very simple, but I guess it's not.



Security would not be an issue as I would put the application into a protected folder.... [/B]
[/QUOTE]


[font=trebuchet ms]If it's [i]that[/i] simple, I suppose so. It might not be the most user-friendly, but then again it could be the least confusing. You could even do it using flatfiles instead of a database if you wanted.[/font]
Copy linkTweet thisAlerts:
@phpnoviceMar 03.2005 — [i]Originally posted by Illufox [/i]

[B]No, I'm not referring to templates.[/B][/QUOTE]

Well, actually, you [i][u]were[/u][/i] referring to templates -- at least, in the context I meant them. A CMS system uses templates. The user provides the content and the CMS system inserts the content into templates before sending them to the browser. I would not call what you're creating in DreamWeaver a template. If the user can change it, then it is not a template. I'm not saying DreamWeaver can't be used to create templates, just that the finished template would be saved on the server and the user would not be allowed to change it.

To write your own "CMS", such a template would contain place-holder-type tags that are substituted with content provided by users. The content is saved in a database. When the template page is requested from a browser, PHP (or ASP) extracts the content from the database and merges it with the template before passing the finished product on to the browser.

This is all quite simple, really.
Copy linkTweet thisAlerts:
@IllufoxauthorMar 03.2005 — Actually Dreamweaver does build templates. All my websites are based on a template that is stored on the server. If the pages are opened in Dreamweaver, the template cannot manipulated, however if they are opened in any other HTML editor, CMS or Notepad, the template protection doesn't work.

I cannot request that my clients (small business owners) buy Dreamweaver which is rather pricy. Instead I was looking for a way to control what they can manipulate and what not.

I was thinking of something like the guestbook entries that show up on a web page after the user has entered some text. Seems like people can write those codes themselves whitout being experts....
Copy linkTweet thisAlerts:
@phpnoviceMar 03.2005 — [i]Originally posted by Illufox [/i]

[B]I was thinking of something like the guestbook entries that show up on a web page after the user has entered some text. Seems like people can write those codes themselves whitout being experts.... [/B][/QUOTE]

A guestbook is the most simplistic form of a content management system (CMS). The ASP document is the template and the ASP code inserts database entries into pre-determined locations within that template. The next step is separating the template from the ASP code -- such that the template is saved as a separate document and contains no ASP code. I have written such things in ASP and it is quite simple to do. The same thing can be done in PHP just as easily.
Copy linkTweet thisAlerts:
@JonaMar 03.2005 — [i]Originally posted by phpnovice [/i]

[B]A guestbook is the most simplistic form of a content management system (CMS).[/B][/QUOTE]


[font=trebuchet ms]I wouldn't consider a guestbook any form of a CMS. People who are [i]not[/i] administrators are "updating" the page by posting an entry to the site. A CMS allows an administrator to login, update and add new pages to the web site. [/font]
Copy linkTweet thisAlerts:
@phpnoviceMar 03.2005 — [i]Originally posted by Jona [/i]

[B]I wouldn't consider a guestbook any form of a CMS.[/B][/QUOTE]

What part of "...most simplistic form of..." did you not understand? Anything that provides for dynamic web content from an outside manual source can be classified as a CMS. Period. Quite naturally, there are levels of sophistication and security that may be applied. The difference between administrators and the general public providing such content is merely a matter of security.
Copy linkTweet thisAlerts:
@JonaMar 03.2005 — [i]Originally posted by phpnovice [/i]

[B]What part of "...most simplistic form of..." did you not understand? Anything that provides for dynamic web content from an outside manual source can be classified as a CMS. Period. Quite naturally, there are levels of sophistication and security that may be applied. The difference between administrators and the general public providing such content is merely a matter of security. [/B][/QUOTE]


[font=trebuchet ms]But the general public does not manage its own contributions; they do not manage the content, they simply submit it. Also, a guestbook only adds content to a single page, as opposed to multiple pages. Just my take on it, though. "CMS" indicates, in my mind, that the administrator is adding content and new pages to his site.[/font]
Copy linkTweet thisAlerts:
@phpnoviceMar 03.2005 — [i]Originally posted by Jona [/i]

[B]But the general public does not manage its own contributions; they do not manage the content, they simply submit it. Also, a guestbook only adds content to a single page, as opposed to multiple pages.[/B][/QUOTE]

"...levels of sophistication..."
Copy linkTweet thisAlerts:
@JonaMar 03.2005 — [i]Originally posted by phpnovice [/i]

[B]"...levels of sophistication..." [/B][/QUOTE]


[font=trebuchet ms]Haha. Well, you [i]aren't[/i] going to change my mind, no matter how logical your responses may be. :p In my opinion, a guestbook is nowhere near any form of a CMS, and I stand by it.[/font]
Copy linkTweet thisAlerts:
@IllufoxauthorMar 03.2005 — Most simplest would be to create a page with user functions that resides in a protected folder. The page contains links to all pages. When the user clicks on a link a textbox with the content opens. The user can then update the text and save it which then automatically updates the text on the webpage they selected.

No new pages need to be added, just text and images to existing pages.

All I need to know is how can I update text on one page from another page. I know this is possible, just don't know how....
Copy linkTweet thisAlerts:
@JonaMar 03.2005 — [i]Originally posted by Illufox [/i]

[B]All I need to know is how can I update text on one page from another page. I know this is possible, just don't know how.... [/B][/QUOTE]


[font=trebuchet ms]Look at the [url=http://www.php.net/filesystem]filesystem functions[/url].[/font]
Copy linkTweet thisAlerts:
@IllufoxauthorMar 03.2005 — Thanks, I'll take a look at it.
Copy linkTweet thisAlerts:
@phpnoviceMar 03.2005 — [i]Originally posted by Jona [/i]

[B]Well, you [i]aren't[/i] going to change my mind, no matter how logical your responses may be.[/b][/quote]

If my responses are so logical, that means they must make sense. [i]A mind closed from the inside is impossible to change from the outside[/i] -- not that I'm trying to change yours. So, stop trying to change mine by telling me that a GuestBook isn't the most simplistic form of a content management system. ?

Also consider the fact that you're missing part of the point when you think that the "M", in CMS, only means "management" for the people using the system. In other words, it also means that the system, itself, is able to dynamically "manage" the content for display purposes -- which is what a GuestBook does.
×

Success!

Help @Illufox spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...