Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #1536 > unrolled thread
| Started by | Charlie <shymathguy@gmail.com> |
|---|---|
| First post | 2011-05-11 14:25 -0700 |
| Last post | 2011-05-12 19:30 -0400 |
| Articles | 15 — 7 participants |
Back to article view | Back to comp.lang.php
Program to Submit to forms Charlie <shymathguy@gmail.com> - 2011-05-11 14:25 -0700
Re: Program to Submit to forms JohnT <john@example.com> - 2011-05-11 22:17 +0000
Re: Program to Submit to forms MacRoks <macroks@aim.com> - 2011-05-11 20:19 -0400
Re: Program to Submit to forms Charlie <shymathguy@gmail.com> - 2011-05-11 17:47 -0700
Re: Program to Submit to forms Charlie <shymathguy@gmail.com> - 2011-05-11 18:02 -0700
Re: Program to Submit to forms Denis McMahon <denis.m.f.mcmahon@gmail.com> - 2011-05-12 04:21 +0000
Re: Program to Submit to forms stephen.slator@yahoo.com - 2011-05-11 22:29 -0700
Re: Program to Submit to forms Charlie <shymathguy@gmail.com> - 2011-05-12 04:25 -0700
Re: Program to Submit to forms Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-12 09:26 -0400
Re: Program to Submit to forms Charlie <shymathguy@gmail.com> - 2011-05-12 12:43 -0700
Re: Program to Submit to forms Denis McMahon <denis.m.f.mcmahon@gmail.com> - 2011-05-12 22:58 +0000
Re: Program to Submit to forms Denis McMahon <denis.m.f.mcmahon@gmail.com> - 2011-05-13 02:55 +0000
Re: Program to Submit to forms Charlie <shymathguy@gmail.com> - 2011-05-13 15:42 -0700
Re: Program to Submit to forms The Natural Philosopher <tnp@invalid.invalid> - 2011-05-14 00:58 +0100
Re: Program to Submit to forms Jerry Stuckle <jstucklex@attglobal.net> - 2011-05-12 19:30 -0400
| From | Charlie <shymathguy@gmail.com> |
|---|---|
| Date | 2011-05-11 14:25 -0700 |
| Subject | Program to Submit to forms |
| Message-ID | <963a1bbc-e72d-48d7-8807-72954cef9844@dn9g2000vbb.googlegroups.com> |
Hello, I need to write a web site that does the following: 1. The web site has a list of 10 various URLs. 2. Each URL has a form - the same form. 3. The user enters data that is then input into each of the forms and the form is submitted as if a person entered the data into the 10 forms and clicked on submit. Can I do that in PHP? How about in other programming languages? Thanks, Charlie
[toc] | [next] | [standalone]
| From | JohnT <john@example.com> |
|---|---|
| Date | 2011-05-11 22:17 +0000 |
| Message-ID | <iqf1t5$n8m$2@dont-email.me> |
| In reply to | #1536 |
On Wed, 11 May 2011 14:25:22 -0700, Charlie wrote: > Hello, > > I need to write a web site that does the following: > > 1. The web site has a list of 10 various URLs. 2. Each URL has a form - > the same form. 3. The user enters data that is then input into each of > the forms and the form is submitted as if a person entered the data into > the 10 forms and clicked on submit. > > Can I do that in PHP? Yes. > How about in other programming languages? Yes.
[toc] | [prev] | [next] | [standalone]
| From | MacRoks <macroks@aim.com> |
|---|---|
| Date | 2011-05-11 20:19 -0400 |
| Message-ID | <2011051120191639286-macroks@aimcom> |
| In reply to | #1536 |
On 2011-05-11 17:25:22 -0400, Charlie said: > "The user enters data that is then input into each of the forms and > the form is submitted as if a person entered the data into the 10 > forms and clicked on submit." > > Can I do that in PHP? Assuming you are using a form handler to process the data entered, why not use a loop to run the handler 10 times? -- MacRoks --------------------------- Kindle 3 Wifi+3G MacBook iPod Touch 3G 64 GB HP Palm Pre
[toc] | [prev] | [next] | [standalone]
| From | Charlie <shymathguy@gmail.com> |
|---|---|
| Date | 2011-05-11 17:47 -0700 |
| Message-ID | <7ad4f7eb-f4c3-4849-afd2-96c75676b925@u15g2000vby.googlegroups.com> |
| In reply to | #1539 |
On May 11, 8:19 pm, MacRoks <macr...@aim.com> wrote: > On 2011-05-11 17:25:22 -0400, Charlie said: > > > "The user enters data that is then input into each of the forms and > > the form is submitted as if a person entered the data into the 10 > > forms and clicked on submit." > > > Can I do that in PHP? > > Assuming you are using a form handler to process the data entered, why > not use a loop to run the handler 10 times? Well, logically, either I don't know how to write a loop that iterates 10 times or I don't know what a form handler is and your assumption is wrong. But I will try to look it up unless someone tells me first. Thanks > -- > MacRoks > --------------------------- > Kindle 3 Wifi+3G > MacBook > iPod Touch 3G 64 GB > HP Palm Pre
[toc] | [prev] | [next] | [standalone]
| From | Charlie <shymathguy@gmail.com> |
|---|---|
| Date | 2011-05-11 18:02 -0700 |
| Message-ID | <cf1719f9-b756-4949-a979-bb381bd7d7ac@y31g2000vbp.googlegroups.com> |
| In reply to | #1539 |
On May 11, 8:19 pm, MacRoks <macr...@aim.com> wrote: > On 2011-05-11 17:25:22 -0400, Charlie said: > > > "The user enters data that is then input into each of the forms and > > the form is submitted as if a person entered the data into the 10 > > forms and clicked on submit." > > > Can I do that in PHP? > > Assuming you are using a form handler to process the data entered, why > not use a loop to run the handler 10 times? Every reference to form handler seems to be a way (higher level) to create forms for your own page. What I am trying to do is take 10 URLS www.aaa.com, www.bbb.com,...,www.jjj.com each of which has the same (in general, a known) form and take the user's input and simulate their having connected to www.aaa.com etc. and entered that input into the form on each of these arbitrary URLs. They actually connect to www.mynewwebsite.com and enter it once and my program makes it as if they entered it into the 10 sites and the 10 sites will receive and process the form without the user connecting to the 10 URLs. Charlie > -- > MacRoks > --------------------------- > Kindle 3 Wifi+3G > MacBook > iPod Touch 3G 64 GB > HP Palm Pre
[toc] | [prev] | [next] | [standalone]
| From | Denis McMahon <denis.m.f.mcmahon@gmail.com> |
|---|---|
| Date | 2011-05-12 04:21 +0000 |
| Message-ID | <4dcb6032$0$9518$bed64819@gradwell.net> |
| In reply to | #1541 |
On Wed, 11 May 2011 18:02:40 -0700, Charlie wrote: > Every reference to form handler ... blah Charlie. You asked two questions. One question was "Can I do x using php?" The answer is yes, and that was the answer you were given. If you meant to ask "How do I ..." then ask "How do I ..." The other question you asked was "Can I do x using other languages?" and again you were given the answer yes, because yes is again the correct answer. If you're looking for a method to make a php script load a page from a website, look at the curl module of php. Assuming you have an array of website urls and some formdata, you could, for example, use a foreach loop to iterate over the array and curl to submit the formdata to each website in turn. curl: http://www.php.net/manual/book.curl.php foreach: http://www.php.net/manual/control-structures.foreach.php arrays: http://www.php.net/manual/language.types.array.php Rgds Denis McMahon
[toc] | [prev] | [next] | [standalone]
| From | stephen.slator@yahoo.com |
|---|---|
| Date | 2011-05-11 22:29 -0700 |
| Message-ID | <21af6dba-e2a7-46fb-9ac2-119dcca64624@m40g2000vbt.googlegroups.com> |
| In reply to | #1543 |
On May 12, 7:21 am, Denis McMahon <denis.m.f.mcma...@gmail.com> wrote: > On Wed, 11 May 2011 18:02:40 -0700, Charlie wrote: > > Every reference to form handler ... blah > > Charlie. > > You asked two questions. One question was "Can I do x using php?" > > The answer is yes, and that was the answer you were given. > > If you meant to ask "How do I ..." then ask "How do I ..." > > The other question you asked was "Can I do x using other languages?" and > again you were given the answer yes, because yes is again the correct > answer. > > If you're looking for a method to make a php script load a page from a > website, look at the curl module of php. > > Assuming you have an array of website urls and some formdata, you could, > for example, use a foreach loop to iterate over the array and curl to > submit the formdata to each website in turn. > > curl:http://www.php.net/manual/book.curl.php > foreach:http://www.php.net/manual/control-structures.foreach.php > arrays:http://www.php.net/manual/language.types.array.php > > Rgds > > Denis McMahon when I need to build a form with correct code, I prefer to use <a href="http://phpforms.net">php forms</a>. I'm not very good in coding, and can not suggest you any advice in coding.
[toc] | [prev] | [next] | [standalone]
| From | Charlie <shymathguy@gmail.com> |
|---|---|
| Date | 2011-05-12 04:25 -0700 |
| Message-ID | <f43966bd-88ee-4cfd-8b81-5a11778d2765@hg8g2000vbb.googlegroups.com> |
| In reply to | #1543 |
On May 12, 12:21 am, Denis McMahon <denis.m.f.mcma...@gmail.com> wrote: > On Wed, 11 May 2011 18:02:40 -0700, Charlie wrote: > > Every reference to form handler ... blah > > Charlie. > > You asked two questions. One question was "Can I do x using php?" > > The answer is yes, and that was the answer you were given. > > If you meant to ask "How do I ..." then ask "How do I ..." > > The other question you asked was "Can I do x using other languages?" and > again you were given the answer yes, because yes is again the correct > answer. > > If you're looking for a method to make a php script load a page from a > website, look at the curl module of php. > > Assuming you have an array of website urls and some formdata, you could, > for example, use a foreach loop to iterate over the array and curl to > submit the formdata to each website in turn. > > curl:http://www.php.net/manual/book.curl.php > foreach:http://www.php.net/manual/control-structures.foreach.php > arrays:http://www.php.net/manual/language.types.array.php > > Rgds > > Denis McMahon Lessons on grammar and trivialities such as loops are not productive. Nor is the use of singular when referring to an aspect of PHP consisting of 15 different functions, and reference to a page that lists options such as "starting a session" and "getting information on transfers and handles" without explanation as to what they mean or if they relate to what I want to do. If I want to load a page from a website, you ask? I thought I explained exactly what I want. (I referred to 10 arbitrary URLs to make it clear that the URLs are variable and arbitrary rather than being a single constant URL that might open up the possibility of a hard-coded solution not appropriate for my needs.) But if nobody is willing to simply talk about PHP code that does what I want (without a barrage of undefined alternate functionality to wade through) I will just pay someone from India to explain it. His English might be even worse than mine, but his sarcasm and condescending level are nonexistant (which also counts.) Thanks Charlie
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2011-05-12 09:26 -0400 |
| Message-ID | <iqgn5p$1av$1@dont-email.me> |
| In reply to | #1551 |
On 5/12/2011 7:25 AM, Charlie wrote: > On May 12, 12:21 am, Denis McMahon<denis.m.f.mcma...@gmail.com> > wrote: >> On Wed, 11 May 2011 18:02:40 -0700, Charlie wrote: >>> Every reference to form handler ... blah >> >> Charlie. >> >> You asked two questions. One question was "Can I do x using php?" >> >> The answer is yes, and that was the answer you were given. >> >> If you meant to ask "How do I ..." then ask "How do I ..." >> >> The other question you asked was "Can I do x using other languages?" and >> again you were given the answer yes, because yes is again the correct >> answer. >> >> If you're looking for a method to make a php script load a page from a >> website, look at the curl module of php. >> >> Assuming you have an array of website urls and some formdata, you could, >> for example, use a foreach loop to iterate over the array and curl to >> submit the formdata to each website in turn. >> >> curl:http://www.php.net/manual/book.curl.php >> foreach:http://www.php.net/manual/control-structures.foreach.php >> arrays:http://www.php.net/manual/language.types.array.php >> >> Rgds >> >> Denis McMahon > > Lessons on grammar and trivialities such as loops are not productive. > Nor is the use of singular when referring to an aspect of PHP > consisting of 15 different functions, and reference to a page that > lists options such as "starting a session" and "getting information on > transfers and handles" without explanation as to what they mean or if > they relate to what I want to do. > > If I want to load a page from a website, you ask? I thought I > explained exactly what I want. (I referred to 10 arbitrary URLs to > make it clear that the URLs are variable and arbitrary rather than > being a single constant URL that might open up the possibility of a > hard-coded solution not appropriate for my needs.) > > But if nobody is willing to simply talk about PHP code that does what > I want (without a barrage of undefined alternate functionality to wade > through) I will just pay someone from India to explain it. His > English might be even worse than mine, but his sarcasm and > condescending level are nonexistant (which also counts.) > > Thanks > > Charlie With that attitude, you will need to pay someone to help you. Denis's answer was correct - and considering no one here knows your level of expertise, I think his comments on loops were fine. As for his comments on curl - he's also correct in pointing you in the right direction. Sure there are several functions available - but the doc is pretty good on what they do. The real problem here is you asked a broad question - and got a broad response. If you ask more specific question, you get a more specific response. Or maybe you expected someone here to write the code for you and hand it to you on a silver platter for free. It ain't gonna happen. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ==================
[toc] | [prev] | [next] | [standalone]
| From | Charlie <shymathguy@gmail.com> |
|---|---|
| Date | 2011-05-12 12:43 -0700 |
| Message-ID | <5488856b-e0d2-4d64-aec1-3e530e3866ae@h12g2000pro.googlegroups.com> |
| In reply to | #1553 |
On May 12, 9:26 am, Jerry Stuckle <jstuck...@attglobal.net> wrote: > On 5/12/2011 7:25 AM, Charlie wrote: > > > > > > > On May 12, 12:21 am, Denis McMahon<denis.m.f.mcma...@gmail.com> > > wrote: > >> On Wed, 11 May 2011 18:02:40 -0700, Charlie wrote: > >>> Every reference to form handler ... blah > > >> Charlie. > > >> You asked two questions. One question was "Can I do x using php?" > > >> The answer is yes, and that was the answer you were given. > > >> If you meant to ask "How do I ..." then ask "How do I ..." > > >> The other question you asked was "Can I do x using other languages?" and > >> again you were given the answer yes, because yes is again the correct > >> answer. > > >> If you're looking for a method to make a php script load a page from a > >> website, look at the curl module of php. > > >> Assuming you have an array of website urls and some formdata, you could, > >> for example, use a foreach loop to iterate over the array and curl to > >> submit the formdata to each website in turn. > > >> curl:http://www.php.net/manual/book.curl.php > >> foreach:http://www.php.net/manual/control-structures.foreach.php > >> arrays:http://www.php.net/manual/language.types.array.php > > >> Rgds > > >> Denis McMahon > > > Lessons on grammar and trivialities such as loops are not productive. > > Nor is the use of singular when referring to an aspect of PHP > > consisting of 15 different functions, and reference to a page that > > lists options such as "starting a session" and "getting information on > > transfers and handles" without explanation as to what they mean or if > > they relate to what I want to do. > > > If I want to load a page from a website, you ask? I thought I > > explained exactly what I want. (I referred to 10 arbitrary URLs to > > make it clear that the URLs are variable and arbitrary rather than > > being a single constant URL that might open up the possibility of a > > hard-coded solution not appropriate for my needs.) > > > But if nobody is willing to simply talk about PHP code that does what > > I want (without a barrage of undefined alternate functionality to wade > > through) I will just pay someone from India to explain it. His > > English might be even worse than mine, but his sarcasm and > > condescending level are nonexistant (which also counts.) > > > Thanks > > > Charlie > > With that attitude, you will need to pay someone to help you. > > Denis's answer was correct - and considering no one here knows your > level of expertise, I think his comments on loops were fine. > > As for his comments on curl - he's also correct in pointing you in the > right direction. Sure there are several functions available - but the > doc is pretty good on what they do. etc. Well, if he was sincere, then my apologies. :) But it seemed obvious to me what I was asking and it is frustrating when someone knows something and "points you in the right direction" instead of just saying which one it is (same number of keystrokes.) I like to think that if someone asks me a question, I give them a couple of specifics - like the actual function and a brief description of how to use it. I just don't see the point of saying "curl" instead of "curl_exec" or whichever one it is. I have to spend 30 minutes going through and trying to figure out 15 functions (and very special ones at that) because he couldn't type 5 more characters. Yeah, it's free. But really, whatever the price, if I do something I do it for real. Someone who had volunteered to help a standards group I also helped once said that he wasn't going to do a lot of the job because "I'm doing it for free." I felt like saying, "You knew the pay scale when you applied for the job. What if your secretary said "My salary's too low - I'm not going to do half the job."? If you're not going to do the job, let someone else who will do it." but I didn't. Not going to happen? To me writing code (using constructs that I know, of course) is like writing English. If someone asks how to do something that I know how to do, I just do it - write the code, here's the function. I don't give a link to 15 functions and say it's one of them, go figure it out. It will happen if someone asked me and I knew the answer. My posts tend to be pretty long and detailed. So I guess I have to learn to ignore the ones that really don't help that much. I'm thinking it can't be that much to post to a form on another URL. Of course I could be wrong. I AM a big perfectionist, actually. I voted for Ross Perot. (Look up his interviews. Multi-billionaire who talked about people becoming lazy after World War II and America losing its edge. He got 15% of the vote.) Charlie > The real problem here is you asked a broad question - and got a broad > response. If you ask more specific question, you get a more specific > response. > > Or maybe you expected someone here to write the code for you and hand it > to you on a silver platter for free. It ain't gonna happen. > > -- > ================== > Remove the "x" from my email address > Jerry Stuckle > JDS Computer Training Corp. > jstuck...@attglobal.net > ==================- Hide quoted text - > > - Show quoted text -
[toc] | [prev] | [next] | [standalone]
| From | Denis McMahon <denis.m.f.mcmahon@gmail.com> |
|---|---|
| Date | 2011-05-12 22:58 +0000 |
| Message-ID | <4dcc6632$0$496$bed64819@gradwell.net> |
| In reply to | #1556 |
On Thu, 12 May 2011 12:43:18 -0700, Charlie wrote:
> [crap]
First you could populate an array with your arbitrary list of websites.
Then you could populate another array with your formdata.
Finally, you could step over the list of websites in a loop and send each
one your formdata.
If you just want to use all the fields in your starter form, you could
just use the post array, but I'm guessing one field in your starter form
will be the list of urls to submit to, perhaps separated by commas, tabs,
carriage returns, spaces or semi-colons, so maybe, given that such a list
might be in a field declared as:
<textarea name="websites" cols="50" rows="10"></textarea>
then you could extract a list of websites with something like (untested
code):
<?php
$urlList = preg_split("/[\s,;]+/",$_POST['websites']);
?>
I would provide a link to the php.net manual page for preg_split, but you
don't like me doing that, so you'll have to search for it yourself.
Now, assuming you want all the other fields in the post data to be posted
as-is to the urls in the list, you might decide to copy them into a new
array:
<?php
$postData = array();
foreach ($_POST as $field => $data) {
if ($field != "websites") $postdata[$field] = $data;
}
?>
Or you could just:
<?php
unset($_POST['websites']);
?>
and use $_POST later on instead of $postData ....
Actually, assuming none of the target websites expects a field called
websites, you probably don't even need to unset it.
Now, presumably you want to post the $postData to all the urls in
$urlList:
<?php
foreach ($url_list as $url) {
// create a curl object
// set the curl url to $url
// set the curl post data option to $post_data
// set other curl (I don't know what settings you need)
// exec the curl request
// handle the result / response somehow
// unset the curl object
}
?>
I couldn't be bothered to look up all the curl function names, you'll
have to do that yourself. I would provide a link to the php.net curl
manual page, but that was "unhelpful" last time I did it.
Oh, and this will only work if your seed form and all your target urls
use the same field names for each field, otherwise your target urls will
get a post data with a load of field names which they'll probably just
ignore.
Rgds
Denis McMahon
[toc] | [prev] | [next] | [standalone]
| From | Denis McMahon <denis.m.f.mcmahon@gmail.com> |
|---|---|
| Date | 2011-05-13 02:55 +0000 |
| Message-ID | <4dcc9d87$0$493$bed64819@gradwell.net> |
| In reply to | #1560 |
On Thu, 12 May 2011 22:58:58 +0000, Denis McMahon wrote: [stuff] A few caveats in relation to my earlier post with some code examples: That post just contains some generic overviews, and should not be taken as demonstrating functional and secure code. Also if any of the assumptions I've made relating to what you want to achieve are wrong (and your requirement was very broadly phrased) then the code suggestions are even more worthless and flawed than Jerry will shortly point out. And yes Jerry, I know that the techniques I suggested have all sorts of issues especially wrt using the $_POST array as the post fields to the curl objects without any validation and verification, but feh, couldn't be bothered given OPs attitude. Rgds Denis McMahon
[toc] | [prev] | [next] | [standalone]
| From | Charlie <shymathguy@gmail.com> |
|---|---|
| Date | 2011-05-13 15:42 -0700 |
| Message-ID | <07983794-cd14-4d13-9626-aaef8f94f2a7@u15g2000vby.googlegroups.com> |
| In reply to | #1564 |
On May 12, 10:55 pm, Denis McMahon <denis.m.f.mcma...@gmail.com> wrote: > On Thu, 12 May 2011 22:58:58 +0000, Denis McMahon wrote: > > [stuff] > > A few caveats in relation to my earlier post with some code examples: > > That post just contains some generic overviews, and should not be taken > as demonstrating functional and secure code. > > Also if any of the assumptions I've made relating to what you want to > achieve are wrong (and your requirement was very broadly phrased) then > the code suggestions are even more worthless and flawed than Jerry will > shortly point out. > > And yes Jerry, I know that the techniques I suggested have all sorts of > issues especially wrt using the $_POST array as the post fields to the > curl objects without any validation and verification, but feh, couldn't > be bothered given OPs attitude. > > Rgds > > Denis McMahon Wow!! Thanks. I guess I lit a candle under someone. *MWAH* Charlie
[toc] | [prev] | [next] | [standalone]
| From | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| Date | 2011-05-14 00:58 +0100 |
| Message-ID | <iqkgig$vtd$1@news.albasani.net> |
| In reply to | #1580 |
Charlie wrote: > On May 12, 10:55 pm, Denis McMahon <denis.m.f.mcma...@gmail.com> > wrote: >> On Thu, 12 May 2011 22:58:58 +0000, Denis McMahon wrote: >> >> [stuff] >> >> A few caveats in relation to my earlier post with some code examples: >> >> That post just contains some generic overviews, and should not be taken >> as demonstrating functional and secure code. >> >> Also if any of the assumptions I've made relating to what you want to >> achieve are wrong (and your requirement was very broadly phrased) then >> the code suggestions are even more worthless and flawed than Jerry will >> shortly point out. >> >> And yes Jerry, I know that the techniques I suggested have all sorts of >> issues especially wrt using the $_POST array as the post fields to the >> curl objects without any validation and verification, but feh, couldn't >> be bothered given OPs attitude. >> >> Rgds >> >> Denis McMahon > > Wow!! Thanks. I guess I lit a candle under someone. > > *MWAH* > > Charlie It's the pollen. Makes everyone irritable.
[toc] | [prev] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2011-05-12 19:30 -0400 |
| Message-ID | <iqhqji$s1c$1@dont-email.me> |
| In reply to | #1556 |
On 5/12/2011 3:43 PM, Charlie wrote: > On May 12, 9:26 am, Jerry Stuckle<jstuck...@attglobal.net> wrote: >> On 5/12/2011 7:25 AM, Charlie wrote: >> >> >> >> >> >>> On May 12, 12:21 am, Denis McMahon<denis.m.f.mcma...@gmail.com> >>> wrote: >>>> On Wed, 11 May 2011 18:02:40 -0700, Charlie wrote: >>>>> Every reference to form handler ... blah >> >>>> Charlie. >> >>>> You asked two questions. One question was "Can I do x using php?" >> >>>> The answer is yes, and that was the answer you were given. >> >>>> If you meant to ask "How do I ..." then ask "How do I ..." >> >>>> The other question you asked was "Can I do x using other languages?" and >>>> again you were given the answer yes, because yes is again the correct >>>> answer. >> >>>> If you're looking for a method to make a php script load a page from a >>>> website, look at the curl module of php. >> >>>> Assuming you have an array of website urls and some formdata, you could, >>>> for example, use a foreach loop to iterate over the array and curl to >>>> submit the formdata to each website in turn. >> >>>> curl:http://www.php.net/manual/book.curl.php >>>> foreach:http://www.php.net/manual/control-structures.foreach.php >>>> arrays:http://www.php.net/manual/language.types.array.php >> >>>> Rgds >> >>>> Denis McMahon >> >>> Lessons on grammar and trivialities such as loops are not productive. >>> Nor is the use of singular when referring to an aspect of PHP >>> consisting of 15 different functions, and reference to a page that >>> lists options such as "starting a session" and "getting information on >>> transfers and handles" without explanation as to what they mean or if >>> they relate to what I want to do. >> >>> If I want to load a page from a website, you ask? I thought I >>> explained exactly what I want. (I referred to 10 arbitrary URLs to >>> make it clear that the URLs are variable and arbitrary rather than >>> being a single constant URL that might open up the possibility of a >>> hard-coded solution not appropriate for my needs.) >> >>> But if nobody is willing to simply talk about PHP code that does what >>> I want (without a barrage of undefined alternate functionality to wade >>> through) I will just pay someone from India to explain it. His >>> English might be even worse than mine, but his sarcasm and >>> condescending level are nonexistant (which also counts.) >> >>> Thanks >> >>> Charlie >> >> With that attitude, you will need to pay someone to help you. >> >> Denis's answer was correct - and considering no one here knows your >> level of expertise, I think his comments on loops were fine. >> >> As for his comments on curl - he's also correct in pointing you in the >> right direction. Sure there are several functions available - but the >> doc is pretty good on what they do. > > etc. > > Well, if he was sincere, then my apologies. :) > > But it seemed obvious to me what I was asking and it is frustrating > when someone knows something and "points you in the right direction" > instead of just saying which one it is (same number of keystrokes.) I > like to think that if someone asks me a question, I give them a couple > of specifics - like the actual function and a brief description of how > to use it. > > I just don't see the point of saying "curl" instead of "curl_exec" or > whichever one it is. I have to spend 30 minutes going through and > trying to figure out 15 functions (and very special ones at that) > because he couldn't type 5 more characters. > That's because it will take more than one function to do it. It's not a simple one-liner; you also have to set the proper options, parse input data (if you retrieve the page), set up output data, etc. > Yeah, it's free. But really, whatever the price, if I do something I > do it for real. > > Someone who had volunteered to help a standards group I also helped > once said that he wasn't going to do a lot of the job because "I'm > doing it for free." I felt like saying, "You knew the pay scale when > you applied for the job. What if your secretary said "My salary's too > low - I'm not going to do half the job."? If you're not going to do > the job, let someone else who will do it." but I didn't. > > Not going to happen? To me writing code (using constructs that I > know, of course) is like writing English. If someone asks how to do > something that I know how to do, I just do it - write the code, here's > the function. I don't give a link to 15 functions and say it's one of > them, go figure it out. It will happen if someone asked me and I knew > the answer. My posts tend to be pretty long and detailed. > Writing code is how I (in part) make a living. I can't eat if I give everything away. Most here are in the same boat. We'll give advice to help you get on the right track, but not write the code for you - especially if it's more than a few lines. You'd be surprised what some people have come in here asking be done for free! > So I guess I have to learn to ignore the ones that really don't help > that much. I'm thinking it can't be that much to post to a form on > another URL. > > Of course I could be wrong. > It takes some coding, but it's not all that difficult. But there are problems such as your code breaking if they change the page you're posting to - as well as keeping track of everything which needs to be posted. Of course, if you're making this generic, you don't have those problems - but then you have to parse each page to determine what's required - much more difficult. > I AM a big perfectionist, actually. > > I voted for Ross Perot. (Look up his interviews. Multi-billionaire > who talked about people becoming lazy after World War II and America > losing its edge. He got 15% of the vote.) > I know all about Ross. He didn't get my vote. :) > Charlie > -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ==================
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.php
csiph-web