Forum Moderators: open

Message Too Old, No Replies

Easy way to allow members to post comments to articles

Pure HTML? PHP?

         

idyll

12:19 pm on Jun 27, 2004 (gmt 0)

10+ Year Member



Not sure if this is do-able but here goes:

Basically I've got a HTML site, but want to add PHP functionality to it.
I don't really know anything about PHP and how it works, my expertise extending to messing around with PHP nuke.
Essentially I want to add a module that lets selected users log in to post news onto the main page and make comments available to put onto news items.
I found a program which transfers the code from HTML to PHP, yet was wondering if there was anyway to just add a PHP login module to the site, or if there was a way to do it in HTML instead of having to learn PHP?
Cheers for any advice in advance

TheDoctor

2:23 pm on Jun 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You certainly mix PHP and HTML (and a lot of other things) together on a site.

PHP runs on the server and outputs HTML. This HTML is no different to the HTML that you create yourself with your HTML editor, and a browser can't tell the difference between them. There are a number of things you might have to consider when using PHP, but, except where you are replacing functionality, converting your existing HTML is not one of them.

If you're a bit more specific about what you're trying to do, there are plenty of people round here who'll be able to help. :)

idyll

7:06 am on Jun 28, 2004 (gmt 0)

10+ Year Member



Yea sorry it was a bit muddled.

Essentially I have a perfectly good HTML site and as I don't know much about PHP I dont want to build a new PHP site from scratch.

I want to add the option on the website for users to Log in and post comments onto news articles. Is there any was I can either
a) achieve this through HTML
b) convert my current website into PHP and apply it to the PHP site with relative ease

Hope that clarifies things :)

QuazBotch

12:53 am on Jun 29, 2004 (gmt 0)

10+ Year Member



No conversion is needed, you just need to add the PHP code to the page. I haven't messed with login/member systems, but comments aren't too hard.

What you will need to do is add a form to the page - could just be a text box, or several fields. When the user hits submit, it will call up a php script (can be another file, or embedded in the same page) that adds whatever is in the form to a database of some sort (.txt files, MySQL). The user's comment will be saved in a database, not on the page itself.

You also have to write some code to display whats in that database so people can read the comments.

You can find tutorials on this stuff in your favourite search engine.

idyll

3:48 pm on Jun 29, 2004 (gmt 0)

10+ Year Member



Ah ok, cheers for the advice :)