Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Closed Thread
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-01-2010, 03:21 PM   PM User | #1
JonathanFenny
New Coder

 
Join Date: Dec 2009
Location: Reading, UK
Posts: 13
Thanks: 5
Thanked 0 Times in 0 Posts
JonathanFenny is an unknown quantity at this point
Exclamation URGENT: Simple PHP script that inserts text into database & shows on next page.

Hello,

Basically I need help creating some PHP code. This will require a MySQL database.

What I want to do is, on the homepage there to be a simple HTML text box and ANYONE can enter text into it, once the text is entered, they click submit. (for example "testing" is entered into the text box) This text box doesn't need any type of captcha or admin verification and the text WILL be stored forever. Once the text "testing" is submitted, it is inserted into the database into 2 tables, "content" and assigned a number in the "ID" table, naturally every time new text is entered, it is assigned a new ID, going up by 1.

Once this has been done, upon clicking "submit" on the text box, it takes you to a new page created with the text on the page that you have just submitted (in this case "testing" will be on the new page) (example URL - http://example.com/page.php?id=1 will contain the text in the "content" table, which is assigned with the "ID" 1, and http://example.com/page.php?id=2 will contain text that has been submitted from the "content" table, with the "ID" 2 )

So there will be 2 pages:

Index.php (will contain the HTML text box that submits text entered, into the database.

Page.php (Will contain text from the database, that has previously been submitted by people, text will be found by entering the "id" to the end of the URL e.g http://example.com/page.php?id=1 from the database, which the text will have previously have been assigned when submitting the text in the first place, in this example it would of been the text "testing".

Sorry it's a lot of text, I tried to explain it as best as possible.


Any help will be massively appreciated.

Feel free to ask any questions.

Best Regards,
Jonathan.




JonathanFenny is offline  
Old 06-01-2010, 03:40 PM   PM User | #2
tomws
Senior Coder

 
tomws's Avatar
 
Join Date: Nov 2007
Location: Arkansas
Posts: 2,644
Thanks: 29
Thanked 330 Times in 326 Posts
tomws will become famous soon enoughtomws will become famous soon enough
Posting "URGENT" will not get you help any faster. Actually, it's worse to claim your work is urgent because many of the people who really know what they're doing won't help you. That means you're stuck with the rest of us.

Furthermore, posting the same question multiple times (even if re-phrased) is typically frowned upon.
__________________
Are you a Help Vampire?
tomws is offline  
Old 06-01-2010, 04:03 PM   PM User | #3
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,292
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
I suggest you pay a professional to do the work for you. We aren't going to spoon feed you code.
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline  
Old 06-01-2010, 05:49 PM   PM User | #4
Dietrevers
New Coder

 
Join Date: May 2010
Location: Mexico
Posts: 14
Thanks: 3
Thanked 1 Time in 1 Post
Dietrevers is an unknown quantity at this point
Use this
PHP Code:
$content $_POST['content']; 
Then create a database and make that content store on that database. Go to the support library of MSDN for more info.
Dietrevers is offline  
Old 06-01-2010, 10:54 PM   PM User | #5
oracleguy
Rockstar Coder


 
Join Date: Jun 2002
Location: USA
Posts: 9,042
Thanks: 1
Thanked 322 Times in 318 Posts
oracleguy is a jewel in the roughoracleguy is a jewel in the roughoracleguy is a jewel in the rough
Please do not post the same question multiple times.

Original thread: http://www.codingforums.com/showthread.php?t=197228
__________________
OracleGuy
oracleguy is offline  
Closed Thread

Bookmarks

Tags
index, page, php, simple, urgent

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:07 PM.


Advertisement
Log in to turn off these ads.