473,569 Members | 2,402 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

making an https request with POST method in osCommerce

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
Jul 17 '05 #1
2 5311
> In catalog/login.php:

My suggestion is this:
Instead of directly dealing w/ catalog/login.php in the first place, you might want to try writing your functionality into a totally separate file that stands alone. Make that work first, then start working on integrating that into one of the OSCommerce pages.

I also suggest that once you get the cUrl stuff working and you can properly login to the 3rd party server, you do it as maybe a hidden <iframe> or maybe do a popup window that hides itself once it is finished. This way you have minimal changes in your osCommerce files and linking them will be a simple include which wouldn't hurt anything and can be removed just as easily.

I really think you should start from there and move forward from that point.

Hope this helps -

_______________ ________
Wil Moore III, MCP | Integrations Specialist
Jul 17 '05 #2
Thanks Wil,

I'm going to try that out. If it works out, am I allowed to post your
suggestion (with my execution code) to an osCommerce forum
(osdox.com)? It might help someone else. Thanks

<la*******@hotm ail.com> wrote in message news:<10******* ******@corp.sup ernews.com>...
In catalog/login.php:


My suggestion is this:
Instead of directly dealing w/ catalog/login.php in the first place, you
might want to try writing your functionality into a totally separate
file that stands alone. Make that work first, then start working on
integrating that into one of the OSCommerce pages.

I also suggest that once you get the cUrl stuff working and you can
properly login to the 3rd party server, you do it as maybe a hidden
<iframe> or maybe do a popup window that hides itself once it is
finished. This way you have minimal changes in your osCommerce files and
linking them will be a simple include which wouldn't hurt anything and
can be removed just as easily.

I really think you should start from there and move forward from that
point.

Hope this helps -
Wil Moore III, MCP | Integrations Specialist
--

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3886
by: Meya | last post by:
Hi, when I hit my http://<domain name> site,I am getting this error msg: I have also installed my SSL cert on the IIS 5.0 ******************************** The page must be viewed over a secure channel Please try the following:
1
2182
by: dave | last post by:
Hello I have one simple form (myform.asp) and it posts to query.asp I had put below code in both file on top of the page to redirect this two pages in https:// so any one can access it thru http , it changes to https:// if Request.ServerVariables("HTTPS") = "off" then method = Request.ServerVariables("REQUEST_METHOD") srvname =...
2
2259
by: Jonathan Wax | last post by:
Hi, I spent the last week looking for an answer to the following question: How can you upload an xml file to an HTTPS server with a specific certificate. Basically doing the same as this html form in c# code: <form method="post" enctype="multipart/form-data" action="https://www.site.com/upload/"/> <input type="file" name="xml"...
1
1828
by: Asha | last post by:
greetings, i need to upload an .xls file using a secure connection. so i though of using https... can i know how this can be done?
2
6924
by: Amoril | last post by:
I am currently developing an app that will post an XML file (1 to 100MB+ in size) to an outside vendor application via HTTPS Post (doing this in a vb.net windows app). The vendor will then at some later date post an updated return XML file to my webserver (asp.net). The primary problem I'm having is getting the posted stream to load in an...
0
904
by: YYZ | last post by:
I'm trying to write code to connect to a place on the net, send them an xml file, and get one in return. I've pieced together the following code, and was wondering if anyone can tell me if I'm on the right track or not. In particular, if anyone knows, am I supposed to the ContentType to something like "xml"? Dim netCred As New...
2
27140
by: Arti | last post by:
Hi, I am trying to access a servlet hosted on Tomcat server using HTTPS Post protocol. I am getting the exception: "The underlying connection was closed: Could not establish trust relationship with remote server". Below is the code snippet. The same worked fine for HTTP POST. Then when I configured the Tomcat server ffor HTTPS, and...
2
1573
by: Greg Wood | last post by:
As a new member, I hope I am posting correctly. Bear with me if not ! I found a posting by Earle Oxner that very closely matches the situation we are in. Sadly, there were no replies to his post, so I am asking a similar question. We have developed a .Net Compact Framework 2 forms application & deployed it on a 2 PDAs, one running Windows...
0
4057
by: shlim | last post by:
Currently I'm using VB.Net to perform a http/https multipart form post to a servlet. I'm able to perform the post using HttpWebrequest via GetRequestStream(). However, the servlet returned me with "The remote server returned an error: (500) Internal Server Error". Obviously, this means that I have not posted all the parameters as the servlet...
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7679
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6287
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5223
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
946
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.