tommyboy123x Posted December 12, 2007 Share Posted December 12, 2007 i need to send multiple (as in hundreds) of get variables to different websites. I want to send them the data, but I do not want to visit their site / have the browser actually go there. Would this make any sense / am i on the right track? $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://www.mysite.com/page.php?getvar1=true&getvar2=false"); curl_exec ($ch); or is there an easier way that i'm simply not seeing? Quote Link to comment Share on other sites More sharing options...
SirChick Posted December 12, 2007 Share Posted December 12, 2007 Not sure if GET can carry info without actually going to that link .... Do you own these other sites, if so you could make them share a database? thats what i do Quote Link to comment Share on other sites More sharing options...
tommyboy123x Posted December 12, 2007 Author Share Posted December 12, 2007 no they would be people who signed up. i have no control over their scripts or anything... and it would have to be GET, not POST. would it be possible to do it with frames? have one frame on the script and the other loading the pages? Quote Link to comment Share on other sites More sharing options...
revraz Posted December 12, 2007 Share Posted December 12, 2007 Since you are not the one GETting anything, you can send any URL info you want. You don't have to retrieve it to be able to redirect to a URL containing ?info. Quote Link to comment Share on other sites More sharing options...
tommyboy123x Posted December 12, 2007 Author Share Posted December 12, 2007 All i want to do is send URL GET data without going to the site. so, mysite.com wants to inform theirsite.org [and several others] that something has happened. It uses a cronjob to check every few minutes for this event and then when necessary, it will inform theirsite.org by sending a GET variable (http://theirsite.org/page.php?foo=bar). but it still has a few more sites to inform. How can i do this? I already left mysite.com so the script has terminated. Quote Link to comment Share on other sites More sharing options...
DyslexicDog Posted December 12, 2007 Share Posted December 12, 2007 Yes you should be able to send that the info to the server using get variables, if that site supports them. If the site API requires POST then you're hosed. Quote Link to comment Share on other sites More sharing options...
tommyboy123x Posted December 12, 2007 Author Share Posted December 12, 2007 I know i can send it but how do i send the get variables without leaving the script? Quote Link to comment Share on other sites More sharing options...
Stooney Posted December 12, 2007 Share Posted December 12, 2007 I think a bit of AJAX may benefit you. Check out this tutorial that was given to me by someone here. http://marc.info/?l=php-general&m=112198633625636&w=2 Quote Link to comment Share on other sites More sharing options...
tommyboy123x Posted December 12, 2007 Author Share Posted December 12, 2007 AJAX!! why didn't i think of that?! I'll post up some code once i have it done. THANK YOU, you are a life saver! Quote Link to comment Share on other sites More sharing options...
tommyboy123x Posted December 12, 2007 Author Share Posted December 12, 2007 as promised echo '<script type="text/javascript"> function ajaxFunction(){ var ajaxRequest; try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } ajaxRequest.open("GET", "http://mysite.com/test.php?a=1&b=2", true); ajaxRequest.send(null); } ajaxFunction(); </script>'; all i needed it to do was drop off the info and die, so this worked out perfectly. chrisdburns, pls check ur inbox Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.