Page 1 of 5 123 ... LastLast
Results 1 to 10 of 47

Thread: How to post comments to a php page

  1. #1
    Join Date
    Mar 2007
    Posts
    68
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default How to post comments to a php page

    On the same page that I recently password protected, I now would like to allow the person viewing the page to be able to "POST" comments to the page. How can I do that?

    I found a blogging program in php but after seeing it set up, I really don't think it is what I need because I am not trying to accommodate any number of people to register a username and password in order to blog.

    I only want to accommodate one person, who already typed in a password to enter the page, to be able to post comments to that page.

    Is this possible?

    Dre

    Edit: Removed formatting. We're not blind.
    Last edited by tech_support; 02-09-2008 at 02:12 AM.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Can it be using MySQL?
    Jeremy | jfein.net

  3. #3
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    It is possible, but depending on the set up you have now, it could be very easy or slightly more difficult to work on your page. You can look at the documentation for fopen, fwrite, file_get_contents, and other file system commands; or look at http://www.php-mysql-tutorial.com for tutorials on using php and mysql for this.

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  4. The Following User Says Thank You to thetestingsite For This Useful Post:

    Benedizione (02-18-2008)

  5. #4
    Join Date
    Mar 2007
    Posts
    68
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default

    Yes, mysql is good.

    My website server is with godaddy. I only learned yesterday about how to setup a database in mysql so I have done that and then do not know where to go from there.

    Dre
    Last edited by tech_support; 02-09-2008 at 02:13 AM.

  6. #5
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Well, I think you can learn MySQL, its really fun! Try it(if you don't KNOW php)
    Jeremy | jfein.net

  7. #6
    Join Date
    Mar 2007
    Posts
    68
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default

    This is the program that I ended up using to password protect my page http://www.zubrag.com/scripts/password-protect.php I had to tweak it to get it the way I wanted it because again, I am not wanting multiple users but so far it is working out very well.

    I don't know if that is any indication about how difficult or simple it might be to set up the "post" function I want to do. But, so far, looking over all this database thing is very complicated for me.

    Dre
    Last edited by tech_support; 02-09-2008 at 02:13 AM.

  8. #7
    Join Date
    Aug 2007
    Location
    Ohio
    Posts
    79
    Thanks
    0
    Thanked 15 Times in 15 Posts

    Default

    There are quite a few ways to do this, but if you're new to PHP most of them probably will be confusing at first. MySQL databases are very common in PHP applications, so learning that approach would likely be the most beneficial later on. Here's another tutorial if you're interested: PHP MySQL Introduction

    Depending on your installation, storing the comments in a XML file might be a possibility. If you have PHP 5 and the SimpleXML extension installed, this is a fairly 'simple' solution. Otherwise, manipulating an XML file may be out of your league right now.

    Another option is to simply store the comments in a text file separating comments however you choose and reading them from the text file. This alternative was already mentioned by thetestingsite. The functions he referenced, fopen, file_get_contents, fwrite can be used to manipulate a file.

  9. #8
    Join Date
    Mar 2007
    Posts
    68
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default

    What does the big red circle with "Edit: Removed formatting. We're not blind" mean? I have not seen that before and I don't get it. Did I do something wrong?

    Dre

  10. #9
    Join Date
    Mar 2007
    Location
    Tarboro, NC
    Posts
    290
    Thanks
    8
    Thanked 2 Times in 2 Posts

    Default

    I believe it means tech_support removed whatever formatting you had, and told you we were not blind. You probably used lots of bolding/coloring, don't worry about it. I can't help you with your thing, MySQL stumps me...

    Tim

  11. #10
    Join Date
    Mar 2007
    Posts
    68
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default

    Well, guys, I am stumped on all this scripting too. I have been working with all kinds of stuff for hours and have not established anything. *grins*

    I did find this example: http://www.instantsitecomments.com/test.html that I like the way it works and it would be great to do this...just a simple task it seems.

    It's not php but isn't there some kind of simple code I could establish to create the same thing? Something that is much less complicated than databases and code I do not understand?



    Dre

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •