Jump to content


Photo

Help with sending a data stream. fwrite?


  • Please log in to reply
2 replies to this topic

#1 volcs0

volcs0
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 26 July 2006 - 12:04 PM

I want to set up a mini-API for a bunch of php scripts I've written.

I want my script to be able to get data using fopen.

eg.

$url = "http://www.mypage.co...hp?foo=1&bar=2"
$handle = fopen($url, "r");

And have myscript.php return a stream of data based on inputs foo and bar.

My question is, how do set up myscript.php? How do I "send" the data? Is it fwrite? Open stream? POST?

I can usually figure things out by googling around, but this one has me stumped.

Thanks.

Sam V.

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 26 July 2006 - 12:09 PM

the get would do somethink on another page according to foo an bar that all i now sorry.

if($_GET['foo']==1) {

do some think

}elseif($_GET['bar']==2){

do some think

}else{

do somethink

}
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 26 July 2006 - 12:23 PM

Look at the CURL functions.

Ken




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users