Dear All,
I need to send some data from my site to another site, but i do not want to hit that site. Is there any option.
Currently i am using form to doing it but after submitting it, i do not want to transfer control to another site.
I needed immediate help.
Thanking you.
Regards
Kamill
[PHP]
<form action="memberlogin.php" method="get" >
<input type="hidden" name="Amount[]" value="<?php echo $product_final_price ?>" />
<input type="hidden" name="Order_Code[]" value="<?php echo $myorder_code ?>" />
<input type="hidden" name="Subscription_ID[]" value="<?php echo $product_unit ?>" />
<input type="hidden" name="Username" value="<?php echo $usernamee ?>" />
<input type="hidden" name="Email" value="<?php echo $useremaill ?>" />
<input type="hidden" name="Remarks" value="<?php echo $customer_note ?>" />
<input type="submit" name="submit" value="OK" />
</form>
[/PHP]
10 3016 nathj 938
Recognized Expert Contributor
Hi Kamill,
If I understand you correctly you are submiting data from your site to a secondary site. Is this correct?
If so the second site needs to receive the data then set the header location back tot refereing page - your site. In this way the data will be received and processed and the user will see the page they started on. Alternatively you could, via the $_POST data send the page you wish the user to be returned to on your site.
The header code would look like this:
[php]
header("Location:targetpage.php"); // this may also include a query string
[/php]
It seems to me that you need to speak with the people responsible for the site you are posting to.
If, however, you mean that one page on your site is posting to another page that you don't want displayed then theory is the same, but the execution is easier as you control it all.
I hope that helps you out.
Cheers
nathj
Hi Nathi
Thanks for quick repply.Actually My code is something like this,
================================================== ===============================[/font][/size][/font]
[PHP]
<?php
for($i=0;$i<$n;$i++)
{
$query="select * from `mytable` where `id`='$i'";
?>
<form action="<?php echo $i ?>.php" method="get" >
<input type="hidden" name="a" value="<?php echo $a ?>" />
<input type="hidden" name="b" value="<?php echo $b ?>" />
<input type="hidden" name="c" value="<?php echo $c ?>" />
</form>
<?
}
?>[/PHP]
i need to submit the form(on each itteration) without refreshing the page, Please help me.[/font][/size][/font]
nathj 938
Recognized Expert Contributor
The first thing I have to know is do you have control over how the target site works?
If so then you could load the data to the $_SESSION on each loop trhough then laod the target page, read the $_SESSION variables and re-direct the browser to where you want it to be.
However, if you do not have control over the second site then this could be a problem. Also I am not sure if this would work across domains.
Hopefully this will help you out.
Cheers
nathj
you should have access priviledge of another site those u sending data.........
As well u hv knwledge the working of second website that u can gain the variable control on your site................
Processing language should be same...............of both site..............
then u can access that site...........................
ak1dnar 1,584
Recognized Expert Top Contributor
Processing language should be same...............of both site..............
then u can access that site...........................
No my dear, Its Not correct.
As far as you transferring POST/GET data over HTTP protocol, language is not a issue. for example Here on your site say you are using PHP. You have a Form setup here and processing script for the form is an ASP page that is on a Different domain. Since ASP is accepting HTTP requests you can transfer your Post/Get data back and forth.
And for the Original Poster's Question: You better to try some AJAX if you do not wish to redirect back to the Target domain's Script.
I do not have any knowledge about Ajax, can you post some sample code here.
No my dear, Its Not correct.
As far as you transferring POST/GET data over HTTP protocol, language is not a issue. for example Here on your site say you are using PHP. You have a Form setup here and processing script for the form is an ASP page that is on a Different domain. Since ASP is accepting HTTP requests you can transfer your Post/Get data back and forth.
And for the Original Poster's Question: You better to try some AJAX if you do not wish to redirect back to the Target domain's Script.
nathj 938
Recognized Expert Contributor
I do not have any knowledge about Ajax, can you post some sample code here.
The best thing to do is work through a tutorial. then you will be able to see what it can do before you think about how you can use it.
Cheers
nathj
gregerly 192
Recognized Expert New Member
There is another way with PHP that you can post data to another site without leaving your site. It's called CURL. It's used on many payment gateways to send data and receive a response without leaving your site. Look into the CURL library for PHP and it may be what your looking for.
Greg
ak1dnar 1,584
Recognized Expert Top Contributor
Oh my bad, yeap CURL is also a good point to start over. Nice work greg !
gregerly 192
Recognized Expert New Member
Oh my bad, yeap CURL is also a good point to start over. Nice work greg !
My pleasure. I only recently started using it to utilize other web services, and read RSS feeds into my websites. Works like a charm!
Greg
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Magnus Blomberg |
last post by:
Hello!
I am developing a C# windows application that should send a file using FTP.
Does anyone knows how to make my application do this. I haven't found the
correct object to perform this.
It...
|
by: CHIN |
last post by:
Hi all.. here s my problem ( maybe some of you saw me on other groups, but i
cant find the solution !! )
I have to upload a file to an external site, so, i made a .vbs file , that
logins to...
|
by: Zaidan |
last post by:
I am running Excel2000 under WIN98 2nd edition, and I am writing a VBA
code (I will consider using javascript if I have to) that does the
following, at the user command:
1- Start MS Explorer and...
|
by: Vishal |
last post by:
Hello,
I already asked this question in the ASP.NET forums,
but no help came. So I am hoping that somebody can help me
out. This is really very URGENT me.
For my e-commerce application, I...
|
by: Miro |
last post by:
VB 2003
at the end of the code, this works great.
bytCommand = Encoding.ASCII.GetBytes("testing hello send text")
udpClient.Send(bytCommand, bytCommand.Length)
and this recieves it
Dim...
| |
by: Andrea |
last post by:
Hi
I've having a very strange problem using the SendInput API to send
text to other applications.
I've written the code and it seems to work well. I discovered a
strange problem: when I try to...
|
by: Markgoldin |
last post by:
I am sending an XML data from not dontnet process to a .Net via socket
listener.
Here is a data sample:
<VFPData>
<serverdata>
<coderun>updateFloor</coderun>
<area>MD2</area>...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
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...
|
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,...
| |
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...
|
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...
|
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 ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |