Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open a file accross HTTPS

Status
Not open for further replies.

BigBadDave

Programmer
May 31, 2001
1,069
0
0
EU
This is my code :

$curreny_match = '(GBP_EUR=)([a-zA-Z_0-9@!%-;&`,\'\+\$\.\n\t\r ]+)';//'
$fp = fopen("$target = @implode( "\n", $fp);
eregi($curreny_match , $target, $match);
$currency_rate = "$match[2]";
fclose($fp);

But i get the following :

Warning: fopen(" - No such file or directory in /usr/home/p/r/prosite/public_html/myshop/menu.php on line 6

Warning: Supplied argument is not a valid File-Handle resource in /usr/home/p/r/prosite/public_html/myshop/menu.php on line 10

How can I open the file for reading?? Regards

Big Bad Dave

logo.gif


davidbyng@hotmail.com
 
Anybody know how to do this?? Regards

Big Bad Dave

logo.gif


davidbyng@hotmail.com
 
I think you need to remove the instID part from the URL. I believe this is an generated sessionID that you can't force because it expires when the session is stopped.

hth
Bastien

There are many ways to skin this cat,
but it still tastes like chicken
 
Fopen doesn't support https. See
However, on the link above, you will see that is soon to be taken care of:

"As of PHP 4.3.0 (not yet released), if you have compiled in support for OpenSSL, you may use " to open an HTTP connection over SSL."

You will have to have PHP built for OpenSSL support, though.

Another way to handle this is to install the Curl ( library on your system, and use it to retrieve remote data over SSL. If Curl is installed on an SSL-enabled (OpenSSL, etc...) system, then it can make https connections. -------------------------------------------

"Calculus is just the meaningless manipulation of higher symbols"
                          -unknown F student
 
Yes, it's like rycamor is saying. You MUST use CURL lib to do that.

There is a great site about CURL. and there you have a link to a list of PHP using CURL.

It's easy to implement. Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
Is there any other solution as I can't install stuff on the server as I can't get shell access (its a shared hosting account) Regards

Big Bad Dave

logo.gif


flashtektips@hotmail.com
 
Without shell access, it's pretty doubtful. You might just try a bit of judicious searching to see if it is already installed on the system, so you can access it using PHP's command-line functions (system, exec, etc...). Just try a simple script with

system("locate curl");

And see if it finds curl at /usr/local/bin/curl, or /usr/bin/curl.

If so, you could then try something like system("/usr/local/bin/curl --help"), to output some info on how to use curl, and then experiment a bit with the command-line options. Also, visit the website.

Failing this, your best bet is to see if your host has the Perl SSLeay module installed, which is one of the best ways to deal with remote SSL data. It's not such a bad thing to use Perl now and then ;-).
-------------------------------------------

"Calculus is just the meaningless manipulation of higher symbols"
                          -unknown F student
 
I searched here and @ experts exchange and saw where there will be scripts soon available to do what you want without cURL. I'm using one now...but it's not ssl. You don't need cURL to POST/GET http(s).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top