Page 3 of 3

Posted: Sat Aug 18, 2007 11:41 am
by superdezign
JellyFish wrote:But anyways, I don't understand what you mean by this: die( ............ 'The error is: '.$errstr);. I didn't get that.
Then you missed my post. Look up.

Posted: Sat Aug 18, 2007 11:50 am
by JellyFish
Okay, I read it up there. But can I set $errono or $errstr without passing the $port argument? How does that work?

Posted: Sat Aug 18, 2007 11:53 am
by miro_igov
Why you can't use cURL? not installed or your ISP blocks the outgoing requests? If 2nd you will not be able to run fsockopen too.

Posted: Sat Aug 18, 2007 11:53 am
by superdezign

Code: Select all

fsockopen($host, 80, $errno, $errstr);
echo "Error: $errstr (error code: $errno)";

Posted: Sat Aug 18, 2007 12:04 pm
by JellyFish
Woaw. Wait a sec. I changed it to hearts:

Code: Select all

$socket = @fsockopen($url['host'], 80, $errno, $errstr) or die('Error: unable to open a socket connection with '.$url['host'].'\n $errno: $errstr');
And then my response:
HTTP/1.0 302 Moved Temporarily Location: https://www.linkpointcentral.com/lpc/servlet/lppay X-Cache: MISS from wc03.inet.mesa1.secureserver.net Connection: close
And I think that this is not an error but a response that function HttpRequest returns and that I echoed out.

Code: Select all

$transaction = HttpRequest("https://www.linkpointcentral.com/lpc/servlet/lppay", $myorder);

exit($transaction);
You see I used exit with the results of $transaction. I didn't state this before, and that's my bad. But now I think I actually was able to connect to the server, cuz look when I change [exit($transaction);] with [exit($transaction."CONNECTION WAS SUCCESSFUL!");] my response then becomes:
HTTP/1.0 302 Moved Temporarily Location: https://www.linkpointcentral.com/lpc/servlet/lppay X-Cache: MISS from wc02.inet.mesa1.secureserver.net Connection: close CONNECTION WAS SUCCESSFUL!

Yippee! Thanks for all the post guys, I'm so glad that this function works and ALL the help on this thread! Thank you guys SO, SO MUCH!

PS: I'll start another thread if I get any other troubles, considering this thread is getting a little to big. K?

POST-PS: Btw, what kind of http response is that anyway?

Posted: Sat Aug 18, 2007 12:08 pm
by superdezign
By the way, your die() uses single quotes.

Posted: Sat Aug 18, 2007 12:11 pm
by JellyFish
superdezign wrote:By the way, your die() uses single quotes.
What's wrong with that?

Posted: Sat Aug 18, 2007 12:52 pm
by superdezign
JellyFish wrote:
superdezign wrote:By the way, your die() uses single quotes.
What's wrong with that?
... "\n", "$errno", "$errstr".

Posted: Sat Aug 18, 2007 1:19 pm
by JellyFish
superdezign wrote:
JellyFish wrote:
superdezign wrote:By the way, your die() uses single quotes.
What's wrong with that?
... "\n", "$errno", "$errstr".
I really don't understand what you're trying to say but I'll change them.

Posted: Sat Aug 18, 2007 1:39 pm
by superdezign
Really? Oh, then this is definitely a detail that you'll need to know.

Single quotation marks take variables as literal strings, not regular variables. Also, it doesn't render special characters.
Double quotation marks allow you to place variables inline and render special characters, such as the newline.

Posted: Sat Aug 18, 2007 1:50 pm
by JellyFish
superdezign wrote:Really? Oh, then this is definitely a detail that you'll need to know.

Single quotation marks take variables as literal strings, not regular variables. Also, it doesn't render special characters.
Double quotation marks allow you to place variables inline and render special characters, such as the newline.
Oooooooooooooooooooooooooooooooooooooooooooooooooooooooooh yeah! I almost forgot. So by me using single quotes I shouldn't expect $errno and $errstr to out put as the values of these variables.

Thanks.

Posted: Sun Aug 19, 2007 4:57 am
by volka
JellyFish wrote:I already stated that I can not use the port on my server to connect to a remote server, thus I can not use cURL methods. My only option is to make a post request.
That doesn't make much sense. curl sends a post request if you set CURLOPT_POST