I've seen a few ideas - figured I'd run it up the flagpole and see if
anyone saluted
Thanks in advance 24 3588
Petyr David wrote:
I've seen a few ideas - figured I'd run it up the flagpole and see if
anyone saluted
Thanks in advance
No, I only salute the American flag :-)
Not being sure of your experience level, I'll give it a shot.
You need to GET or POST the form to a url. In that url, use the
appropriate $_GET or $_POST value to fetch the contents of the textarea.
Then just open a file, write() the data and close() the file. Of
course, you'll want to ensure you have a unique filename so you don't
keep overwriting it. Or, if you just want to append to the file, ensure
you lock the file before opening for append and unlock it after closing it.
Or, did I not understand your question correctly? Or maybe not answer
with sufficient detail?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
Petyr David <ph*****@gmail.comwrote:
> I've seen a few ideas - figured I'd run it up the flagpole and see if anyone saluted
Since you are asking in a PHP newsgroup, I assume you are trying to do this
in a PHP program, in which case it's essentially trivial. What have you
tried?
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Message-ID:
<76**********************************@y38g2000hsy. googlegroups.comfrom
Petyr David contained the following:
>I've seen a few ideas - figured I'd run it up the flagpole and see if anyone saluted
RTFM
--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011 http://slipperyhill.co.uk
On Aug 5, 4:23*am, Petyr David <phyn...@gmail.comwrote:
I've seen a few ideas - figured I'd run it up the flagpole and see if
anyone saluted
You're basically saying this:
"I have a problem, which I don't care to explain properly, but has
something to do with saving forms to files. Solve it for me."
Please read some of this: http://www.catb.org/~esr/faqs/smart-questions.html
You could also find an answer to your question using Google (searching
on "save form file php" or something like that).
<comp.lang.php>
<Petyr David>
<Mon, 4 Aug 2008 19:23:15 -0700 (PDT)>
<76**********************************@y38g2000hsy. googlegroups.com>
I've seen a few ideas - figured I'd run it up the flagpole and see if
anyone saluted
<form action="form_submit.php" method="post">
<textarea cols="55" rows="8" name="demo" class="burp"></textarea>
input type="submit" name="Submit" value="PREVIEW GUESTBOOK ENTRY">
</form>
Then on the next page (i.e. form_submit.php) .....
$james=$_POST['demo'];
$bond=strlen($james);
if ($bond>777) {$james=substr($james,0,777);}
This will cut down and reduce text to characters - working on the
assmption that some idiot will cut-n-paste a 50meg textfile .
$james=str_replace("<","",$james);
$james=str_replace(">","",$james);
Again minor anti abuse stuff that will prevent nasty html code from
being displayed and/or abused .
$james=str_replace("&","",$james);
$james=str_replace("#","",$james);
Some more minor anti abuse stuff .
$filename="walther/ppk.php";
$fp=fopen($filename,"w");
fwrite ($fp,$james); fwrite ($fp,"\n");
fclose($fp);
(cant be bothered to type anything else in)
But the above basic will get you started .
On Aug 5, 1:38*pm, Krustov <m...@privacy.netwrote:
>
$james=str_replace("<","",$james);
$james=str_replace(">","",$james);
Again minor anti abuse stuff that will prevent nasty html code from
being displayed and/or abused .
$james=str_replace("&","",$james);
$james=str_replace("#","",$james);
Would it be faster to use/safer to just user strip_tags ?
<comp.lang.php>
<The Hajj>
<Tue, 5 Aug 2008 13:51:58 -0700 (PDT)>
<75**********************************@l64g2000hse. googlegroups.com>
$james=str_replace("<","",$james);
$james=str_replace(">","",$james);
Again minor anti abuse stuff that will prevent nasty html code from
being displayed and/or abused .
$james=str_replace("&","",$james);
$james=str_replace("#","",$james);
Would it be faster to use/safer to just user strip_tags ?
Wouldnt it be good if people like yourself told newbies how to do stuff
instead of just critisising other peoples posts .
But no - that would kinda take away your smug self satisfying i know
everything but i'm not about to tell others way of thinking wouldnt it .
..oO(Krustov)
>$james=str_replace("<","",$james); $james=str_replace(">","",$james);
Again minor anti abuse stuff that will prevent nasty html code from being displayed and/or abused .
Wrong tool at the wrong place.
>$james=str_replace("&","",$james); $james=str_replace("#","",$james);
Some more minor anti abuse stuff .
Same here. It will kill every legit use of these characters. You should
not manipulate the submitted data, but escape it where necessary. The
correct way to prevent cross-site scripting attacks (which are a _major_
threat BTW!) is to use htmlspecialchars() on data output, not on input.
>$filename="walther/ppk.php"; $fp=fopen($filename,"w"); fwrite ($fp,$james); fwrite ($fp,"\n"); fclose($fp);
file_put_contents() might be another option.
Micha
<comp.lang.php>
<Michael Fesser>
<Tue, 05 Aug 2008 23:20:52 +0200>
<6f********************************@4ax.com>
Wrong tool at the wrong place.
$james=str_replace("&","",$james);
$james=str_replace("#","",$james);
Some more minor anti abuse stuff .
Same here. It will kill every legit use of these characters. You should
not manipulate the submitted data, but escape it where necessary. The
correct way to prevent cross-site scripting attacks (which are a _major_
threat BTW!) is to use htmlspecialchars() on data output, not on input.
Yet another user who only lives to critisise other people posts .
How long has it been since you last posted something useful and actually
helped a user .
..oO(Krustov)
><comp.lang.php> <Michael Fesser> <Tue, 05 Aug 2008 23:20:52 +0200> <6f********************************@4ax.com>
>Wrong tool at the wrong place.
>$james=str_replace("&","",$james); $james=str_replace("#","",$james);
Some more minor anti abuse stuff .
Same here. It will kill every legit use of these characters. You should not manipulate the submitted data, but escape it where necessary. The correct way to prevent cross-site scripting attacks (which are a _major_ threat BTW!) is to use htmlspecialchars() on data output, not on input. Yet another user who only lives to critisise other people posts .
Wrong.
>How long has it been since you last posted something useful and actually helped a user .
4 minutes. Or 20 minutes, if you only take this thread into account.
Your code creates a new problem instead of solving one. I just fixed
your bug.
Micha
<comp.lang.php>
<Michael Fesser>
<Tue, 05 Aug 2008 23:40:21 +0200>
<30********************************@4ax.com>
$james=str_replace("&","",$james);
$james=str_replace("#","",$james);
Some more minor anti abuse stuff .
Same here. It will kill every legit use of these characters. You should
not manipulate the submitted data, but escape it where necessary. The
correct way to prevent cross-site scripting attacks (which are a _major_
threat BTW!) is to use htmlspecialchars() on data output, not on input.
Yet another user who only lives to critisise other people posts .
Wrong.
Your wrong - for people like you tend not to reply to newbies asking
help - unless you can critisise another users post in doing so .
Why else do people like yourself subscribe to what is in effect a help
newsgroup where new users often ask for help .
..oO(Krustov)
><comp.lang.php> <Michael Fesser> <Tue, 05 Aug 2008 23:40:21 +0200> <30********************************@4ax.com>
>$james=str_replace("&","",$james); $james=str_replace("#","",$james);
Some more minor anti abuse stuff .
Same here. It will kill every legit use of these characters. You should not manipulate the submitted data, but escape it where necessary. The correct way to prevent cross-site scripting attacks (which are a _major_ threat BTW!) is to use htmlspecialchars() on data output, not on input.
Yet another user who only lives to critisise other people posts .
Wrong. Your wrong - for people like you tend not to reply to newbies asking help - unless you can critisise another users post in doing so .
If I would just want to criticize you, I would have already mentioned
your stupid punctuation (a blank before the period is just wrong) and
your ridiculous introductory epos (newsgroup is obvious and the msgID
is already in the headers, there's no need to repeat them).
But I don't do that.
>Why else do people like yourself subscribe to what is in effect a help newsgroup where new users often ask for help .
Often enough I directly respond to an OP's question and post code
snippets if possible. And even in this particular case I indirectly
helped the OP by correcting a bug caused by your own code. Tell me: Of
how much help is a "help" that causes a new problem? The next time the
OP would have complained about not being able to post something about a
company called "Miller & Son". Good work, Mr. K.
But it doesn't really surprise me that you don't have the balls to
accept that your code was "suboptimal".
Micha
Michael Fesser wrote:
.oO(Krustov)
><comp.lang.php> <Michael Fesser> <Tue, 05 Aug 2008 23:40:21 +0200> <30********************************@4ax.com>
>>>>>$james=str_replace("&","",$james); >$james=str_replace("#","",$james); >> >Some more minor anti abuse stuff . Same here. It will kill every legit use of these characters. You should not manipulate the submitted data, but escape it where necessary. The correct way to prevent cross-site scripting attacks (which are a _major_ threat BTW!) is to use htmlspecialchars() on data output, not on input. > Yet another user who only lives to critisise other people posts . Wrong.
Your wrong - for people like you tend not to reply to newbies asking help - unless you can critisise another users post in doing so .
If I would just want to criticize you, I would have already mentioned
your stupid punctuation (a blank before the period is just wrong) and
your ridiculous introductory epos (newsgroup is obvious and the msgID
is already in the headers, there's no need to repeat them).
But I don't do that.
>Why else do people like yourself subscribe to what is in effect a help newsgroup where new users often ask for help .
Often enough I directly respond to an OP's question and post code
snippets if possible. And even in this particular case I indirectly
helped the OP by correcting a bug caused by your own code. Tell me: Of
how much help is a "help" that causes a new problem? The next time the
OP would have complained about not being able to post something about a
company called "Miller & Son". Good work, Mr. K.
But it doesn't really surprise me that you don't have the balls to
accept that your code was "suboptimal".
Micha
Micha,
Haven't you learned - he never accepts his code as "suboptimal". It's
always perfect because it's what he uses. And anyone who tries to show
the weaknesses in his code or otherwise make it better gets attacked.
I do agree your way is much better - and safer.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
On Aug 5, 3:10*am, Geoff Berrow <blthe...@ckdog.co.ukwrote:
>
RTFM
Mark this well, you won't see a more pedantic, asinine response to a
question again.
Message-ID: <MP************************@news.newsreader.comfro m
Krustov contained the following:
>Yet another user who only lives to critisise other people posts .
Why not? Your code needs improvement. Doesn't that interest you?
You should try a little humility, you might learn something.
--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011 http://slipperyhill.co.uk
Message-ID:
<31**********************************@m36g2000hse. googlegroups.comfrom an****************@gmail.com contained the following:
>RTFM
Mark this well, you won't see a more pedantic, asinine response to a question again.
New to Usenet, are we?
An asinine question deserves an asinine answer.
--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011 http://slipperyhill.co.uk
<comp.lang.php>
<Michael Fesser>
<Wed, 06 Aug 2008 00:18:05 +0200>
<00********************************@4ax.com>
your stupid punctuation (a blank before the period is just wrong)
What does this have to do with php ? .
Krustov wrote:
<comp.lang.php>
<Michael Fesser>
<Tue, 05 Aug 2008 23:20:52 +0200>
<6f********************************@4ax.com>
>Wrong tool at the wrong place.
>>$james=str_replace("&","",$james); $james=str_replace("#","",$james);
Some more minor anti abuse stuff .
Same here. It will kill every legit use of these characters. You should not manipulate the submitted data, but escape it where necessary. The correct way to prevent cross-site scripting attacks (which are a _major_ threat BTW!) is to use htmlspecialchars() on data output, not on input.
Yet another user who only lives to critisise other people posts .
How long has it been since you last posted something useful and actually
helped a user .
I've never had a post from Micha that wasn't helpful. I've found that
in a group that has many good programmers, he is one of the best, and a
pretty nice guy.
The trouble with tampering with incoming data is that once it is
altered you can't put it back. And what you will need to do with that
data will vary depending on what you are using it for. The OP never
mentioned his reasons.
Myself, I would serializes the data and store it. That way you can
store the whole form.
Jeff
>
Krustov wrote:
<comp.lang.php>
<Michael Fesser>
<Wed, 06 Aug 2008 00:18:05 +0200>
<00********************************@4ax.com>
>your stupid punctuation (a blank before the period is just wrong)
What does this have to do with php ? .
What he is saying is that he isn't trying to attack you, and he could as
your grammar leaves a lot to be desired. I'm surprised that you haven't
been involved in a real personal attack with your confrontational style.
In a low key way he just fixed the problems in your "help", addressing
them and not yourself. This isn't personal until you make it such.
I suggest you don't.
Jeff
<comp.lang.php>
<Jeff>
<Wed, 06 Aug 2008 10:57:50 -0400>
<qt******************************@earthlink.com>
your stupid punctuation (a blank before the period is just wrong)
What does this have to do with php ? .
What he is saying is that he isn't trying to attack you, and he could as
your grammar leaves a lot to be desired. I'm surprised that you haven't
been involved in a real personal attack with your confrontational style.
In a low key way he just fixed the problems in your "help", addressing
them and not yourself. This isn't personal until you make it such.
I suggest you don't.
That sounds like a threat .
On Aug 6, 5:20*pm, Krustov <m...@privacy.netwrote:
<comp.lang.php>
<Jeff>
<Wed, 06 Aug 2008 10:57:50 -0400>
<qtadnS9XoudvJgTVnZ2dnUVZ_ovin...@earthlink.com>
>your stupid punctuation (a blank before the period is just wrong)
What does this have to do with php ? .
What he is saying is that he isn't trying to attack you, and he could as
your grammar leaves a lot to be desired. I'm surprised that you haven't
been involved in a real personal attack with your confrontational style..
In a low key way he just fixed the problems in your "help", addressing
them and not yourself. This isn't personal until you make it such.
* *I suggest you don't.
That sounds like a threat .
You saw that right! Don't make it personal or else Jeff will REMOVE
YOU FROM THE INTERNET!
Egbert Teeselink wrote:
On Aug 6, 5:20 pm, Krustov <m...@privacy.netwrote:
><comp.lang.php> <Jeff> <Wed, 06 Aug 2008 10:57:50 -0400> <qtadnS9XoudvJgTVnZ2dnUVZ_ovin...@earthlink.com >
>>>>your stupid punctuation (a blank before the period is just wrong) What does this have to do with php ? . What he is saying is that he isn't trying to attack you, and he could as your grammar leaves a lot to be desired. I'm surprised that you haven't been involved in a real personal attack with your confrontational style. In a low key way he just fixed the problems in your "help", addressing them and not yourself. This isn't personal until you make it such. I suggest you don't.
That sounds like a threat .
You saw that right! Don't make it personal or else Jeff will REMOVE
YOU FROM THE INTERNET!
Christ.
Don't start another useless flame war. I'm more inclined to remove myself.
Jeff
Jeff
Krustov <me@privacy.netwrote:
> Your wrong - for people like you tend not to reply to newbies asking help - unless you can critisise another users post in doing so .
Why else do people like yourself subscribe to what is in effect a help newsgroup where new users often ask for help .
The problem, Krusty, is that these newsgroups now represent a permanent
archive. Years ago, if you missed a Usenet posting, 30 days later it was
gone forever, so posting a correction had little effect and was generally
considered rude.
Today, thanks to DejaNews and Google and a thousand other companies trying
to make a quick advertising buck, that's not the case. Every post made
here is saved forever in multiple archives, indexed in umpteen different
ways. Next year, or three years from now, some newbie will go looking for
information on textareas, and will come across this thread.
When a thread ends, there is an innate tendency to believe that the last
post in a branch must represent the "generally accepted truth". Because of
that, I see absolutely nothing wrong with posting a correction or an update
to a message that is potentially misleading or only partially correct.
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
<comp.lang.php>
<Tim Roberts>
<Thu, 07 Aug 2008 05:46:16 GMT>
<ip********************************@4ax.com>
When a thread ends, there is an innate tendency to believe that the last
post in a branch must represent the "generally accepted truth". Because of
that, I see absolutely nothing wrong with posting a correction or an update
to a message that is potentially misleading or only partially correct.
If what you say is true - then why isnt it only the first and the last
posts of a thread that get stored - as using your own guideline - thats
all thats needed . This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: grz02 |
last post by:
A question on html-forms:
We have an application where users will get a CD with,
among other things, some html-forms for them to fill in.
When they click the submit-button, the data is...
|
by: Prakashsir |
last post by:
I have desgined script to show div at runtime. Now I want to copy that
newly created div and/or to save in normal html file so that i can see
later.
1. When I select all the content or view its...
|
by: david.lindsay.green |
last post by:
Hello all, I am quite new a web scripting and making web pages in
general and I have stumbled across a problem I have as yet been unable
to solve. I am trying to take the contents of a textarea box...
|
by: Schraalhans Keukenmeester |
last post by:
I want to build a very basic online text editor, to allow customers to
modify their own sites' html content using a simple form with textarea
element.
I read the HTML file like so:
<?PHP
...
|
by: Angus |
last post by:
I have a web page with a toolbar containing a Save button. The Save
button can change contextually to be a Search button in some cases.
Hence the button name searchsavechanges.
The snippet of...
|
by: greg_e |
last post by:
Is there a way to create a form in a local html file where the
contents of the form are written to a local file when a 'save' button
is selected?
It would be nice if it was as easy as changing...
|
by: sowmram |
last post by:
Hi,
I'm trying to create a site very similar to wiki, where you can edit, save.. Generally update data for the future use... This particular program I wanna do it using javascripts...
Please...
|
by: dtbrown |
last post by:
I am working on a project that will locally create XML files. I have an HTML form that uses the Dojo Toolkit and XSLT to create the XML object. Currently I put the XML into a textarea. The used must...
|
by: toretto |
last post by:
Hello,
I have a script php that I use on my website to permit visitors to send me some email with some data, this is the html table code:
<table width="730" border="0" cellpadding="0"...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |