oh jesus my browser crashed after i wrote up a nice guide for you x.x i'll try again.....
well it's kind of a big project if you're new. you'll have to create a login, write something that dynamically makes sessions and cookies, make a database of your users and hashed passwords, make a cms to edit that database as the admin, etc. but yes it's definately possible. you should use functions like fopen, fwrite to make the new page.
what you should start with is how to use the data submitted from a form. then worry about making a login and all that later. a form generally looks like this:
Code:
<form action="where_this_form_is_processed.php" method="post" enctype="multipart/form-data">
what should your url be? www.mywebsite.com/members/<input type="text" name="new_url" id="new_page_name" />
<br />
<br />
Whats your name?: <input type="text" name="name" value="" />
<br />
<input type="submit" name="submit" value="Upload" />
</form>
you can have other junk on the form but that's just a basic one for this example. anyway the form above is processed wherever 'action' says. so if this form is on 'www.mywebsite.com/registration.php' you can even have the php code on the registration.php file, and have that say action="registration.php".
what that means is that the data submitted from this form will be posted to the 'action' page. so in your php you can grab things from the form and assign them to variables, like:
Code:
<?php
$new_page = $_POST["new_url"];
?>
so above we've grabbed what was name="new_url" in the form, and assigned it to $new_page the variable. from here we can use fopen and fwrite to make a new page with that variable. although you should have a template ready, with placeholders for more variables. if we just make a new page with the above variable and nothing else, it'll be a blank page.
how to make a template and getting it is a whole different story.
Code:
$put_newpage_here = "members/";
$page_name = $new_page.".html";
$ab = fopen($put_newpage_here.$page_name, "w");
fwrite($ab, $your_template_variable);
fclose($ab);
by the time
Code:
$your_template_variable
is in the above it would need to already be put together as:
Code:
your_template_variable = str_replace($your_placeholders_as_an_array, $your_new_data_to_replace_placeholders_as_an_array, $the_variable_equal_to_the_location_of_your_template);
$the_variable_equal_to_the_location_of_your_template would be the name of the path to your template as a variable appended to the name of your variable. remember that appending in php is just the period, so it would just be:
Code:
$template = "newmember.html";
$template_path = "the_folder_template_is_in/";
$the_variable_equal_to_the_contents_of_your_template = file_get_contents($template_path.$template);
this would have to be executed before fwrite is.
this is what i meant by a whole different story.
anyway your new file would be at mywebsite.com/members/($page_name) after all that. just makes sure the placeholders line up well with the array of new info, then you won't get an empty page but a page full of that template with the right data in it.
hope that wasn't too confusing, but that should get you started.
Bookmarks