View Full Version : PHP Advice
iUnknown
23-09-2008, 10:22 PM
Hello,
I have got a page on a separate server on separate hosting (obviously) and I want to connect to the URL by http://blahblah.com/blah.php and send stuff from a form by POST to it, then I want to store all the text/source of the content that appears when this data is posted to the file as a variable.
How can I do that?
:)
Hypertext
23-09-2008, 10:27 PM
Just collect it normally like
$txtSource = $_POST['txtSource'];
Unless I'm misunderstanding something.
Hypertext
23-09-2008, 10:28 PM
Just collect it normally like
$txtSource = $_POST['txtSource'];
Unless I'm misunderstanding something.
iUnknown
23-09-2008, 11:14 PM
No, I want the PHP on my page to post information from a form on my page to a page on another website, and store what the website shows as a variable on my page. so it's posting to another host and getting the page from another host. it's not getting posted to.
http://uk.php.net/manual/en/function.fwrite.php
But I think you gota open the file before writing :P
http://uk.php.net/fopen
Robbie
24-09-2008, 06:18 PM
Take a look at cURL :)
Decode
24-09-2008, 06:24 PM
You don't need cURL? You can just to a normal form that submits to another site, then on the other site write the data to a file normally.
Robbie
24-09-2008, 07:09 PM
Oh yeah I thought he was doing it from just a script and not from a form :) Misunderstood :P
http://uk.php.net/manual/en/function.fwrite.php
But I think you gota open the file before writing :P
http://uk.php.net/fopen
I don't think you can fopen on remote urls.
I don't think you can fopen on remote urls.
oops, didnt read that xD
iUnknown
24-09-2008, 09:26 PM
You don't need cURL? You can just to a normal form that submits to another site, then on the other site write the data to a file normally.
How does the other site write the data back to the original site?
Dentafrice
24-09-2008, 09:27 PM
You're not explaining this well enough.. why don't you give us some examples on what would be sent, and what you want it to do with it..
Decode
25-09-2008, 06:52 AM
How does the other site write the data back to the original site?
It doesn't, just set sessions before its posted to the external site.
iUnknown
26-09-2008, 04:43 PM
Ok, I want to put a form to upload an mp3 file on my website, it then goes to a page on another website, which uploads it and then the content of the page that is seen after that contains the link (http://) on its own. No HTML or anything, just the URL. How do I get that URL?
Dentafrice
27-09-2008, 02:18 AM
Post the form directly to the page on the other site, then redirect back with the data..?
On your upload script, just do:
header( 'Location: http://www.mysite.com/return.php?data=' . $imageURL' );
iUnknown
27-09-2008, 07:46 PM
Post the form directly to the page on the other site, then redirect back with the data..?
On your upload script, just do:
header( 'Location: http://www.mysite.com/return.php?data=' . $imageURL' );
But how do I get the page to send the data to the upload page, then be ready to receive data back, and what if two people do it at the same time?
Dentafrice
27-09-2008, 07:48 PM
It's not going to matter.. just post the data from the page, directly to the upload page..?
action=""
You've really not dont a great job of explaining what you want.
Can I ask WHY you need it too? :P
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2026 vBulletin Solutions Inc. All rights reserved.