PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old April 26th, 2002, 10:01 PM
chvol chvol is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Cambridge, MA USA
Posts: 12 chvol User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
PHP Programming

I would like to write a program in PHP that calls another web site (URL), feeds it its input, and gets back the output in PHP variables. It would be as if a user accessed the site, but PHP would do it and have the page output returned to the PHP program in its variables.

I got PHP by downloading PHPTriad to my Windows 98 PC, which includes Apache webserver.

Thanks
Charlie
chvol@aol.com

Reply With Quote
  #2  
Old April 27th, 2002, 02:53 AM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 23 sec
Reputation Power: 6
RE: PHP Programming

You'll need to be a tad bit more specific. What needs to be sent to the other site? Does a form need to be filled out? What exactly is happening? PHP should definately be able to handle it. I just need some more specifics...

Reply With Quote
  #3  
Old April 27th, 2002, 09:10 AM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 23 sec
Reputation Power: 6
RE: PHP Programming

Well...it seems Charlie didn't want like my response to his post and sent me something in email...

Quote:
Matt,
May I give YOU a little help? If a person asks a question and there are options as to what they might need, it is a great idea to answer, "To do ... you ..., and to do ... you ..." Then (1) you have answered the question, and (2) regardless of what the person needs in the future, they are prepared.

Thanks,
Charlie


I guess I shouldn't ask people to be more specific in the future. I guess I should just give vague answers to vague questions rather than try and narrow the question down so I can give a better answer.

Charlie, let me give YOU a little more help. When you come to a forum and ask a vague question, don't complain about the answers you get. If you look around this forum, you will see that I answer all types of questions all the time. Do I get paid for this? No. Do I get anything out of it? No. I do it just beacuse I enjoy helping people. But, it's people like you that make me want to shut the site down and just forget it.


Reply With Quote
  #4  
Old April 27th, 2002, 05:54 PM
sethadam1 sethadam1 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Orlando, FL
Posts: 223 sethadam1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: PHP Programming

This is so lame I can't believe it. I don't even see a discernable question! How about some indication of what you actually want to do, Charlie?

Reply With Quote
  #5  
Old April 27th, 2002, 10:29 PM
chvol chvol is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Cambridge, MA USA
Posts: 12 chvol User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: PHP Programming

1. Please don't try to psychoanalyze me. The issue is technical, not emotional.

2. I am simply saying what any good programmer knows: It is good to have a general solution rather than a specific one.

3. What is wrong with simply telling me how to handle forms etc. rather than trying to limit the answer as much as possible?

4. I am sorry that you don't like your pay scale. I once heard a volunteer for a programming language committee say that they weren't going to do all of their duties because they were being paid. My reaction: What if your secretary said that? You knew the pay scale when you signed up. If you're not going to do the job, then step aside and let someone else who is willing to do it.

Charlie
PS I have received 6 or 7 responses to this question, from people advising me to check out fopen(), class snoopy, the CURL module, and a variety of sites containing scripts and tutorials. None of them tried to get me to limit the scope of the solution.

When I answer a technical question, I like to give the user a complete answer, and in fact go beyond what they asked for. I like programming and teaching. Don't you?

To each his own.
(Having a bad day? :-)

Reply With Quote
  #6  
Old April 29th, 2002, 10:06 PM
Rufus Rufus is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Massachusetts
Posts: 5 Rufus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to Rufus
RE: PHP Programming

It's an interesting question - do I generalize to the point where the code is useless, or do I narrow the scope to such a point that the program isn't portable?

Here's what I do (and yes, I teach). I look at the specific situation first, often because of necessity. I need a program and I need it fast. This means coding to specific guidelines (form method, variables, states, etc). WHILE working on this, look at the outline piece-by-piece. Is this piece something I'll need to recycle? That's the point to generalize, but not overgeneralize.

It's important to keep code meaningful - don't try to make a single module address every potential scenario.

And the pay scale thing? Pay isn't the issue - the issue is appreciation for a job well done. Do you appreciate the service provided by Matt? Do you utilize the resource, ever, in any way? Then don't gripe.

Matt doesn't ask for much. All he asked YOU for was details. It's not unreasonable to assume a starting position, based on specifics, then expand the scope to a reasonable module.

I feel a rant coming on - I think I'd better go lie down...

Regards, and keep up the good work, Matt!
-Toby

Reply With Quote
  #7  
Old April 30th, 2002, 12:17 AM
chvol chvol is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Cambridge, MA USA
Posts: 12 chvol User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: PHP Programming

>It's an interesting question - do I generalize to the point where the code is useless, or do I narrow the scope to such a point that the program isn't portable?

But you are only providing information on the programming language, not designing the program. I will design and implement it appropriately, regardless (assuming that I am told everything that I need - which of course is what i am trying to do.)

If a program is overly general, it is not useless. It just takes longer to develop than necessary - you are including features that might never be used. But the features are still there if ever needed, and, more to the point, I will have the knowledge and ability to address future needs. That's what it's really all about.

(Portability is attained by using standard constructs that are executed the same in all implementations of the programming language (such as staying within standard limits).)

>I look at the specific situation first, often because of necessity. I need a program and I need it fast.

Bad assumption here.

>Don't try to make a single module address every potential scenario.

Careful. If "potential" means "inevitable", then it is much better to include it when the software is initially designed and coded, as later the programmer may have left, the code might not be documented or easy to understand and modify, etc.

>And the pay scale thing? Pay isn't the issue.

Then why bring it up? I only responded to his diatribe about not being paid.

>Do you utilize the resource, ever, in any way? Then don't gripe.

Gripe? I only made a friendly suggestion that it is better to cover the options than to rely on the user (the person with the question) to limit the options.

When I interview a user, I learn the basic need and provide them with the complete range of possibilities. The risk in the "minimalistic" approach is that the user might not be aware of the options available or the potential needs. I like to be creative and solve the complete problem the 1st time.

(Actually, I think my question can be answered in less time than it takes to try to narrow it down. All of my 8 or 9 responses have been pretty short and to the point, telling me the function, class or script to examine and providing useful URLs.)

> It's not unreasonable to assume a starting position, based on specifics, then expand the scope to a reasonable module.

Contract then expand?

>I feel a rant coming on - I think I'd better go lie down...

>Regards, and keep up the good work, Matt!
-Toby

It is unfortunate that a simple suggestion such as this would provoke such an outrage. I know that many people feel embarrassed when they are given advice, and often would rather do things the wrong way than to take advice which is seen as an admission that they weren't perfect in the 1st place.

That is their decision and their perogative. However, I have always felt that a person in "authority" (such as the head of a programming language committee) does have a bit of an obligation to be more open to the public than those who act that way in their private lives (even if they aren't being paid.)

Charlie

Reply With Quote
  #8  
Old April 30th, 2002, 03:52 AM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 23 sec
Reputation Power: 6
RE: PHP Programming

1. I didn't.
2. I would agree with that.
3. I was simply trying to find out if you were indeed needing to access forms or not. You original post was very vague and did not specify how you would be providing data to the web site. Depending upon how the website would take data (form, passed via URL, etc), there are different approaches to take.
4. Yes I knew when I made the site I wouldn't get paid for it. But still, that doesn't change the fact that I don't like people complaining to me when all I am trying to do is help them.

Quote:
When I answer a technical question, I like to give the user a complete answer, and in fact go beyond what they asked for. I like programming and teaching. Don't you?

Yes I love programming and teaching. But, I hate teachers who just sit in from of the "class" and lecture. Learning should be an interactive process. The teacher should be able to ask questions of the students without getting blasted for it. In order to provide you with a "complete answer", I needed a little bit more info.

Reply With Quote
  #9  
Old April 30th, 2002, 04:37 PM
Rufus Rufus is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Massachusetts
Posts: 5 Rufus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to Rufus
RE: PHP Programming

Not to sound petty, Charlie, but you remind me of an aunt of mine.

She'll come into my home, uninvited, and critique the way I raise my children, poke her nose in every corner, 'tsk' at the dust on the top of my book-cases and expect me to drop everything to cater to her.

Yes, she's a guest in my home (just as you are a GUEST on Matt's site). That incurs certain obligations on my part (and Matt more than meets his obligations as host). However, and this is the bit most folks miss - there's an obligation on the part of the guest as well (and here it comes).

As guest, you must discard YOUR rules and preconceptions, and use those of the host. This doesn't mean to abandon your personal morals, beliefs or identity, but respect the fact that the host may have different ones from you.

You don't go into a bear's den and expect the bears to sit down and discuss whatever with you, simply because that's what you do in your home. You walk into a bear's den and expect the bears to eat your face. The reason? That's their home, and they are the host. You are simply the guest, and if you don't like the house rules, don't enter the house.

In the words of Robert A. Heinlein, 'rub blue mud into your belly-button'. You don't walk into a situation which someone else RUNS, and expect them to change the way they work (either for pay or for good feelings), unless you have taken over running the situation.

Sorry, Charlie, I should have asked - are you now running the show at Codewalkers? Is this now your site? If so, I do apologize for dictating to you. If not, this is a lesson that all should learn.

In your office, run interviews however you wish - it's your office. In here, though, respect the way Matt chooses to work and deal with it. Or look elsewhere for help.

And the pay thing? That has reared its ugly head at a vast number of sites lately. Pay is NOT the issue, gratitude for a service provided IS. Matt raises the issue of pay (or lack thereof), so that you will understand - he's not a corporate grunt here, living by someone else's rules. This is Matt's site, nobody else's. He does this because this is something he can do. And if you don't like how he does it, do it yourself, better, bigger, faster, whatever. There's a plethora of hosting companies, all willing to help you set up a site - go for it!

Yes, the rant hit after all. I apologize to Matt and all the others who got hit by some of this - collateral splatter. But this is, to my mind, part of simple netiquette.

Regards!
- Tobias R. Parent

-- "Four out of five suffer from diarrhea. Does this mean one out of five enjoys it?"

Reply With Quote
  #10  
Old April 30th, 2002, 08:14 PM
chvol chvol is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Cambridge, MA USA
Posts: 12 chvol User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: PHP Programming

>Not to sound petty, Charlie, but you remind me of an aunt of mine. She'll come into my home, uninvited, and critique the way I raise my children, poke her nose in every corner, 'tsk' at the dust on the top of my book-cases and expect me to drop everything to cater to her.

Would you like to know how I react to people like that? I smile and say, "Well thank you for the kind advice." I don't get defensive or upset. I take it for what it is: a sincere concern and effort to help. And I do one other thing: I learn.

>Yes, she's a guest in my home (just as you are a GUEST on Matt's site). That incurs certain obligations on my part (and Matt more than meets his obligations as host). However, and this is the bit most folks miss - there's an obligation on the part of the guest as well (and here it comes).

>As guest, you must discard YOUR rules and preconceptions, and use those of the host. This doesn't mean to abandon your personal morals, beliefs or identity, but respect the fact that the host may have different ones from you.

Is making a suggestion an act of disrespect?

>You don't go into a bear's den and expect the bears to sit down and discuss whatever with you, simply because that's what you do in your home.

Excuse me??

>You walk into a bear's den and expect the bears to eat your face. The reason? That's their home, and they are the host.

No, it’s because they’re a bunch of funky bears! (Actually, I wouldn't advise walking into a bear's den in the first place.)

>You are simply the guest, and if you don't like the house rules, don't enter the house.

Love it or leave it? “simply the guest”? If you like allegories, then hear this one: I know someone who follows your standard to the hilt. She wakes guests up early in the morning and never asks anybody what food they like when preparing meals. An Armenian friend experienced this and told me that in her culture, the guest is the head of the household. Why? Because they are at a disadvantage. The host has a degree of power over them. And out of respect for their guest, the host does everything they can to make them feel at home.

But that isn’t the point. Nobody is breaking anybody’s rules here. I only made a simple friendly suggestion. If someone wants to be defensive about it, that’s their prerogative.

>In the words of Robert A. Heinlein, 'rub blue mud into your belly-button'. You don't walk into a situation which someone else RUNS, and expect them to change the way they work (either for pay or for good feelings), unless you have taken over running the situation.

I don’t “expect” anything (especially now!)

>Sorry, Charlie, I should have asked - are you now running the show at Codewalkers? Is this now your site?

Pulling rank?

>If so, I do apologize for dictating to you. If not, this is a lesson that all should learn.

So it’s ok to be a dictator if you’re in charge? Do you apply the same standard to your boss at work?

>In your office, run interviews however you wish - it's your office. In here, though, respect the way Matt chooses to work and deal with it. Or look elsewhere for help.

Respect = never make suggestions?

>And the pay thing? That has reared its ugly head at a vast number of sites lately.

Name two.

>Pay is NOT the issue, gratitude for a service provided IS.

Making a suggestion makes one an ingrate?

>Matt raises the issue of pay (or lack thereof), so that you will understand - he's not a corporate grunt here, living by someone else's rules. This is Matt's site, nobody else's.

With all due respect, that has nothing to do with anything. It’s not a legal or business question. It’s about how people conduct themselves and how they treat each other. It’s about how people respond to suggestions.

>He does this because this is something he can do. And if you don't like how he does it, do it yourself, better, bigger, faster, whatever. There's a plethora of hosting companies, all willing to help you set up a site - go for it!

>Yes, the rant hit after all. I apologize to Matt and all the others who got hit by some of this - collateral splatter. But this is, to my mind, part of simple netiquette.

What’s simple netiquette? Never making suggestions to the host of a site?

Actually, the truth of the matter is, he wasn’t acting in his capacity as the host. He was simply responding to my question. He was wearing the hat of someone posting to the message board!

>Regards!
> - Tobias R. Parent

> -- "Four out of five suffer from diarrhea. Does this mean one out of five enjoys it?"

“Pride cometh before the fall.”

Charlie

Reply With Quote
  #11  
Old May 1st, 2002, 12:11 AM
superwick superwick is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 1 superwick User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: PHP Programming

You posted a vague question for help and Matt responded with a request for you to be more specific. He wasn't rude or anything. Your response was -
"Matt,
May I give YOU a little help? If a person asks a question and there are options as to what they might need, it is a great idea to answer, "To do ... you ..., and to do ... you ..." Then (1) you have answered the question, and (2) regardless of what the person needs in the future, they are prepared."

Capitalizing 'YOU' and lecturing Matt on how to answer the question makes that a very rude comment. In fact, you didn't even provide any more details but went on ahead bashing Matt. You obviously are lacking in tact and manners from all your previous posts. If you can't be a polite poster here then please go away. Just my two cents.

Reply With Quote
  #12  
Old May 1st, 2002, 01:18 AM
chvol chvol is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Cambridge, MA USA
Posts: 12 chvol User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: PHP Programming

>You posted a vague question for help and Matt responded with a request for you to be more specific. He wasn't rude or anything.

Not at that point, no. The unwarranted tirade came next: "Don't complain about the answers you get... Do I get paid for this? No. Do I get anything out of it? No. I do it just beacuse I enjoy helping people. But, it's people like you that make me want to shut the site down and just forget it."

>Your response was -
"Matt,
May I give YOU a little help? If a person asks a question and there are options as to what they might need, it is a great idea to answer, "To do ... you ..., and to do ... you ..." Then (1) you have answered the question, and (2) regardless of what the person needs in the future, they are prepared."

>Capitalizing 'YOU' and lecturing Matt on how to answer the question makes that a very rude comment.

I capitalized YOU to point out that I had originally asked for help, but I felt that HE could use some as well. Then I continued in the 3rd person (avoiding being personal): "It is a great idea..." rather than "you should" - the opposite of a lecture. He, in contrast, used the 2nd (and 1st) person: "Don't complain ... people like you."

So how could I have made my suggestion in a better way? (Or is the real problem the fact that I made a suggestion at all?)

Please tell me how I could have made that suggestion in a better way.

>In fact, you didn't even provide any more details but went on ahead bashing Matt.

Not so. I used the 3rd person, not the 2nd person.

>You obviously are lacking in tact and manners from all your previous posts.

All? Examples??

>If you can't be a polite poster here then please go away. Just my two cents.

You're entitled!

Charlie
:-P

Reply With Quote
  #13  
Old May 1st, 2002, 08:16 PM
Magic Magic is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Jacksonville, Florida, USA
Posts: 2 Magic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: PHP Programming

Charlie,
I'm not sure, but I thought that this was a PHP website, not a place for a soap box. Matt, has taken the time to give us this forum to learn and communicate with others about this wonderful language. I'm a newbie myself, and I think that it would benefit everyone if we all worked together to expand our knowledge. If you have a question, then by all means ask it. Just make sure that you give Matt and everyone else enough information to help you. IF YOU ARE VAGUE, THEN YOU WILL GET VAGUE AS AN ANSWER. I haven't been a part of this site for very long, but I like what I see so far. I think that Matt and the people that respond to questions on this forum, do a great job. I came to this site to learn, not to read about how you got your feelings hurt because Matt asked you to be a little more specific about your question. How do you expect to get help if your question is not understandable??

Allen

Reply With Quote
  #14  
Old May 1st, 2002, 08:29 PM
chvol chvol is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Cambridge, MA USA
Posts: 12 chvol User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: PHP Programming

>Charlie,
>I'm not sure, but I thought that this was a PHP website, not a place for a soap box.

Takes 2, doesn't it?

>IF YOU ARE VAGUE, THEN YOU WILL GET VAGUE AS AN ANSWER.

It's not vague, it's general. I wanted a general answer on how to read a web page (URL) in PHP - all of the problems and solutions. He wanted to limit it. I told him that it's a good idea to just cover each option. Other responses did that.

>I came to this site to learn, not to read about how you got your feelings hurt because Matt asked you to be a little more specific about your question.

Now now. I was not the one saying all of the "I"s and "you"s.

>How do you expect to get help if your question is not understandable??

Again, not the issue. It is one of generality, of scope of the answer. I just made a simple suggestion.

Charlie

>Allen

Reply With Quote
  #15  
Old May 1st, 2002, 08:47 PM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 23 sec
Reputation Power: 6
RE: PHP Programming

Ok, I'm all for a good debate, but I think this one has gone on long enough. Let's get back to the subject at hand...Programming in PHP.

Charlie, since you've made yourself into an icon here why don't you stick around and help some other programmers with their problems? With your general and my specific answers we can cover all bases ;)