|
Having problem with php post with curl
|
|
08-09-2008, 09:32 PM
(This post was last modified: 08-09-2008 09:34 PM by daniel.)
Post: #1
|
|||
|
|||
|
Having problem with php post with curl
I want to do a php submit from server A to a form on server B but I dont want the browser to end up showing a url on server A it should be now on a page on server B.
Was trying to use curl but it did not seem to work any help you can give me on this would be great. Sorry forgot to add code: PHP Code: <?php |
|||
|
08-09-2008, 09:35 PM
Post: #2
|
|||
|
|||
|
RE: Having problem with php post with curl
Curl runs on the server side, you can't use it to force the browser to redirects. Use header() instead. Here's a snippet to query google:
PHP Code: <?php Warm Regards, Website Design India Submit Free Links Website Design Faridabad |
|||
|
08-09-2008, 09:36 PM
Post: #3
|
|||
|
|||
|
RE: Having problem with php post with curl
Thank I guess google was just an example. if I can not use Curl does that mean I have to use sockets ?
I want to redirect the browser to the remote servers output I dont want to show the user the output from the remote server on my website (if that makes sense) |
|||
|
08-09-2008, 09:37 PM
(This post was last modified: 08-09-2008 09:37 PM by ved.)
Post: #4
|
|||
|
|||
|
RE: Having problem with php post with curl
Ok I understand. But I don't think this could be done on the server side. Maybe you could use a simple javascript tricks.
I assume this scenario: 1. you have a page http://www.mydomain.com/myfile.php 2. if a client request the file, automatically post some data to http://www.somedomain.com/somefile.php 3. redirect the client's browser to the remove server, which displays the output from previous action. Here's the contents of myfile.php PHP Code: <form name="form_1" action="http://www.somedomain.com/somefile.php" method="post">You might want to use Apache RewriteRules on the first server, then use Deny/Allow directives to prevent people from accessing the remote server directly. Also consider file_get_contents ('http://otherserver.com/file.php'), etc - possibly even include 'http://otherserver.com/file.php'; Warm Regards, Website Design India Submit Free Links Website Design Faridabad |
|||
|
« Next Oldest | Next Newest »
|





