דוגמאות קוד (דף 1 מתוך 1)

בעמוד זה תוכלו לראות דוגמאות קוד להתממשקויות שונות

בעזרת דוגמאות אלו תוכלו לבנות את ההתממשקות שאתם זקוקים לה.

 

טופס HTML בשיטת POST

<form method="post" action="https://api.leadmanager.co.il/v1/submit">
 <input name="lm_form" type="hidden" value="123456">
 <input name="lm_key" type="hidden" value="86e349ac897640fa8e8a8801992e0204">
 <input name="fullname" type="text" required>
 <input name="phone" type="text" required>
 <input name="email" type="text" required>
 <input type="submit">
</form>

 

טופס HTML בשיטת GET

<form method="get" action="https://api.leadmanager.co.il/v1/submit">
 <input name="lm_form" type="hidden" value="123456">
 <input name="lm_key" type="hidden" value="86e349ac897640fa8e8a8801992e0204">
 <input name="fullname" type="text" required>
 <input name="phone" type="text" required>
 <input name="email" type="text" required>
 <input type="submit">
</form>

קוד PHP

// this is your form's action URL
// this is your form's action URL
$url = 'https://api.leadmanager.co.il/v1/submit';

$ch = curl_init();

// set the target URL which contains scripts that accepts post request
curl_setopt($ch, CURLOPT_URL, $url);

// set the variables to be sent
// the format of the variables is var1=value1&var2=value2&var3=value3
$data = array();

foreach ($_POST['form'] as $post => $value)
{
	if (is_array($value))
		foreach ($value as $post2 => $value2)
			$data[] = $post.'[]='.urlencode($value2);
	else
		$data[] = $post.'='.urlencode($value);
}
curl_setopt($ch, CURLOPT_POSTFIELDS, implode('&', $data));

// execute curl,fetch the result and close curl connection
$result = curl_exec($ch);
curl_close($ch);

 

 



צרו איתנו קשר עכשיו לקבלת חשבון חינם


* מאשר/ת שיתקשרו אלי חזרה
* מאשר/ת קבלת הודעות ו/או מידע אודות השירות