Within the script below, you will notice something that's posted within the form entitled "shorturl." Ultimately I must take that value and employ it to develop a unique URL that shows all the posted data in the form.

This is actually the form in which a user will submits the information:

    <html>
    <body>

    <p>Required fields are <b>bold</b></p>

    <form action="contact.php" method="post">
<p><b>Author's Name:</b> <input type="text" name="author" /><br />
<p>Company Name: <input type="text" name="company" /><br />
<p>Address:<br /><textarea name="address" rows="5" cols="40"></textarea></p>
<p>Phone Number: <input type="text" name="phone" /><br />
<b>Title:</b> <input type="text" name="title" /><br />
<p><b>One Word Description:</b> <input type="text" name="shorturl" /><br />
<p><b>Full Description:</b><br />
<textarea name="comments" rows="10" cols="40"></textarea></p>

<p><input type="submit" value="submit"></p>

<p> </p>

</form>

</body>
</html>

The following little bit of code may be the contact.php page which will output the consumer data:

<?php


/* Check all form inputs using check_input function */
$author = check_input($_POST['author'], "Enter your name");
$company = check_input($_POST['company']);
$address = check_input($_POST['address']);
$phone = check_input($_POST['phone']);
$shorturl = check_input($_POST['shorturl'], "Provide a single word description");
$title  = check_input($_POST['title'], "Write a title");
$comments = check_input($_POST['comments'], "Provide a full description");




/* Functions we used */
function check_input($data, $problem='')
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
if ($problem && strlen($data) == 0)
{
    show_error($problem);
}
return $data;
}

function show_error($myError)
{
?>
<html>
<body>

<b>Please correct the following error:</b><br />
<?php echo $myError; ?>

</body>
</html>
<?php
exit();
}
?>

<head>
    <title><?php echo $_POST['title']; ?></title>
</head>
<body>

<p>
<b><?php echo $_POST['title']; ?></b><br>
Created by:<br> 
<?php echo $_POST['author']; ?><br>
<?php echo $_POST['company']; ?><br>
Contact: <br>
<?php echo $_POST['phone']; ?><br>
<?php echo $_POST['address']; ?><br>
Flyer Description: <br>
<?php echo $_POST['comments']; ?><br>
</p>

</body>
</html>

Because you will find out if you take this type, the function is fairly fundamental. Here's where I want the help. Within the initial make up the "shorturl" value is taken. The purpose of the shorturl value is the following:

If the form was located on examplesite.com, i quickly would ultimately like for that form that's produced to be shown with posted solutions at examplesite.com/shorturl

To begin with, how do you verify this is actually just one word via PHP? If your user submits the shorturl value as "House" i quickly require the form to come back the worthiness as true, but when the consumer submits "Huge Home" then your value is fake and they have to affect the value to something that's acceptable for example "BigHouse"

Next, I have to verify the shorturl value is exclusive towards the site. Quite simply, when a shorturl has been utilized, that value must be delivered to the MySQL database to ensure that it won't be duplicated by another user. To carry on our example, if a person already had "House" his or her shorturl value then your full Link to examplesite.com/Home is already taken. Then if your new user comes and attempts to use "House" the submission will provide an error message that states the title is taken.

And lastly, how do you get all this information to auto-produce a unique web page using the form results? To have an example let us continue examplesite.com/House At this time, whenever a user submits the shape, the information is shown on examplesite.com/contact.php. How do you produce a URL which may display the shape data and become unique as based on the shorturl and become viewable to a 3rd party site customer without posting new data?

Wow. Hopefully all is sensible.

I understand you will find several questions in here, if you are only able to help with a measure that's fine. If you're able to tackle this whole problem then more energy for you :)

I've done a reasonable quantity of research about this and i'm convinced that the very first 2 questions should have the ability to be solved with PHP, however the third might involve a mod_rewrite purpose of some kind. I am unable to thanks enough to get this far with my query and several thank you if you're able to give a solution.