July 24, 200818 yr I was just wondering how would you go about creating a form so that when it is filled out, all the information in the form is then displayed on an page which is created as soon as the user submits the form.
July 24, 200818 yr hi in your php script you need to set an header header("Location: thank_you.htm"); then create a page called thank_you.htm in the thank_you.htm page you will need the poseted info that as been submited so say $name=$_POST['name'];//name been the name of the inputed type $email=$_POST['email'];//again email been the name of the inputed type then just echo $name and $ email i am assuming you no a bit about php and can modify a script if not show us you contact form and we can do a script to suit that html form goog luck
July 24, 200818 yr You would have to use PHP or the like with a database. Each record in a database would be a page so would include the main content, title, etc. You would need to create a form which would insert the contents of the form into the database which then becomes a 'page' You then use PHP to extract the information out of the database in whatever format you want your pages to be in. You would also have to get it to spit out a link for everyone of the pages (records) created. Try using WordPress and analysing the database that creates.
July 24, 200818 yr You would have to use PHP or the like with a database. Each record in a database would be a page so would include the main content, title, etc. You would need to create a form which would insert the contents of the form into the database which then becomes a 'page' You then use PHP to extract the information out of the database in whatever format you want your pages to be in. You would also have to get it to spit out a link for everyone of the pages (records) created. Try using WordPress and analysing the database that creates. would you realy need a database if the infomation is only going to be viewed once the form is submited if the form information is going to be required at a later date then yes but if its just going to be view after the form is submited then i just use an header location i am presuming its just a contact form that is been emailed and then you wish the user to see a thank you message and the information he or she as submited
July 24, 200818 yr mmm I think one of us is getting the wrong end of the stick, I thought Mark wanted to be able to fill out a form then have it become a permanent page with information on much like what WordPress offers. If it's a contact form like you say then no I definitely wouldn't use a database.
July 24, 200818 yr Author Thanks for the replies. I'll describe further: First Name: MarkSurname: Dunn Name of page you want created: markdunn So now we have the details. Let me explain. I was wondering how you would, after this form is submitted, a new page is created in the directory name "markdunn.html" (as that's what the user typed) and then all the information is displayed from that form. And yes, information would need to be stored on a database, I understand and I know how to get it using PHP. However, I'm not sure how you automatically create a page. Bear in mind, another user may come along as enter their details and after it's submitted, a new page would be made with their page name. I hope this helps.
July 24, 200818 yr Thanks for the replies. I'll describe further:So now we have the details. Let me explain. I was wondering how you would, after this form is submitted, a new page is created in the directory name "markdunn.html" (as that's what the user typed) and then all the information is displayed from that form. And yes, information would need to be stored on a database, I understand and I know how to get it using PHP. However, I'm not sure how you automatically create a page. Bear in mind, another user may come along as enter their details and after it's submitted, a new page would be made with their page name. I hope this helps. i see i am no expert at this but i have been experimenting what i have done is just created one page then from the users username displayed their details of the mysql database on that page if this is the corect method i can send you the script but i am no expert and their may be an easier way see what suggestions any one else comes up with first though
July 24, 200818 yr Author No, from what you've explained, I understand that your form is submitted into a database and then a seperate page displays all the data selected from that database and displays it. I mean, person no.1 fills out a form with his details. Once submitted, a new page is created with all his details. Person no. 2 comes along, fills out the same form, but another unique page for him is created. The same for everyone else. Imagine it like this. Your on Bebo or MySpace. You register, you get your own page. That's what I mean.
July 24, 200818 yr Bebo and MySpace don't create a new page in the directory for every member! They do it how I tried to explain in my first post. Every member is simply a record in a database.
July 24, 200818 yr Author Oh, I see. So it's simply just one page, but whenever the person logs in, their details are dragged from the database and placed onto that one page?
July 24, 200818 yr Ok ... so maybe I can shed some light on the problem Let's start with some data that the user submits: You have a form with a input field (username) and a textarea (text), then the user submits this data: username: Michael text: this is some text You have a php file that accepts the submitted data and saves it in a table with these columns: ID | USERNAME | TEXT Now, in order to retrieve that data from the database you can have another php file that accepts a parameter, for example: display_userpage.php?id=1 OR display_userpage.php?username=michael CAREFUL ! If ID is the primary key you have no problems with duplicates (if you use auto increment), but if you use the username as a parameter you can expect or prevent duplicates. If you're familiar with php and mysql, you can simply write a script for your page that gets the last 10 users for example and displays links for their pages: //database connection & stuff sql to get last 10 users: "SELECT username, text FROM users ORDER BY id DESC LIMIT 10" You can use PHP to dynamically generate the links on your page: <a href="http://www.mywebsite.co.uk/<?php echo $id_from_db;?>/<?=$username_from_db?>"><?=$username_from_db?></a> (Notice I've used both echo and a short tag <?= to display php variables) You can even use apache's mod_rewrite to get URLS like: mywebsite.co.uk/michael mywebsite.co.uk/rob OR if you accept duplicates mywebsite.co.uk/1/michael mywebsite.co.uk/2/rob
July 24, 200818 yr Author Yeah that helps a lot mate. If you don't mind, I'm gonna PM you about this, thanks again everyone.
Create an account or sign in to comment