Saving Contents of TEXTAREA to File

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
richardstan
Forum Newbie
Posts: 3
Joined: Thu Oct 23, 2008 12:03 pm

Saving Contents of TEXTAREA to File

Post by richardstan »

Hi,

i have a TEXTAREA which has a name value of "CodeData" as part of a form. When i press a submit button, the text in the textarea is passed along in the URL using GET, i.e. Form.php?CodeData=***
The problem is that the data i will be passing will be several hundred characters from a Java file which forms an URL which is far too big and can cause problems.
The processing instructions simply create a file based on the CodeData and other variables passed in the URL.
Are there any Variables which i could use to hold the value of CodeData instead of passing it in the URL, which can then be accessed by my processing script?

Thanks
Richard.
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Saving Contents of TEXTAREA to File

Post by aceconcepts »

Why don't you use POST?
oscardog
Forum Contributor
Posts: 245
Joined: Thu Oct 23, 2008 4:43 pm

Re: Saving Contents of TEXTAREA to File

Post by oscardog »

What the guy above said, or if you want to you could write it to a .txt file..
richardstan
Forum Newbie
Posts: 3
Joined: Thu Oct 23, 2008 12:03 pm

Re: Saving Contents of TEXTAREA to File

Post by richardstan »

Hi,

I have tried using POST to transfer the information from the form to the Processing function, but it adds lots of backslashes to the text which i dont need. Is it possible to reference a PHP function from a HTML form so it runs when a the submit button is pressed?


Richard.
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Saving Contents of TEXTAREA to File

Post by aceconcepts »

PHP needs to somehow get the form data (POST or GET).

Try using POST to submit the data and use stripslashes() (http://uk3.php.net/stripslashes) to remove the slashes.
Post Reply