Hi,
I'd like to pass through an Excel file from one server, (one secret
password) to a user (different passwords). I thought I had duplicated
the headers:
$ch = curl_init();
curl_setopt($ch , CURLOPT_URL,$ur l);
curl_setopt($ch , CURLOPT_USERAGE NT, $user_agent);
curl_setopt($ch , CURLOPT_HEADER, 1);
curl_setopt($ch , CURLOPT_RETURNT RANSFER,1);
curl_setopt($ch , CURLOPT_SSL_VER IFYPEER, FALSE);
curl_setopt($ch , CURLOPT_TIMEOUT , 100);
$result=curl_ex ec ($ch);
curl_close ($ch);
$headerend = 0;
while (!$headerend){
$x = strpos($result, "\r\n");
if ($x == 0){
$headerend = 1;
}else{
header (substr($result , 0, $x+1));
$result = substr($result, $x+2);
}
}
print substr($result, 2);
die();
but I always have Excel opening and saying: Could not open file http://mydomain/file/php?p1=x&p2=y
Goes fine with Firefox 0.8 at least, so I assume IE is also taking the
..php ending into account.
Any ideas?
Jochen
--
Jochen Daum - Cabletalk Group Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces. http://sourceforge.net/projects/phpdbedittk/ 2 3270
Jochen Daum <jo*********@ca bletalk.co.nz> wrote in message news:<gd******* *************** **********@4ax. com>... Hi,
I'd like to pass through an Excel file from one server, (one secret password) to a user (different passwords). I thought I had duplicated the headers:
$ch = curl_init(); curl_setopt($ch , CURLOPT_URL,$ur l); curl_setopt($ch , CURLOPT_USERAGE NT, $user_agent); curl_setopt($ch , CURLOPT_HEADER, 1); curl_setopt($ch , CURLOPT_RETURNT RANSFER,1); curl_setopt($ch , CURLOPT_SSL_VER IFYPEER, FALSE); curl_setopt($ch , CURLOPT_TIMEOUT , 100);
$result=curl_ex ec ($ch); curl_close ($ch);
$headerend = 0; while (!$headerend){ $x = strpos($result, "\r\n"); if ($x == 0){ $headerend = 1; }else{ header (substr($result , 0, $x+1)); $result = substr($result, $x+2); } } print substr($result, 2); die();
Unfortunately, I couldn't understand what you mean.
Perhaps you should add bit more debug codes like:
curl_setopt($ch , CURLOPT_RETURNT RANSFER, 1);
curl_setopt($ch , CURLOPT_FOLLOWL OCATION, 1);
$fp_err = fopen('verbose_ file.txt', 'ab+');
fwrite($fp_err, date('Y-m-d H:i:s')."\n\n") ; //add timestamp to the verbose log
curl_setopt($ch , CURLOPT_VERBOSE , 1);
curl_setopt($ch , CURLOPT_FAILONE RROR, true);
curl_setopt($ch , CURLOPT_STDERR, $fp_err);
$result = curl_exec($ch);
//debug..
print_r(curl_ge tinfo($ch));
but I always have Excel opening and saying: Could not open file http://mydomain/file/php?p1=x&p2=y
Goes fine with Firefox 0.8 at least, so I assume IE is also taking the .php ending into account.
Do you mean adding user agent string?
--
| Just another PHP saint |
Email: rrjanbiah-at-Y!com
Hi,
Good to read you.
I actually have solved it myself.
On 6 May 2004 23:10:43 -0700, ng**********@re diffmail.com (R. Rajesh
Jeba Anbiah) wrote: Jochen Daum <jo*********@ca bletalk.co.nz> wrote in message news:<gd******* *************** **********@4ax. com>... Hi,
I'd like to pass through an Excel file from one server, (one secret password) to a user (different passwords). I thought I had duplicated the headers:
$ch = curl_init(); curl_setopt($ch , CURLOPT_URL,$ur l); curl_setopt($ch , CURLOPT_USERAGE NT, $user_agent); curl_setopt($ch , CURLOPT_HEADER, 1); curl_setopt($ch , CURLOPT_RETURNT RANSFER,1); curl_setopt($ch , CURLOPT_SSL_VER IFYPEER, FALSE); curl_setopt($ch , CURLOPT_TIMEOUT , 100);
$result=curl_ex ec ($ch); curl_close ($ch);
$headerend = 0; while (!$headerend){ $x = strpos($result, "\r\n"); if ($x == 0){ $headerend = 1; }else{ header (substr($result , 0, $x+1)); $result = substr($result, $x+2); } } print substr($result, 2); die(); Unfortunately, I couldn't understand what you mean.
Perhaps you should add bit more debug codes like:
curl_setopt($c h, CURLOPT_RETURNT RANSFER, 1); curl_setopt($c h, CURLOPT_FOLLOWL OCATION, 1);
$fp_err = fopen('verbose_ file.txt', 'ab+'); fwrite($fp_err , date('Y-m-d H:i:s')."\n\n") ; //add timestamp to the verbose log curl_setopt($c h, CURLOPT_VERBOSE , 1); curl_setopt($c h, CURLOPT_FAILONE RROR, true); curl_setopt($c h, CURLOPT_STDERR, $fp_err);
$result = curl_exec($ch); //debug.. print_r(curl_g etinfo($ch));
Thanks, I didn't know of all that. Actually, curl worked fine, my
problem was to replay the headers accordingly from the server I get
the file from. I wanted to just replay them, because then I assume
people will get as many problems as they have with the current server
(there are none I know of). but I always have Excel opening and saying: Could not open file http://mydomain/file/php?p1=x&p2=y
Goes fine with Firefox 0.8 at least, so I assume IE is also taking the .php ending into account.
Do you mean adding user agent string?
Ah, no. You know when you click on a URL to an Excel file, it opens in
the browser. It didn't do that, instead I got the error message. The
problem was the curl'd server used "Transfer Encoding: chunked",
whereas mine doesn't. So I had to "block" this header.
Thansk for the help,
Jochen
--
Jochen Daum - Cabletalk Group Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces. http://sourceforge.net/projects/phpdbedittk/ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: D Benfer |
last post by:
Hi all,
Im a bit thrown by curl. I want to submit some order data on an ecommerce
site via a form to a php page, where the data is saved to a database.
Then I want to use curl to submit the form data I just saved (and
redirect the user) to my secure credit card gateway.
Problem is, they have their own secure payment screen where the credit
card information is entered. I can't just retrieve the variable with a
transaction...
|
by: machodev |
last post by:
Hello Friends,
Getting a bit fuzzy on the Authorize.net and the Curl Integration.
I have the script using the for the authorize.net Integration
with the curl command
exec("/usr/local/bin -m 120 -d \"$data\" $authnet_url",
$return_string);
well the curl path is right /usr/local/bin/
|
by: Haluk Durmus |
last post by:
Hello
I checked out openssl,mm,apr,apr-util,apache 2,curl,libxml and php
from cvs.
php couse an ERROR
I did the following steps:
|
by: Conrad F |
last post by:
Hi,
If any Microsoft people are listening....
Are there any plans for the new web language called "Curl" to be
supported in .NET (ASP.NET)? I ask as Curl represents the first step
to true OO programming of web pages and not just running "scripts"
which have in-roads into service DLLs of other languages such as C#.
Surely MS will put Curl into .NET at some time since it is designed to
work with DirectX and OpenGL?
|
by: NurAzije |
last post by:
I am trying to make afunction to get information from one file and
print it or put it in an array, the problem in headers I can't figure
that it is giving me this:
********
HTTP/1.1 400 Bad Request Date: Fri, 21 Oct 2005 14:48:06 GMT Server:
Apache Connection: close Content-Type: text/html; charset=iso-8859-1
Bad Request
Your browser sent a request that this server could not understand.
Request header field is missing colon separator.
| |
by: HC |
last post by:
OK, last time I posted, I must have been totally unclear :) Hopefully
this clears things up:
I wrote the following script that uses Curl to mimic submitting a form
over SSL with <input type='file'>. It works well, but for security
reasons, I would like to not have to write the necessary data to a
temporary file. If anyone could point me in the right direction, that
would be great.
-HC :)
|
by: kath |
last post by:
hi everyone.........
I have a task, I have fragmented the task into subtask. I have planned
to create a class to each subclass and one parent class to handle the
sub tasks. Each subclass are saved in seperate file and all my
subclasses and parent class are placed in the same folder.
The parent class is subclass of wx.Frame, and subclasses are subclass
of wx.Panel. Each subclass will create a GUI for each task..
|
by: JDS |
last post by:
So, I'd like to create the following scenario:
1) Use cURL library within PHP (cURL + "Cookie Jar", et.al) to create a
virtual browser session that "logs in" to a remote site. (For example:
here:
http://curl.haxx.se/libcurl/php/examples/cookiejar.html
and here:
http://curl.haxx.se/libcurl/php/examples/ebay_login.html
|
by: Flexor |
last post by:
I have a php script that runs from command line and makes an https
request to paypal, using curl. It works fine if I run it from a web
page. It fails if I run it from CLI. The error I get from the CLI:
* About to connect() to api-3t.sandbox.paypal.com port 443
* Trying 216.113.191.88... * connected
* Connected to api-3t.sandbox.paypal.com (216.113.191.88) port 443
* successfully set certificate verify locations:
* CAfile:...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| | |