I created a form that collects a title and some content (as well as some other data), and would like to take that title and content and automatically create a link and a new and simple web page for it (think of Craigslist). So, in the end result, when other visitors have populated this table by filling out the form, new visitors see a list of links which are listed by title, select a link, and are then able to view the content. I would like to do this with PHP and MySQL. Can someone please help me get started?
SQL for title and content:
DROP TABLE IF EXISTS newcmsBlock;
CREATE TABLE newcmsBlock (
title VARCHAR(50),
content TEXT
);
Form code:
<form action = "newbuildBlock.php"
method = "post">
<p><input type="text" name="title" size="30" maxlength="30" /> <small>Title</small></p>
<p><textarea name="content" rows="20" cols="30"></textarea> <small>Content</small></p>
<input type="hidden" name="submitted" value="TRUE" />
The main questions I have are:
1) How do I dynamically create the link (and the new URL) with PHP and MySQL?
2) And how do I dynamically create the new webpage, containing the title and description (that were taken from the input of the form, on a previous page)?