PHP form question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeanine

    PHP form question

    I'am new to php and have a question.
    I have a php form with a textarea (name = MyData) and like to add the text
    to a variable.
    After that i 'd like to store this info to my database.

    How can i add this text to a variable ?

    I appreciate some help,

    Jeanine


  • Andy Hassall

    #2
    Re: PHP form question

    On Sat, 15 Oct 2005 16:38:13 +0200, "Jeanine" <Jeanine@nomail .notvalid> wrote:
    [color=blue]
    >I'am new to php and have a question.
    >I have a php form with a textarea (name = MyData) and like to add the text
    >to a variable.
    >After that i 'd like to store this info to my database.
    >
    >How can i add this text to a variable ?[/color]



    --
    Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
    http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

    Comment

    • Robizzle

      #3
      Re: PHP form question

      W3 School's tutorial is a good one too,
      W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.


      Comment

      • scott Johnson

        #4
        Re: PHP form question

        I would recommend that you do read the sources that Andy and Robizzle
        sent but here is a down and dirty way to do it.

        Your 'textarea' will send the data just like all the other fields and
        can be accessed in the $_POST[] globalvariable array.

        So if you set a text filed like:
        <textarea name="MyData" cols="30" rows="3" id="MyData"><?p hp echo
        $my_data;?></textarea>

        The the data sent will be in the variable $_POST['MyData'].

        Then on your processing page just retrieve that data and place it in
        your database.
        It is probably a good idea to make sure the Table Field is a 'text'
        field type to handle large inputs or such.

        $my_data = $_POST['MyData'];
        $insert = "INSERT INTO tableName(MyDat a)VALUES($my_da ta)";

        I hope this is what you are looking for.
        If you need more help or more details on error checking or such post
        here or write me at: scottyj1@cox.ne t




        Jeanine wrote:[color=blue]
        > I'am new to php and have a question.
        > I have a php form with a textarea (name = MyData) and like to add the text
        > to a variable.
        > After that i 'd like to store this info to my database.
        >
        > How can i add this text to a variable ?
        >
        > I appreciate some help,
        >
        > Jeanine
        >
        >[/color]

        Comment

        • Jeanine

          #5
          Re: PHP form question

          Thanks all of you.
          I take some time to work with it.
          Thanks for the links and example.

          Jeanine


          Comment

          Working...