| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| Simple Guestbook; The PHP Script | |
|---|---|
| Tweet Topic Started: Apr 9 2005, 06:08 PM (597 Views) | |
| shockwave- | Apr 9 2005, 06:08 PM Post #1 |
|
My other title is a Ferrari
![]() ![]() ![]() ![]()
|
Does anyone have a good script, or link to a script for a simple guestbook? I have avalible installations, but I want to have guestbooks on many different pages, not just one (like reviewing an article). I don't know anything about MySQL, and I don't want people to log in. :unsure: Remember, pretty simple, just a name and a message and it displays it on the page that the form is on. Thanks. |
![]() |
|
| Jory | Apr 10 2005, 04:16 AM Post #2 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
This should do it. (I think. Changed it a bit from what I use, so.) If you don't want the title to be <h1>, you should put an <br> at the end of $message. (Like this, new messages get put on top. fputs($pointer,"$title\n$wrighter<BR>\n$oldmessage\n$message\n"); this will put new messages at the bottom. ) Hope this helps you
|
![]() |
|
| shockwave- | Apr 10 2005, 03:29 PM Post #3 |
|
My other title is a Ferrari
![]() ![]() ![]() ![]()
|
Thanks. First, I had some troubles, then I CHMODDED, and got it to work. Thanks for the code Qj. ![]() Crap, :/ Now, I got it to write on the page, but it posts on top of the submit box. I want it to post Below the forms. Any suggestions? |
![]() |
|
| Jory | Apr 12 2005, 04:12 PM Post #4 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
What is the code you are using exactly? (There is no line in the script I gave you that reads the .txt file.) |
![]() |
|
| shockwave- | Apr 14 2005, 07:27 PM Post #5 |
|
My other title is a Ferrari
![]() ![]() ![]() ![]()
|
Great, got it working. Thanks. |
![]() |
|
| Undead | Apr 14 2005, 11:28 PM Post #6 |
|
Member
![]() ![]() ![]() ![]()
|
Can somone tell me what this code actually does? |
![]() |
|
| Jory | Apr 15 2005, 04:38 AM Post #7 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
What version do you wanna read? Long version: First, it checkes if $_POST["name"] etc. are filled in. If not, it will dislay the fill-in form. ( <form> to </form> ) If they are set, it will open the .txt file where you want the messages put in. $pointer = fopen($datafile,"r+") means that when using $pointer, the file will be opend with read/write rights. Then, it puts all the text in the file in $oldmessage (the $oldmessage = fread($pointer,filesize($datafile)); line does that) Then it puts the message you enterd in $message, the lines under that are for taking out double spaces, special characters, etc. Then it sets the current date to $day, then the name you filled in ($name) and the date to $wrighter ($wrighter has some stuff for making it look nice in it two). Then puts $pointer (which opens the file) to the begin of the file. fputs($pointer,"$title\n$wrighter<BR>\n$message\n$oldmessage\n"); that line puts alle the stuff in the .txt file. Short version: It takes the stuff you fil in into the form and puts that stuff in a .txt file. |
![]() |
|
| lordshaun | Apr 15 2005, 05:27 AM Post #8 |
|
join my forum :D
![]() ![]() ![]() ![]()
|
wow the code looks confusing |
![]() |
|
| Jory | Apr 15 2005, 06:26 AM Post #9 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I didn't understand how that stuff worked eigther. But then I started to play around with it a bit, most of the time just doing that makes it easier to understand (for me anyway) |
![]() |
|
| shockwave- | Apr 15 2005, 03:51 PM Post #10 |
|
My other title is a Ferrari
![]() ![]() ![]() ![]()
|
Basically, it posts a message a user types in a form, on a page. It's good for guestbooks. Really, it's a very simple forum, if you think abou it. I don't know PHP at all, just used a little HTML formatting, and got it posting how I wanted.
|
![]() |
|
| DDM | Apr 16 2005, 08:28 PM Post #11 |
|
Member
![]() ![]() ![]() ![]()
|
Lord Shaun why dont you put that avatar of yours in your signature..... |
![]() |
|
| KodeCing | Apr 19 2005, 12:27 AM Post #12 |
|
Member
![]() ![]() ![]()
|
A text file? What the hell are you thinking? It's all about the MySQL... |
![]() |
|
| Jory | Apr 19 2005, 09:44 AM Post #13 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Well, SQL servers are a bit harder to find, aren't they? And for this, a txt will do just fine. (And I'm pretty sure this code is faster to )But if you think he needs a script that uses SQL, why don't you make it. (Ok, its not that hard it you know some SQL, but if you did, you'd also know its 'code' and not 'kode' <_< ) |
![]() |
|
| shockwave- | Apr 19 2005, 05:07 PM Post #14 |
|
My other title is a Ferrari
![]() ![]() ![]() ![]()
|
Well, I changed the script to write in an HTML file. Works fine. Just format a bit, and you're good. |
![]() |
|
| stevio27 | Apr 20 2005, 11:02 AM Post #15 |
|
That one guy
![]() ![]() ![]() ![]() ![]() ![]()
|
I've made a Guestbook in a much simpler way: Make a forum called Guestbook, and post a topic in there. Then make the forum into a redirect link to the reply page for that topic. Then add a link for viewing the all-ready posted entries in the forum description. |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Technology Chat · Next Topic » |
| Track Topic · E-mail Topic |
4:02 PM Jul 11
|



![]](../../../../0/1/0/p601690/pipright.png)




4:02 PM Jul 11