Hello everybody,
I have an osCommerce shopping cart on my site, which is an open-source
product that uses php. I'm very new to php. I also have an online
scheduling application that I outsourced to a third party, which
resides on a different server. I asked my scheduling provider if there
was anyway I could use my osCommerce php registration for thier
registration so I could avoid having visitors to the site register and
sign-in twice, once for the store and once to schedule appointments.
I was told I would need to create an https request using the POST
method. This seemed like pretty standared scripting activity based on
my limited knowledge.
I did some research and it seems as though cURL is the easiest way to
do this. At first my hosting company did not support cURL. I wrote to
some osCommerce forums asking for help. I found out that my company
did begin supporting cURL and I thought maybe I could use it. I sent
some people at an osCommerce forum my phpinfo() file at
http://www.thefragrantpath.com/checkcurl.php. After reviewing this,
someone at the forum told me my host had cURL enabled but without SSL
support, which meant I needed to "install the command line of cURL." I
was told without ssh/telnet access I couldn't do this and I don't have
ssh/telnet access.
I shared the information with someone else on a newsgroup who said
they couldn't see why I still couldn't use cURL for my purposes.
Figuring I had nothing to lose, I did some experimenting. I don't know
exactly what I'm doing, but I'm encouraged just to be getting error
messages because maybe that will give me some indication of what to do
with some help.
In catalog/login.php:
In place of this:
<!-- body_text //-->
<td width="100%" valign="top"><? php echo tep_draw_form(' login',
tep_href_link(F ILENAME_LOGIN, 'action=process ', 'SSL')); ?>
I put this:
<!-- body_text //-->
<td width="100%" valign="top">
<?php
// make an https request using POST w_curl
$ch = curl_init();
curl_setopt($ch , CURLOPT_URL,"ht tps://app.timetrade.c om/tc/autologin.do?") ;
curl_setopt($ch , CURLOPT_POST, 1);
curl_setopt($ch , CURLOPT_POSTFIE LDS,
"url=thefragran tpath&id=000000 00CLIENTLOGIN&u sr=receptionist &firstname=Jane &lastname=Doe&u sername=test&pa ssword=000000") ;
curl_exec ($ch);
curl_close ($ch);
echo tep_draw_form(' login', tep_href_link($ ch, 'action=process ',
'SSL'));
I changed some of the CURLOPT_POSTFIE LDS for security. I also
eliminated some fields here for space. Basically these are request
paramaters that use the registration fields. The information in the
fields are high level administrative user login information. I'm tryin
to access the scheduling application through the osCommerce
registration.
When I tested the new script I got this:
404 Not Found
The requested URL /giftcertificate/nfoscomm/catalog/Resource id was
not found on this server.
I think this means one of two things:
1. The https request is not communicating with the third-party
scheduling server like it should. It is still communicating the the
osCommerce server.
2. The id in CURLOPT_POSTFIE LDS is incorrect. In that case, all I
would need to do is get the correct ID from my vendor. I suspect it
isn't that easy but I can hope.
Does anyone have any ideas?
Thanks