textbox Posted May 10, 2007 Share Posted May 10, 2007 Hello, following on from my posts about cURL... <here> I have been told by the API developer to use PEAR. Never used this before but looks like a function within PHP. <?php require_once "HTTP/Request.php"; $req =& new HTTP_Request("http://heywatch.com/upload"); $req->setBasicAuth("johndoe", "foo"); $req->setMethod(HTTP_REQUEST_METHOD_POST); $result = $req->addFile("data", "your/video.3gp"); if (PEAR::isError($result)) { header("Location: http://yoursite.com/upload?error"); } else { $response = $req->sendRequest(); if (PEAR::isError($response)) { header("Location: http://yoursite.com/upload?error"); } else { header("Location: http://yoursite.com/upload?success"); } } ?> This is the code. However, what needs to go in HHTP/request.php?? Is this some sort of set file or connection string? Any help would be great! Nick Quote Link to comment https://forums.phpfreaks.com/topic/50802-solved-httprequest/ Share on other sites More sharing options...
trq Posted May 10, 2007 Share Posted May 10, 2007 PEAR is the PHP Extension and Application [bR[/b]epository. It would appear that HTTP/Request.php is available through PEAR. Quote Link to comment https://forums.phpfreaks.com/topic/50802-solved-httprequest/#findComment-249823 Share on other sites More sharing options...
textbox Posted May 10, 2007 Author Share Posted May 10, 2007 Thanks for that Thorpe. I have no idea how to access it in my script. I have top level domain access, but cant seem to find where the lib is supposed to reside? Any help would be great! Quote Link to comment https://forums.phpfreaks.com/topic/50802-solved-httprequest/#findComment-249946 Share on other sites More sharing options...
trq Posted May 10, 2007 Share Posted May 10, 2007 Did you read any of the link I provided? If you have PEAR installed, there are instructions on that site as to how you install PEAR classes. If you don't have PEAR installed, there are instructions on how to install that. Quote Link to comment https://forums.phpfreaks.com/topic/50802-solved-httprequest/#findComment-249954 Share on other sites More sharing options...
textbox Posted May 10, 2007 Author Share Posted May 10, 2007 Sorry Thorpe, didnt see the link Sorted it now, installed the files from the site! Thanks again Quote Link to comment https://forums.phpfreaks.com/topic/50802-solved-httprequest/#findComment-250132 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.