seeking some help
| From: | RICHARD O. | Date: | Tue, 26 Feb 2013 15:48:57 +0000 |
| Subject: | seeking some help | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-15566@lists.php.net to get a copy of this message | ||
Hello!
I have problems integrating enom's TLDs portal in my site.
It was needed that every client visiting the portal on my site should pull a
token authomatically to be able to login.
The widget is
<div id="tldportal-root"></div>
<script
src='http://tldportal.com/api/embed?token={61575B5652535307524F550404504F565
A07574F030354064F5B52530155565B50575B06511E1
61007031117101B111B1116070F1122050F030B0E4C010D0F1E534D574D50525351425353585
1
5A58565642322F1E53}'type="text/javascript">
</script>
So I was now asked to find a help using the suggestions below:
$TOKEN = '';
$postfields = array();
$postfields['embeded'] = "1";
$postfields['uid'] = 'resellerdemo';
$postfields['pw'] = 'resellerdemo';
$postfields['portaluserid'] = 'MY-Logged-In-User-ID';
$postfields['email'] = ' <mailto:MY-Logged-In-User-Email@Email.com>
MY-Logged-In-User-Email@Email.com';
$postfields['command'] = "PORTAL_GETTOKEN";
$postfields['responsetype'] = "XML";
$query_string = "";
foreach ($postfields AS $k=>$v)
$query_string .= "$k=".urlencode($v)."&";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, '
<https://resellertest.enom.com/interface.asp')>
https://resellertest.enom.com/interface.asp');
curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$data = curl_exec($ch);
if (curl_error($ch)) {
echo "CURL Error: ".curl_errno($ch)." - ".curl_error($ch);
}
curl_close ($ch);
$xmldata = simplexml_load_string($data);
$TOKEN = $xmldata->{'token'};
?>
<!-- START WATCHLIST --> <div id="tldportal-root"></div> <script
src="https://tldportal.com/api/embed?token=<?php
echo $TOKEN;?>"
type="text/javascript"></script> <!-- END WATCHLIST -->
</body> </html>
I wish you have such time here in this community to look into such problems.
Thanks.
Richard O. Absilim