tommyboy123x Posted December 6, 2007 Share Posted December 6, 2007 I need to send GET data from a server and have it originate from the server's IP. The data will only be accepted on the condition that the IP address is the one on file... how can i do this? I've been out of PHP for a few months and feel like this should be an easy task to accomplish but am having a little mental blocking. Link to comment https://forums.phpfreaks.com/topic/80536-posting-back-data/ Share on other sites More sharing options...
cooldude832 Posted December 6, 2007 Share Posted December 6, 2007 you can get your own ip with $_SERVER['REMOTE_ADDR'] since the server is intializing it self Link to comment https://forums.phpfreaks.com/topic/80536-posting-back-data/#findComment-408331 Share on other sites More sharing options...
tommyboy123x Posted December 6, 2007 Author Share Posted December 6, 2007 if i were to run a cronjob every 10 minutes to check a file, update a database, then send the GET data to another server would it just simply use the server IP automatically? Link to comment https://forums.phpfreaks.com/topic/80536-posting-back-data/#findComment-408339 Share on other sites More sharing options...
cooldude832 Posted December 6, 2007 Share Posted December 6, 2007 well that is sorta tricky, because some times cron doesn't run on your exact server. Many times a shared server ends up having a bunch of people underneath 1 machine that has a bunch of nics in it to give some unique IPS, best bet is to make a cron job right now that stores to a text file the $_SERVER and then compare this to what you know is your accepted IP on this other server. If they match you are good. Link to comment https://forums.phpfreaks.com/topic/80536-posting-back-data/#findComment-408372 Share on other sites More sharing options...
tommyboy123x Posted December 7, 2007 Author Share Posted December 7, 2007 well the shared hosting shouldn't be too much of a problem because the guy has a dedicated one, so this being the case, it will show it as being from the server IP and run the script to its completion? Link to comment https://forums.phpfreaks.com/topic/80536-posting-back-data/#findComment-408415 Share on other sites More sharing options...
cooldude832 Posted December 7, 2007 Share Posted December 7, 2007 test it in a cron that write it to sql/a file and see hwat happens Link to comment https://forums.phpfreaks.com/topic/80536-posting-back-data/#findComment-408420 Share on other sites More sharing options...
tommyboy123x Posted December 7, 2007 Author Share Posted December 7, 2007 I don't have access to the server yet, but i'll report my findings here later. Is it possible to do something like what is below? if (header("location: http://google.com")){ //run SQL query to mark the data as "sent" to the other server }else{ //error report } Link to comment https://forums.phpfreaks.com/topic/80536-posting-back-data/#findComment-408448 Share on other sites More sharing options...
cooldude832 Posted December 7, 2007 Share Posted December 7, 2007 that would redirect Link to comment https://forums.phpfreaks.com/topic/80536-posting-back-data/#findComment-408450 Share on other sites More sharing options...
tommyboy123x Posted December 7, 2007 Author Share Posted December 7, 2007 is it possible to ensure the page is redirected and simultaneously mark that in a database? Link to comment https://forums.phpfreaks.com/topic/80536-posting-back-data/#findComment-408512 Share on other sites More sharing options...
tommyboy123x Posted December 9, 2007 Author Share Posted December 9, 2007 bump? Link to comment https://forums.phpfreaks.com/topic/80536-posting-back-data/#findComment-410099 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.