FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Upload Script (Read the 3rd post)





Simulator
Hi, does anyone know how I could $_POST inputs to one server and then return it on Frihsot, so it goes like

Frihost -> Server 2 -> Frihost

I was told there is a way by using Curl.... but I have no clue how to do that.. anyone got any ideas?
mathiaus
I've been looking at curl for about 5 minutes so please excuse me if I'm wrong Smile

Code:
curl -F fieldname=@fieldvalue www.server2.com

I think thats what your looking for
Simulator
mathiaus wrote:
I've been looking at curl for about 5 minutes so please excuse me if I'm wrong Smile

Code:
curl -F fieldname=@fieldvalue www.server2.com

I think thats what your looking for


Thanks, but I think your wrong..... I don't really know, but I think you are...
I found this

Code:
<?php
// FIND BOOKS ON PHP AND MYSQL ON AMAZON
$url = "http://www.amazon.com/exec/obidos/search-handle-form/002-5640957-2809605";
$ch = curl_init();    // initialize curl handle
curl_setopt($ch, CURLOPT_URL,$url); // set url to post to
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable
curl_setopt($ch, CURLOPT_TIMEOUT, 3); // times out after 4s
curl_setopt($ch, CURLOPT_POST, 1); // set POST method
curl_setopt($ch, CURLOPT_POSTFIELDS, "url=index%3Dbooks&field-keywords=PHP+MYSQL"); // add POST fields
$result = curl_exec($ch); // run the whole process
curl_close($ch);
echo $result;
?>


As it says, it sends "Posts" to Amzon and returns books, now you don't know, if all I have to do is edit url=index%3Dbooks&field-keywords=PHP+MYSQL to:
var1=val1&var2=val2

?

EDIT: This is what that script returns..
http://simandsim.com/post.php
Simulator
Ok its now working, but it won't send the file, do I need to change the $_POST on the file to $_FILE or something?
Related topics
How To : Secure Your PHP Website
MP3-Host
Problems
looking for wap upload script
Upload Script
quite simple file upload
Upload file
Frihs LOTTO Winner Announced !Week 1
Upload Script
I need a php upload script, NEEDED BADLY
Upload Script
Upload Script
[RESOLVED] phpbb Help with making an upload script.
How to do an upload script??
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.