php.de

Zurück   php.de > Webentwicklung > PHP Einsteiger > PHP Tipps 2009

 
 
LinkBack Themen-Optionen Thema bewerten
Alt 10.03.2009, 10:58  
Neuer Benutzer
 
Registriert seit: 30.01.2009
Beiträge: 13
GTA26 ist zur Zeit noch ein unbeschriebenes Blatt
Standard Curl Post Problem

Hallo Leute, habe folgendes Problem.
Irgendwie bekomme ich es nicht hin, dass mein mit
Curl generierter Post vom Server angenommen wird.
Ich habe das Gefühl es liegt an Folgende Argumente im Form:

ENCTYPE="multipart/form-data.

Das Form beinhaltet noch ein Feld, das einem erlaubt Dateien mit zu senden.
Im Post werden gleich zwei variable mitgesendet.

Content-Disposition: form-data; name="new_attachment"; filename=""
Content-Type: application/octet-stream

Wie kann man dies im Curl als Argument mitschicken?

Hier noch alle Infos die man braucht.

//Abgefangenes Post:
//-------------------------------------------------------------------------
POST /newsletter/newsletter_new.asp?action=add&id= -----------------------------60042650020100
Content-Disposition: form-data; name="new_subject"

Subjekt
-----------------------------60042650020100
Content-Disposition: form-data; name="new_body"

Nachricht
-----------------------------60042650020100
Content-Disposition: form-data; name="new_sender"

mail Adresse
-----------------------------60042650020100
Content-Disposition: form-data; name="new_senderName"

sender Name
-----------------------------60042650020100
Content-Disposition: form-data; name="new_receiver"


-----------------------------60042650020100
Content-Disposition: form-data; name="new_receiverList"

46
-----------------------------60042650020100
Content-Disposition: form-data; name="new_sendDate"

10.03.2009
-----------------------------60042650020100
Content-Disposition: form-data; name="new_sendHour"

00
-----------------------------60042650020100
Content-Disposition: form-data; name="new_sendMin"

00
-----------------------------60042650020100
Content-Disposition: form-data; name="new_attachment"; filename=""
Content-Type: application/octet-stream


-----------------------------60042650020100
Content-Disposition: form-data; name="new_type"

0
-----------------------------60042650020100
Content-Disposition: form-data; name="Submit"

Senden
-----------------------------60042650020100--
//-------------------------------------------------------------------------


Code:
//HTML Form:
//-------------------------------------------------------------------------
<form action="?action=add&id=" method="post" ENCTYPE="multipart/form-data">

<table width="100%"  border="0" cellspacing="0" cellpadding="0">
<tr><td>Betreff</td><td align="left"><input name="new_subject" type="text" class="iav3Input" tabindex="1" value=""> </td></tr>
<tr>
  <td>Nachricht </td>
  <td align="left"><textarea name="new_body" class="iav3Textarea" tabindex="2" rows="15"></textarea>&nbsp;<%=error_new_body%></td>
</tr>

<tr>
  <td>Absender Email </td>
  
  <td align="left"><input name="new_sender" type="text" class="iav3Input" tabindex="3" value="mail@adresse.ch" readonly> </td>
  
  </tr>
  <tr>
  <td>Absender Name</td>
  <td align="left"><input name="new_senderName" type="text" class="iav3Input" tabindex="4" value=""> </td></tr>

<tr><td>Empfänger</td><td align="left"><input name="new_receiver" type="text" class="iav3Input" tabindex="5"> </td></tr>
<tr><td>&nbsp;</td><td align="left">

<select name="new_receiverList" class="iav3Input" tabindex="6" >
	<option value="-1" selected>Bitte wählen</option>
	
		<option value="46" >Block 1</option>
	
		<option value="47" >Block 2</option>
	
		<option value="48" >Block 3</option>

	
		<option value="49" >Block 4</option>
	
		<option value="50" >Block 5</option>
	
		<option value="51" >Block 6</option>
	
		<option value="52" >Block 7</option>
	
</select>	
		
</td></tr>
<tr>
  <td>Sende-Datum</td>

 <td align="left"><input name="new_sendDate" type="text" class="iav3Input" tabindex="4" value="10.03.2009"> </td>
</tr>
<tr>
  <td>Sende-Zeit</td>
  <td align="left">
  <select name="new_sendHour" id="new_sendHour" >
    <option value="00" selected>00</option>
    <option value="01" >01</option>

    <option value="02" >02</option>
    <option value="03" >03</option>
    <option value="04" >04</option>
    <option value="05" >05</option>
    <option value="06" >06</option>
    <option value="07" >07</option>

    <option value="18" >18</option>
    <option value="19" >19</option>
    <option value="20" >20</option>
    <option value="21" >21</option>
    <option value="22" >22</option>
    <option value="23" >23</option>

  </select>
   h 
   <select name="new_sendMin" id="new_sendMin" >
    <option value="00" selected>00</option>
    <option value="30" >30</option>
  </select>
   min </td>
</tr>

<tr><td>Anhang</td><td align="left"><input name="new_attachment" type="file" class="iav3Input" tabindex="7"></td></tr>
<tr>
  <td>Typ</td>
  <td><input name="new_type" type="radio" value="0" checked="checked" /> 
    Email  
    <input name="new_type" type="radio" value="1" /> 
    SMS </td>
</tr>
<tr>
  <td> </td>

  <td><input type="submit" name="Submit" tabindex="8" value="Senden"  /></td>
</tr>
<tr>
  <td></td>
  <td>&nbsp;</td>
</tr>
</table>
</form>
 //------------------------------------------------------------------------
GTA26 ist offline  
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

Alt 10.03.2009, 15:56  
PTC
Erfahrener Benutzer
 
Benutzerbild von PTC
 
Registriert seit: 27.10.2007
Beiträge: 1.708
PHP-Kenntnisse:
Anfänger
PTC ist einfach richtig nettPTC ist einfach richtig nettPTC ist einfach richtig nettPTC ist einfach richtig nett
Standard

Eine genauere Fehlerbeschreibung wäre hiflreich um zu helfen.
Was hat das Ganze jetzt mit cURL zu tun?
PTC ist offline  
Alt 10.03.2009, 23:16  
Neuer Benutzer
 
Registriert seit: 30.01.2009
Beiträge: 13
GTA26 ist zur Zeit noch ein unbeschriebenes Blatt
Standard

Das Post will ich über Curl versenden.
Von meinem Server aus zu einem anderen!

curl_setopt($ch, CURLOPT_POSTFIELDS, 'new_subject=subject&new_body=Textfeld&new_sender= email@adresse.com&new_senderName=AbsenderName&new_ receiver=&new_receiverList=46&new_sendDate=09.03.2 010&new_sendHour=01&new_sendMin=01&new_attachment= &new_type=0&submit=Senden');

Irgendwas Stimmt nich, da das Form immer verworfen wird.
Ich sehe den Fehler jedoch nicht

Habe aber das gefühl das es an ENCTYPE="multipart/form-data. im Formular und an name="new_attachment"; filename="" Content-Type: application/octet-stream im Post liegen kann.

Hilfe

Zitat:
Zitat von PTC Beitrag anzeigen
Eine genauere Fehlerbeschreibung wäre hiflreich um zu helfen.
Was hat das Ganze jetzt mit cURL zu tun?
GTA26 ist offline  
 


Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Post & curl Necronomicon PHP Tipps 2009 3 12.02.2009 12:43
CURL funktieonieren nicht bazik PHP-Fortgeschrittene 12 07.11.2008 09:43
fsockopen mit https ohne curl und openssl loom613 PHP-Fortgeschrittene 13 25.10.2008 03:17
Problem mit Post ? PHP Tipps 2007 8 28.12.2005 12:01
Post zum Host nach discconect... PHP-Fortgeschrittene 4 01.12.2005 17:47
xampp->apache problem mit skydsl proxy djrace Server, Hosting und Workstations 0 25.09.2005 16:14
post problem PHP Tipps 2005-2 21 08.09.2005 21:44
MySQL, PHP und ein großes Problem! Datenbanken 2 27.08.2005 10:51
wiedermal ein kleines problem mit der post methode Tic Rederon PHP Tipps 2005-2 4 23.08.2005 08:59
[Erledigt] PHP Problem (GET und POST variabeln) PHP-Fortgeschrittene 1 16.08.2005 17:39
POST Problem: Übergabe von Formulardaten Asipak PHP Tipps 2005-2 19 19.07.2005 11:12
[Erledigt] Problem: The requested method POST is not allowed for the Server, Hosting und Workstations 17 31.05.2005 15:15
[Erledigt] PHP nachträglich mit CURL Support ausstatten PHP-Fortgeschrittene 2 20.12.2004 16:19
Problem mit post und get? PHP Tipps 2004 2 21.08.2004 14:39
Problem mit Post und PHP-4.3.8 PHP Tipps 2004 7 20.07.2004 20:37

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
curl post, php curl post, curl content-type, curl multipart/form-data, post curl, curl application/octet-stream, php curl application/octet-stream, curl post problem, php curl content type, curl post senden, php curl content-disposition, content-disposition curl, curl content-type: application/octet-stream, curl multipart form-data, php curl octetstream, curl octet-stream problem, php curl multipart different content-type, content-disposition: form-data content-type: application/octet-stream post curl, curl octed, curl post content

Alle Zeitangaben in WEZ +2. Es ist jetzt 19:26 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum