Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #14926
| From | Matthew Carter <m@ahungry.com> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: Newby neds help |
| Date | 2015-02-08 21:55 -0500 |
| Organization | Ahungry (http://ahungry.com) |
| Message-ID | <874mqvbxoz.fsf@ahungry.com> (permalink) |
| References | <6rtcdahf5gqka5aavks1kub18uoqnd7ajl@4ax.com> <mb6999$gmj$4@dont-email.me> <mb6akt$oub$1@solani.org> <mb7o8q$10f$1@dont-email.me> <q3ufdap97pu4skagckk3dc2bn21f3hcn05@4ax.com> |
F. George McDuffee <gmcduffee@mcduffee-associates.us> writes:
> On Sun, 8 Feb 2015 13:27:54 +0000 (UTC), Denis McMahon
> <denismfmcmahon@gmail.com> wrote:
>
>>On Sun, 08 Feb 2015 01:29:17 +0100, Christoph M. Becker wrote:
>>
>>> Denis McMahon wrote:
>>
>>>> Then use php to read the submitted user data from the $_POST or $_GET
>>>> array (depending which form method you use) and process it into your
>>>> survey, using appropriate data validation and verification.
>>
>>> It seems to be noteworthy that the form method should not be subject to
>>> an arbitrary choice of the developer, but rather should comply to RFC
>>> 7231 section 4[1]. Therefore a GET request would be inappropriate,
>>> denis.
>>
>>A POST request may indeed be more appropriate than a GET request, that is
>>a decision for the developer to make. However, there is no rule that
>>states "form data must only be transferred to the server using POST".
>>
>>Up to the OP to choose the mechanism that best suits his data.
> =======================
>
> NB: I use 16 point font in my ng reader because of a vision
> problem, and this may cause "funky" line breaks in the code
> snippits.
>
> Thanks to everyone for their helpful comments and
> suggestions!
>
> We seem to be making asymptotic progress to a solution to
> my undoubtedly stupid problem.
>
> I agree that the POST function is the most appropriate.
> There is no need to cache the url or bookmark it.
>
> My problem is I can't get the flaming POST function/command
> to work no matter what I try.
>
> the visitor counter works fine
> <snip>
> <span class="auto-style35">You are visitor # <script
> src="http://mcduffee-associates.us/PHP/hitctr/counter.php?page=dummy"></script>
> </span></td>
> </snip>
> and MDItab.php [for Major Depression Inventory + tab
> delimited] to append the data to a file is located is
> located in the same directory.
>
> Please show me *EXACTLY* what the client side POST should
> look like to send window.upstring which is the concatenated
> tab delimited data string to MDItab.php *AND*
>
> *EXACTLY* what the function in MDItab.php should be to
> receive the data string and assign it to a variable.
>
> My last effort was:
>
> <?php
> // Work In Progress !!!!!!!!!!!!!!!!!!!
> // cut and paste from web
> // 21 June 14 GmcD
> // how called in HTML: <script
> src="http://mcduffee-associates.us/PHP/MDI/MDItab.php?MDIstring=window.upload"></script>
> // ?? no quotes because I want variable contents, not
> variable name window.upload
> // <script src= MyURLstring></script>
> $MDIstring = $_GET[MDIstring]
> {{{{Q: should MDIstring in sq brackets be window.upstring?
> I tried this and no workee}}}}
> print('got to MDItab.php' );
> // Did data string load??
> if ( ! isset($_GET['MDIstring']) ) // quotes?
> {
> die('ERROR: 'PROBLEMS WITH UpYouGo/MDItab.php');
> } // end data xfer check
> </snip>
>
> If I can get the data across, I can take it from there.
>
> This is where my problem is. No combination or permutation
> of the examples on the web or in several "dummy's guides"
> has worked. I need something more than a black box with the
> notation, "here the magic happens."
>
> also tried this -- NO WORKEE
> <snip>
> //
> // directly writes to file.
> $handle =
> fopen('http://www.mcduffee-associates.us/post/mdi/mdidta.tsv',
> 'ab');
> // 'ab' is append binary, may need to change to 'at' for
> /cr/lf xlation
> // int fwrite( resource $handle , string $string [, int
> $length ] )
> intval fwrite( resource $handle, string $window.upload )
> // bool fclose ( resource $handle )
> boll fclose( resource $handle )
> //
> </snip>
>
> Unka' George
Don't fopen() an URL, use the filesystem's file path.
For your javascript, get firefox + firebug for a much easier time
debugging what is going on (or an equivalent such as Chromium's built in
inspector), as you can enter a javascript statement at a time in the REPL.
--
Matthew Carter (m@ahungry.com)
http://ahungry.com
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Newby neds help F. George McDuffee <gmcduffee@mcduffee-associates.us> - 2015-02-07 14:38 -0600
Re: Newby neds help Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2015-02-07 16:31 -0500
Re: Newby neds help "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-02-07 23:30 +0100
Re: Newby neds help Tim Streater <timstreater@greenbee.net> - 2015-02-07 22:36 +0000
Re: Newby neds help Denis McMahon <denismfmcmahon@gmail.com> - 2015-02-08 00:06 +0000
Re: Newby neds help "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-02-08 01:29 +0100
Re: Newby neds help Jerry Stuckle <jstucklex@attglobal.net> - 2015-02-07 20:22 -0500
Re: Newby neds help "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-02-08 02:33 +0100
Re: Newby neds help Jerry Stuckle <jstucklex@attglobal.net> - 2015-02-07 20:54 -0500
Re: Newby neds help Denis McMahon <denismfmcmahon@gmail.com> - 2015-02-08 13:27 +0000
Re: Newby neds help "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-02-08 15:22 +0100
Re: Newby neds help Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-02-08 21:58 +0100
Re: Newby neds help "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-02-08 22:56 +0100
Re: Newby neds help Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-02-08 23:36 +0100
Re: Newby neds help "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-02-09 00:14 +0100
Re: Newby neds help Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-02-09 00:42 +0100
Re: Newby neds help "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-02-09 00:58 +0100
Re: Newby neds help Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-02-09 00:30 +0100
Re: Newby neds help "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-02-10 00:53 +0100
Re: Newby neds help Denis McMahon <denismfmcmahon@gmail.com> - 2015-02-08 21:46 +0000
Re: Newby neds help "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-02-09 00:40 +0100
Re: Newby neds help Denis McMahon <denismfmcmahon@gmail.com> - 2015-02-09 19:34 +0000
HTTP (was: Newby neds help) "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-02-10 02:04 +0100
Re: Newby neds help F. George McDuffee <gmcduffee@mcduffee-associates.us> - 2015-02-08 20:06 -0600
Re: Newby neds help Matthew Carter <m@ahungry.com> - 2015-02-08 21:55 -0500
Re: Newby neds help F. George McDuffee <gmcduffee@mcduffee-associates.us> - 2015-02-09 00:13 -0600
Re: Newby neds help Tim Streater <timstreater@greenbee.net> - 2015-02-09 09:46 +0000
Re: Newby neds help "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-02-10 01:14 +0100
Re: Newby needs help F. George McDuffee <gmcduffee@mcduffee-associates.us> - 2015-02-07 19:29 -0600
Re: Newby needs help "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-02-08 02:40 +0100
Re: Newby needs help Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2015-02-07 21:36 -0500
Re: Newby neds help Jerry Stuckle <jstucklex@attglobal.net> - 2015-02-07 21:33 -0500
Re: Newby neds help Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2015-02-09 20:02 -0500
csiph-web