Jump to content

Changing A Guestbook


herghost

Recommended Posts

Instead of when a user posts a message in simple guestbook, like using the below code and writing to the variables

 

`id` int(4) NOT NULL auto_increment,
`name` varchar(65) NOT NULL default '',
`email` varchar(65) NOT NULL default '',
`comment` longtext NOT NULL,
`datetime` varchar(65) NOT NULL default '',

 

how would I go about, instead of writing a comment on a page, to making the post appear on its own NEW page, and also accept HTML?

I have been looking into fwrite but I cant seem to work out how to get this to add a new page in html and not a .txt file.

 

Thanks for any guidance

Link to comment
https://forums.phpfreaks.com/topic/117174-changing-a-guestbook/
Share on other sites

well, the info you provided is for Databases, you mean that you want to write the HTML code to write the input for your guestbook then insert it into a Database?

 

Also, unless you want to type the 'id' manually, I recommend to use the one below as it will automatically insert an 'id'

`id` int(4) PRIMARY KEY AUTO_INCREMENT,
`name` varchar(65) NOT NULL default '',
`email` varchar(65) NOT NULL default '',
`comment` longtext NOT NULL,
`datetime` varchar(65) NOT NULL default '',

Link to comment
https://forums.phpfreaks.com/topic/117174-changing-a-guestbook/#findComment-602706
Share on other sites

Sorry bad example to give,

 

Basically I want the user to fill out a form, and then the content of the form is turned into a new html page and stored on the server. So basically the user can create a single webpage and upload it at a click of a button on my server.

 

Does that make more sense?

Link to comment
https://forums.phpfreaks.com/topic/117174-changing-a-guestbook/#findComment-602714
Share on other sites

Why would you do that?  You can just make them on the fly by pulling info from a database, like a forum does.  These pages aren't actually here, they're just generated by the database.  (Well, I the code for index.php and viewtopic.php and all that stuff is there, but most of the content is from the db)

Link to comment
https://forums.phpfreaks.com/topic/117174-changing-a-guestbook/#findComment-602733
Share on other sites

Thanks Darkwater,

 

So you think I would be better off taking the code from a forum script and using that to display pages? Would it be possible to edit it as far as making each post a single page and not allowing any more posts to be edited? Or do you think I would be better off creating it from scratch?

 

 

Link to comment
https://forums.phpfreaks.com/topic/117174-changing-a-guestbook/#findComment-602764
Share on other sites

I wasn't suggesting actually USING a forum script to try to make a guestbook...that's counter-productive.  If you have extra posts and pages and all that stuff, I'd consider it more of a blog than a guestbook at that point.  You can create your own or use something like Wordpress.  If you want to create your own, I'm sure we can help.  Something like this isn't too hard.

Link to comment
https://forums.phpfreaks.com/topic/117174-changing-a-guestbook/#findComment-602767
Share on other sites

Thanks :)

 

I think I will try an create my won, I should at least learn something that way!

 

Basically my end product should be a web site where every page is created by a different user, and they should be indexed on the main page as well as a random link to one of the pages, ideally I want the user to be able to just fill in a pre designed template if that makes sense, so they basically register, click on a link to add page, the template pops up, they fill in all the details they want on the page and then click save, the page is then stored, accessed from the index page and can be edited by admin and the author.

 

Where would you suggest starting for this? I know some basic PHP and MySQL but am no means and expert, so my apologies if I miss something helpful :)

 

Thanks for your help so far.

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/117174-changing-a-guestbook/#findComment-602813
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.