ich habe folgendes Problem, ich möchte gerne eine Datei von meinem Server auf einen anderen Server (Video Hoster) hochladen nur will dies nicht funktionieren. Es werden auch keine Errors angezeigt.
Hier ist einmal das Script:
PHP Code:
<?php
class curl
{
function __construct($use = 1)
{
$this->ch = curl_init();
if($use = 1)
{
curl_setopt ($this->ch, CURLOPT_POST, 1); // ENABLE HTTP POST
curl_setopt ($this->ch, CURLOPT_COOKIEJAR, 'cookie.txt'); // IMITATE CLASSIC BROWSER'S BEHAVIOUR : HANDLE COOKIES
curl_setopt ($this->ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($this->ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($this->ch, CURLOPT_HTTPHEADER, array("Content-type: multipart/form-data"));
}
else
{
return 'There is the possibility, that this script wont work';
}
}
function first_connect($loginform,$logindata)
{
curl_setopt($this->ch, CURLOPT_URL, $loginform); // SET URL FOR THE POST FORM LOGIN
curl_setopt($this->ch, CURLOPT_POSTFIELDS, $logindata); // SET POST PARAMETERS : FORM VALUES FOR EACH FIELD
}
function store() //to safe the login
{
$store = curl_exec ($this->ch);
}
function execute($page) //to move through the intern area
{
curl_setopt($this->ch, CURLOPT_URL, $page);
$this->content = curl_exec ($this->ch);
}
function close()
{
curl_close ($this->ch);
}
function __toString()
{
return $this->content;
}
}
$postdata = array("name" => "file[]",
"filename" => "@".realpath("Hagure.mp4"));
$getit = new curl();
$getit->first_connect('http://yourupload.com/index.php?act=login&login=true','login=true&file_session=&email=&password=dein-passwort&upload=Login'); //Variiert von Seite zu seite.
$getit->store();
$getit->execute('http://yourupload.com/index.php?act=user&do=home');
$getit->first_connect('http://yourupload.com/index.php?act=files&do=upload',$postdata); //Variiert von Seite zu seite.
$getit->store();
$getit->close();
?>
Der Login funktioniert aber wunderbar.
Hier das Packet:
PHP - cURL Cookie Problem 08/19/2011 - Web Development - 6 Replies Hallo,
ich möchte eine Chinesische Seite sogesagt übersetzen. Dazu habe ich mir gedacht das ich ein Formular auf Deutsch mache und den Post an die chinesische Seite schicke.
Leider bekomme ich eine Fehlermeldung von der Seite aus das die Cookies deaktiviert sind oder so.
Nun weiß ich nicht weiter. Cookies sind laut Script an und sollten eig. weitergegebene werden.
Könnt ihr mir helfen?
<?PHP
session_start();
if (isset($_POST) && ($_POST == "Registrieren")){...
help with curl 05/20/2011 - CO2 Programming - 0 Replies im trying to log in to a page using curl to modify one of my post like updating that specific post with new information over the time
i dont understand very much curl and most of the examples i search are in php and i need it to use with autoit or the cmd directly
right now im trying from the start, to get logged in the webpage
i have found that i need the names of the inputs user and password and that i need a cookie to receive and to send, but when i check the curl.txt in a browser it...
[Projekt] MineTube ~ Video Upload/Bilder Upload und mehr! Team Gesucht 03/23/2011 - Minecraft - 21 Replies Hallo,
Da ich nun seit längerem in der Minecraft Section unterwegs bin und auch so schon lange Erfahrung mit dem Spiel gemacht habe, bin ich zum Entschluss gekommen ein neues Projekt zu starten.
Doch was für ein Projekt?
Es geht darum, dass viele Minecraft Player, mit Lets Play, Shows und Tutorials anfangen.
Dies finde ich natürlich super, aber wieso sollte alles in YouTube un CO untergehen (ausgenommen Gronkh ;) ).
Nun gehe ich dazu über, das Projekt namens MineTube zu starten.
Was...
[PHP] cUrl Login 04/19/2010 - Web Development - 0 Replies So ich hab ein kleines Problem. Und zwar versuche ich für das Browsergame
Space Pioneers einen Bot mit PHP zu schreiben was generell auch kein Problem
wäre, allerdings habe ich ein kleines Problem. Und zwar gibt es zwei möglichkeiten
sich einzuloggen, das wäre einmal auf Looki und einmal der Notfall Login Login. Nun zu meinem Problem. Das
Einloggen im ersten Link
klappt soweit ganz gut, ich habe meines errachtens auch alle Inputs mit übergeben,
hat mir allerdings keinen Acceskey...