# Registrierungs-Formular per CURL ausfüllen

**URL:** <https://forum.shopware.com/t/registrierungs-formular-per-curl-ausfullen/65328>\
**Category:** Programmierung\
**Created:** [8. März 2020 um 16:15 UTC](https://forum.shopware.com/t/registrierungs-formular-per-curl-ausfullen/65328 "2020-03-08T16:15:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![intex](https://avatars.discourse-cdn.com/v4/letter/i/e36b37/32.png) [@intex](https://forum.shopware.com/u/intex)\
**Post date:** [8. März 2020 um 16:15 UTC](https://forum.shopware.com/t/registrierungs-formular-per-curl-ausfullen/65328/1 "2020-03-08T16:15:22Z")

</div>

Hallo an Alle,

würde gern das Registrierungsformular per CURL mit PHP ausfüllen, um Adressen in Shopware aus einer Drittquelle einzeln nach Anfall zu bekommen.

Habe dazu dies hier:

> \<?php   
> function curlStart($domain, $var = false){ &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; $fp = curl\_init($domain); &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;curl\_setopt($fp, CURLOPT\_HEADER, 0); &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; curl\_setopt($fp,CURLOPT\_TIMEOUT,100); &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; curl\_setopt($fp,CURLOPT\_FAILONERROR,1); &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; curl\_setopt($fp,CURLOPT\_RETURNTRANSFER,1); &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; if($var != false) { &nbsp; &nbsp; &nbsp; &nbsp; curl\_setopt($fp,CURLOPT\_POST,1); &nbsp; &nbsp; &nbsp; &nbsp; curl\_setopt ($fp, CURLOPT\_POSTFIELDS, $var);&nbsp; &nbsp; &nbsp; } &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; curl\_exec($fp); &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; if(curl\_errno($fp) != 0) { &nbsp; &nbsp; &nbsp; &nbsp; $send = FALSE; &nbsp; &nbsp; } else { &nbsp; &nbsp; &nbsp; &nbsp; $send = TRUE; &nbsp; &nbsp; } &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; curl\_close($fp); &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; return $send; &nbsp; &nbsp;&nbsp; } $formURL = 'https://www.meinshop.de/checkout/shippingPayment'; $var = ' register[personal][customer\_type]=Privat &register[personal][salutation]=Herr &register[personal][accountmode]"=1 &register[personal][email]=test@textxx.de &register[personal][emailConfirmation]=test@textxx.de &register[billing][company]=Testfirma &register[billing][street]=Teststraße &register[billing][zipcode]=34343 &register[billing][city]=Dudelhausen &register[billing][country]=Deutschland &register[personal][firstname]=Dagobert &register[personal][lastname]=Duck'; &nbsp; &nbsp; $send = curlStart($formURL,$var); ?\\>

Es passiert nur nichts. Über einen Test mit&nbsp;[https://reqbin.com/](https://reqbin.com/)&nbsp;bekomme ich immer nur 411 Content-Length required.

Gern kann es auch ein völlig anderer Weg sein. Aufgabe ist lediglich, einen neuen Kunden samt Adresse von woanders ebenfalls in den Shop einzutragen.

&nbsp;

---

<div class="post-metadata">

**Author:** ![sonic](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/sonic/32/25728_2.png) [@sonic](https://forum.shopware.com/u/sonic)\
**Post date:** [8. März 2020 um 18:30 UTC](https://forum.shopware.com/t/registrierungs-formular-per-curl-ausfullen/65328/2 "2020-03-08T18:30:59Z")

</div>

Zum Fehler direkt kann ich nichts sagen, aber bitte bedenken: Die ganzen actions laufen über Post und sind mit CSFR abgesichert, und da über curl wohl kaum der passende Token vorhanden ist , dürfte es schon daran scheitern. Da wäre wohl ein eigener Controller die bessere Wahl.

---

<div class="post-metadata">

**Author:** ![intex](https://avatars.discourse-cdn.com/v4/letter/i/e36b37/32.png) [@intex](https://forum.shopware.com/u/intex)\
**Post date:** [8. März 2020 um 19:11 UTC](https://forum.shopware.com/t/registrierungs-formular-per-curl-ausfullen/65328/3 "2020-03-08T19:11:52Z")

</div>

Könnte ich alternativ nicht direkt über mysqli und PHP die benötigten Einträge in die Datenbank schreiben? Will eigentlich nicht erst die Plugin-Programmierung für Shopware lernen 🙂

---

<div class="post-metadata">

**Author:** ![shyim](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/shyim/32/7681_2.png) [@shyim](https://forum.shopware.com/u/shyim)\
**Post date:** [8. März 2020 um 20:04 UTC](https://forum.shopware.com/t/registrierungs-formular-per-curl-ausfullen/65328/4 "2020-03-08T20:04:40Z")

</div>

Wieso nicht einfach&nbsp;

[https://developers.shopware.com/developers-guide/rest-api/examples/customer/#example-3-create-a-customer-account](https://developers.shopware.com/developers-guide/rest-api/examples/customer/#example-3-create-a-customer-account)

---

<div class="post-metadata">

**Author:** ![intex](https://avatars.discourse-cdn.com/v4/letter/i/e36b37/32.png) [@intex](https://forum.shopware.com/u/intex)\
**Post date:** [9. März 2020 um 08:09 UTC](https://forum.shopware.com/t/registrierungs-formular-per-curl-ausfullen/65328/5 "2020-03-09T08:09:45Z")

</div>

Danke. Gilt das auch noch für Shopware 5?

---

<div class="post-metadata">

**Author:** ![ShapeAndShift](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@ShapeAndShift](https://forum.shopware.com/u/ShapeAndShift)\
**Post date:** [9. März 2020 um 08:14 UTC](https://forum.shopware.com/t/registrierungs-formular-per-curl-ausfullen/65328/6 "2020-03-09T08:14:36Z")

</div>

> [@intex schrieb:](https://forum.shopware.com/profile/17011/intex "intex")
> 
> Danke. Gilt das auch noch für Shopware 5?

Das ist für Shopware 5.

Ziemlich schlechte Umsetzung der Docs aus Usability Sicht her, ich weiß&nbsp; ![Angry-Face](https://forum.shopware.com/plugins/CKEditor/plugins/smiley/images/angry-face.png "Angry-Face")&nbsp;

---

<div class="post-metadata">

**Author:** ![intex](https://avatars.discourse-cdn.com/v4/letter/i/e36b37/32.png) [@intex](https://forum.shopware.com/u/intex)\
**Post date:** [9. März 2020 um 08:20 UTC](https://forum.shopware.com/t/registrierungs-formular-per-curl-ausfullen/65328/7 "2020-03-09T08:20:43Z")

</div>

Danke. Dann lege ich mal los 🙂
