Jump to content

maratonic

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

maratonic's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks! This seems to work fine! One question though: does using an iFrame make people's browsers block the call? I think there are security settings that do that but I don't know what the defaults are. /Fredrik
  2. Hi all, What I want to do is this: when the user fetches a page from my server, a POST request should be sent to another server than the one my site is on. Like: call http://theotherserver.com/somescript.php with variable1=3 and variable2=fred. The data that is sent does not require user interaction, I send it with the page from my server. I want the data to be sent from the client, not from my server. I'm not familliar with how HTTP requests are constructed and therefore my "invesigations" have lead to two thoughts that might be completely off target. 1. Include something like this: <img src="http://theotherserver.com/somescript.php?variable1=3&variable2=fred" height="0" width="0" /> but I suspect that this won't produce a valid POST request (but rather a GET request?) 2. Using curl: <?php $url = 'http://theotherserver.com/somescript.php'; $ch = curl_init(); curl_setopt($ch,CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_POST,2); curl_setopt($ch,CURLOPT_POSTFIELDS,'variable1=3&variable2=fred'); $result = curl_exec($ch); curl_close($ch); ?> but I suspect this will send the request from my server, not from the client. SO, do you have any ideas on how to solve it? (If it can even be done?) Thankful for any response. /Fredrik
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.