Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Dec 2009
    Location
    Reading, UK
    Posts
    13
    Thanks
    5
    Thanked 0 Times in 0 Posts

    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.





  • #2
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    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?

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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!||||

  • #4
    New Coder
    Join Date
    May 2010
    Location
    Mexico
    Posts
    14
    Thanks
    3
    Thanked 1 Time in 1 Post
    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.

  • #5
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Please do not post the same question multiple times.

    Original thread: URGENT: Simple PHP script that creates a new page upon user text submission.
    OracleGuy


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •