Re: Content-Type Headers getting stomped?
| From: | Jason Cox | Date: | Tue, 15 Aug 2000 00:24:29 +0000 |
| Subject: | Re: Content-Type Headers getting stomped? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-11704@lists.php.net to get a copy of this message | ||
I'm running PL2 as well and I think my problem might be related. I'm handling
file uploads and when I post to a page that also retrieves values from cookies,
the value from the cookie never gets passed. The following example gives a
"Document contains no data" error in Netscape.
<?
if ((isset($file)) && ($file != "none"))
{
system("cp $file /tmp/$file_name");
}
// Check for valid timestamp
if (!isset($ts))
{
header("Location: http://controlpanel.webpipe.net/index.php?sid=$sid");
}
// Decrypt Password
$pass = mcrypt_cbc(MCRYPT_TripleDES, $ts, $password, MCRYPT_DECRYPT);
$pass = chop($pass);
<snip>
Jason
On Mon, 14 Aug 2000, you wrote:
> Rasmus and others,
> I've got the following code which always returns "text/html" for the
> content type. (I've been using Collin's get_http_headers routine (modified
> to GET versus HEAD) to verify things.)
>
> Basically, any php script (under 4.0.1pl2 and the current 4.0.2-dev
> snapshot (lastnights) ) will return "text/html" for the content type no
> matter what header I return. I know that headers are working as I use php
> for authentication and it works fine.
>
> Thoughts?
>
> Mike...
>
> <?
> if ( $oid < 1 ) { die("oops...no oid"); }
> $lnk = mysql_pconnect("yourhost","youruid","yourpass") or
> die("no connection");
> mysql_select_db("nd",$lnk);
> $root = "/mydata/usr70/";
> $sqlstring = "select news.ftype,fgrp,fdate,fname,ctype from
> news,contenttype where oid=$oid and contenttype.ftype = news.ftype";
> $qry = mysql_query($sqlstring,$lnk) or die("bad qry: ".mysql_error());
> $ref = mysql_fetch_object($qry);
> Header("Pragma: cache");
> Header("Content-type: " . $qry->ctype);
> $outgfx = $root . $ref->fgrp . "/" . $ref->fdate . "/" .
> $ref->fname;
> readfile($outgfx);
> ?>