DeeCee Posted August 31, 2007 Share Posted August 31, 2007 Hello everybody How am i supposed to do this? I want to post info to a script not hosted on my server. I want to do in a way so the user doesnt know where the other PHP script is hosted. Then i want my script to return the remote script content. Heres an example: User submits data. Data is sent to the local script. Local script sends data to remote script remote script processes data Local script reads data on remote server OR remote script sends back processed data Is there anyway i can do this? or is it impossible? Quote Link to comment https://forums.phpfreaks.com/topic/67502-post-info-in-secret/ Share on other sites More sharing options...
matthewhaworth Posted August 31, 2007 Share Posted August 31, 2007 One would like to question why you would want to do such a thing. However, it would only work if the remote server was expecting a remote script. Otherwise, and correct me if I'm wrong, I believe it's impossible to get data from it. Quote Link to comment https://forums.phpfreaks.com/topic/67502-post-info-in-secret/#findComment-338936 Share on other sites More sharing options...
Ken2k7 Posted August 31, 2007 Share Posted August 31, 2007 Does it really matter if they know where the other php script is hosted? Just so you know, no one can page source a php script. Quote Link to comment https://forums.phpfreaks.com/topic/67502-post-info-in-secret/#findComment-338938 Share on other sites More sharing options...
Fadion Posted August 31, 2007 Share Posted August 31, 2007 The user won't know anything. Even if they know they won't care. What u want to do can be achieved with the cURL extension. Anyway ive found this article to send http post data without curl. Give it a try. Quote Link to comment https://forums.phpfreaks.com/topic/67502-post-info-in-secret/#findComment-338944 Share on other sites More sharing options...
teng84 Posted August 31, 2007 Share Posted August 31, 2007 take note what other was saying and ok i guess its possible you can have one db server for on that diff host you can read the content of those db on that part with your script and loads that in your desired db. I guess its like having a secondary storage???? nay way it make no sense for me doing this hard job Quote Link to comment https://forums.phpfreaks.com/topic/67502-post-info-in-secret/#findComment-338946 Share on other sites More sharing options...
MadTechie Posted August 31, 2007 Share Posted August 31, 2007 Does it really matter if they know where the other php script is hosted? Just so you know, no one can page source a php script. really!!, that weird i am viewing my script now!! lol, as for the question in hand, Local script reads data on remote server OR remote script sends back processed data if you have write access to the scripts in question then you can if not then only if the data is processed to the page, if not then no, it would be security hell Quote Link to comment https://forums.phpfreaks.com/topic/67502-post-info-in-secret/#findComment-338947 Share on other sites More sharing options...
Fadion Posted August 31, 2007 Share Posted August 31, 2007 take note what other was saying and ok i guess its possible you can have one db server for on that diff host you can read the content of those db on that part with your script and loads that in your desired db. I guess its like having a secondary storage???? nay way it make no sense for me doing this hard job who's talking about a database by the way?? He just wants to send data to a remote script... as MadTechie said, it will work if u submit post data (in a remote form) to the remote script, otherwise there's no point at all. Quote Link to comment https://forums.phpfreaks.com/topic/67502-post-info-in-secret/#findComment-338950 Share on other sites More sharing options...
DeeCee Posted August 31, 2007 Author Share Posted August 31, 2007 both are my scripts and i know nobody can access the script through html coding. The problem is that i need the other part of the script to be hosted away from the site which people will be using. The purpose of the script is not bad or anything its just that if it was hosted locally the script can be blocked because one of its functions is FSOCK('ing) another site. (PM me if you really want to know what script for) I can modify the both part but i need to know what and how to do this? EDIT: @GuiltyGear - Im taking a look at the page right now. Thank You Quote Link to comment https://forums.phpfreaks.com/topic/67502-post-info-in-secret/#findComment-338954 Share on other sites More sharing options...
corbin Posted August 31, 2007 Share Posted August 31, 2007 Assuming URL wrappers are enabled on host A (the host you have the script making the call to the other script), you could try opting to use GET: <?php $remote_response = @file_get_contents('http://somesite.com/page.php?var1='.$var1.'&var2='.$var2); if($remote_response) { //successful } ?> Quote Link to comment https://forums.phpfreaks.com/topic/67502-post-info-in-secret/#findComment-338956 Share on other sites More sharing options...
DeeCee Posted August 31, 2007 Author Share Posted August 31, 2007 Assuming URL wrappers are enabled on host A (the host you have the script making the call to the other script), you could try opting to use GET: <?php $remote_response = @file_get_contents('http://somesite.com/page.php?var1='.$var1.'&var2='.$var2); if($remote_response) { //successful } ?> I suppose this would work when sending the URL to server B. I could simply echo what is entered in the GETl . Then send it to script B. Quote Link to comment https://forums.phpfreaks.com/topic/67502-post-info-in-secret/#findComment-338959 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.