I've spent HOURS searching the net for an answer to this, but can't find it...
I trying to send data using the POST method and also have the control of the browser be turned over to the website that's receiving the POST data (note that this is NOT the same as sending the data via POST method and then redirecting to the website after). I need it to work exactly like hitting the submit button on an html form, and I need it to work from PHP. It needs to POST the data to the site and also let the other site have control at the same time.
I've tried a couple of methods using both cURL and an fsocket function, but it seems like in both cases that (1)the data gets sent to the other site first, (2) then my program gets a response back, (3) and then it redirects to the other site after.
Here's my cURL example: - <?php
-
$user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
-
$url = 'https://www.xyz.com/xyz.exe/xyz-AddItem';
-
$part1 = 'SB123';
-
$item1 = 'blue socks';
-
$qty1 = '1';
-
$price1 = 5;
-
$dat = "PartNo=".$part1."&Item=".$item1."&Qty=".$qty1."&price=".$price1."&";
-
$ch = curl_init();
-
curl_setopt($ch, CURLOPT_POST,1);
-
curl_setopt($ch, CURLOPT_POSTFIELDS,$dat);
-
curl_setopt($ch, CURLOPT_URL,$url);
-
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
-
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
-
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
-
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);
-
$result=curl_exec ($ch);
-
curl_close ($ch);
-
echo("Results: <br>".$result);
-
?>
Somehow I think it needs to redirect (hand over control) when the curl_exec function is called, because this is when the data would be POSTed (but I'm not an expert, so not sure).
Is there a way to terminate my php program AND hand the browser over to this other site AND pass the data over using the POST method?
Any help would be appreciated.
Thanks
0 1593 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Tom |
last post by:
I have created the following code for a product select/payment form (don't know if there is a better
way) and I have been trying to make the following changes (unsuccessfully so far):
1) Eliminate the submit button and submit the form with onchange.
2) Open the action php page in a new window.
I am using this code for different payment options (i.e., cc processing and paypal). As such, there
are multiple forms on the page. The...
|
by: Pete |
last post by:
I have form/select which executes a function using onchange. No
problem. However, when I validate the page with a strict HTML 4.01
doctype at http://validator.w3.org, it demands either an action or a
method for the form?.
If I give it an empty action <form action="" ..... it validates OK. Is
this acceptable or is there a better/standards correct way?
Thanks.
|
by: Brian |
last post by:
On a photographer's web site, I have a catalogue page that lists all
the photos available for purchase. It is marked up as a table, with 1
column for the image title, a second for the material on which it's
printed.
http://www.julietremblay.com/portfolio/catalogue.html
I want to convert this into the first part of an order/inquiry form,
so I added a third column with a checkbox. A user can then select the
photo(s), press a submit...
|
by: Richard Cornford |
last post by:
I am interested in hearing opinions on the semantic meaning of FORM
(elements) in HTML.
I have to start of apologising because this question arose in a context
that is not applicable to the Internet. Specifically, marking up a
document that will contain multiple related form controls (intended
exclusively for client-side scripting) that would never be intended to
be submitted. I realise that that concept is a non-starter in an
Internet...
|
by: John Dunlop |
last post by:
(Note crosspost and follow-ups to ciwah.)
Nicolas Keller wrote in thread "Differences in form handling btw
Mozilla and IE?":
> The problem: I'm using a form that submit's (POST) its data via three
> different image buttons (depending on which button you click,
> something different should happen):
>
> <form action="id.php" method="post" name="form2">
| |
by: Andy Goldstein |
last post by:
I have a table where all the TRs have an onClick handler registered.
One (and only one) of the rows has 2 text input boxes, where each
textbox has an onChange handler registered. Both the onClick and
onChange handlers do some minor manipulation of form data (although
they work on different form elements). If the onChange event fires, I
need the form to be submitted. If the onClick event fires for a TR, I
also need the form to be...
|
by: nick4soup |
last post by:
I have read the CGI FAQ 'How can I avoid users hitting "submit" twice'
(on
http://www.htmlhelp.org/faq/cgifaq.3.html#19 )
which essentially says you have to detect it at the server, using a
hidden form field.
That's fair enough.
My server is therefore processing a response on the first request, so
what kind of HTML response should I send out on the second, duplicate,
|
by: kschneider |
last post by:
Assume there's a form with it's action attribute all set to post to a
URL, but without a submit control. Form submission is done via a link
and I want to prevent the classic "double submit". Ignoring the server
side of things, does anyone see any holes with the following script? It
seems to work, but I'd appreciate other eyes on it. Maybe a
try/catch/finally wrapper of some sort to be sure the link is
re-enabled in the face of an...
|
by: devranger |
last post by:
I have used curl_setopt($ch, CURLOPT_POST, true); and curl_setopt($ch,
CURLOPT_POSTFIELDS, $data); on post forms to retrun results, but what
about a GET Form Method? How do you deal with these with curl? The
same commands?
The particular instance I am dealing with is a store locator and it is
not as easy as just calling the url with the variables becasue it runs
some script behind the scene that does a bunch of calculations for...
|
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 usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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 most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |