php-windows Digest 12 Aug 2004 17:47:30 -0000 Issue 2357
Topics (messages 24388 through 24392):
Re: a NS7 problem
24388 by: Justin Patrin
phpBB, PHP5, MySQL 4, and IIS 6
24389 by: JNJ
PHP and SQL 2000
24390 by: PHP MySQL
24391 by: Nathan
24392 by: Frank M. Kromann
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
On Wed, 11 Aug 2004 22:08:09 -0300, oleks <[EMAIL PROTECTED]> wrote:
> Hi All
>
> How to fix a NS7 problem where it wants to add a .PHP extension to all
> filenames
>
> I try to use this funnction:
>
> function download ($fileDir, $fileName) {
> $completeFilePath=$fileDir.'/'.$fileName;
> header('Pragma: no-cache');
> header("Content-type: archive/exe\n
> Content-Disposition: attachment;
> filename=\"" . $fileName . "\"\n
> Content-length: ".(string)(filesize($completeFilePath))
> );
> $fd=fopen($completeFilePath,'rb');
> while(!feof($fd)) {
> print(fread($fd, 4096));
> flush();
> }
> }
>
1) don't use newlines in your headers. Send each header with its own
header() call
2) browsers are fickle when it comes to downloading files. Search
Google and the lists for more ideas
Here's what I ended up with after lots of heartache:
header('Pragma: private');
header('Content-Type: '.$resource['mimeType']);
header('Content-Disposition: inline; filename="'.$resource['fileName'].'"');
//header('Content-Length: '.strlen($resource['data']));
header('Content-Transfer-Encoding: binary');
echo $resource['data'];
I never got the content-length to work right, myself.
> MSIE6 works perfect but NS7 adds .php extension when I try to force NS7
> to download a file. How to fix this problem
>
> Thanks for help ...
> Oleks
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> !DSPAM:411ac0d2228921094323535!
>
>
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--
--- End Message ---
--- Begin Message ---
Guys -- I'm getting a headache trying to install phpBB. I have IIS 6
(Win2K3), PHP 5, MySQL 4. Every install has the same result -- "The PHP
configuration on your server doesn't support the database type that you
chose"
I've d/led the PHP 5 patched version -- same results.
I've enabled the php_mysqli extension in PHP.INI and DISabled the php_mysql
extension -- same result.
I've played with permissions to no avail and so on. Always the same result.
I've even moved DLLs to the system32 folder, updated permissions on the
various folders as recommended, and so on.
Anyone have any suggestions?
--- End Message ---
--- Begin Message ---
hi there,
i have been trying to connect to a sql 2000 server database. I am able to connect
using the DSN-connection: i.e., the following code works:
<?php
$dsn = "btc";
$user = "";
$password = "";
$sqlconnect = odbc_connect ($dsn, $user, $password);
$sqlquery = "SELECT FullDescrp FROM BTCCode3;";
$process = odbc_exec ($sqlconnect, $sqlquery);
echo $sqlquery;
echo "<br><br>";
while (odbc_fetch_row ($process))
{
$Description = odbc_result($process, "FullDescrp");
echo "$Description <br>";
}
odbc_close ($sqlconnect);
?>
But when i try to connect to the database using the mssql_xxxx functions like:
<?php
$dsn = "btc";
$user = "";
$password = "";
$myDB = "BACSDB_test";
$sqlconnect = mssql_connect ("$localhost", $user, $password);
$sqldb = mssql_select_db($myDB, $sqlconnect) or die("Couldn't open database $myDB");
$sqlquery = "SELECT FullDescrp FROM BTCCode3;";
$result = mssql_query ($sqlquery);
echo $sqlquery;
echo "<br><br>";
while ($row = mssql_fetch_array ($result))
{
echo $row['FullDescrp']."<br>\n";
}
mssql_close ($sqlconnect);
?>
It is not getting conencted. The following error is given:
"Warning: mssql_connect(): message: Login failed for user '(null)'. Reason: Not
associated with a trusted SQL Server connection. (severity 14) in c:\program
files\apache group\apache\htdocs\btc_test.php on line 8
Warning: mssql_connect(): Unable to connect to server: in c:\program files\apache
group\apache\htdocs\btc_test.php on line 8
Warning: mssql_select_db(): supplied argument is not a valid MS SQL-Link resource in
c:\program files\apache group\apache\htdocs\btc_test.php on line 9
Couldn't open database BACSDB_test"
Please help....
Any help received will be highly appreciated.
thanks
penjo
Yahoo! India Matrimony: Find your life partneronline.
--- End Message ---
--- Begin Message ---
Php mysql schreef:
But when i try to connect to the database using the mssql_xxxx functions like:
<?php
$dsn = "btc";
$user = "";
$user = "";
$password = "";
$myDB = "BACSDB_test";
$sqlconnect = mssql_connect ("$localhost", $user, $password);
$sqldb = mssql_select_db($myDB, $sqlconnect) or die("Couldn't open database $myDB");
$sqlquery = "SELECT FullDescrp FROM BTCCode3;";
$result = mssql_query ($sqlquery);
echo $sqlquery;
echo "<br><br>";
while ($row = mssql_fetch_array ($result))
{
echo $row['FullDescrp']."<br>\n";
}
mssql_close ($sqlconnect);
?>
It is not getting conencted. The following error is given:
"Warning: mssql_connect(): message: Login failed for user '(null)'. Reason: Not
associated with a trusted SQL Server connection. (severity 14) in c:\program files\apache
group\apache\htdocs\btc_test.php on line 8
Login failed for user '(null)'
Warning: mssql_connect(): Unable to connect to server: in c:\program files\apache
group\apache\htdocs\btc_test.php on line 8
Warning: mssql_select_db(): supplied argument is not a valid MS SQL-Link resource in
c:\program files\apache group\apache\htdocs\btc_test.php on line 9
Couldn't open database BACSDB_test"
--- End Message ---
--- Begin Message ---
Hello,
The default way to connect is to use SQL Server user names and passwords,
but the mssql extension can be configured to use secure/trusted
connections. This is don by setting mssql.secure_connection = On in
php.ini.
With a secure connection the client maschine will use the userid/password
for the user who runs the php script (in this case that would be the user
configured under the web server)
- Frank
> hi there,
>
> i have been trying to connect to a sql 2000 server database. I am able
to connect using the DSN-connection: i.e., the following code works:
> <?php
> $dsn = "btc";
> $user = "";
> $password = "";
> $sqlconnect = odbc_connect ($dsn, $user, $password);
> $sqlquery = "SELECT FullDescrp FROM BTCCode3;";
> $process = odbc_exec ($sqlconnect, $sqlquery);
> echo $sqlquery;
> echo "<br><br>";
> while (odbc_fetch_row ($process))
> {
> $Description = odbc_result($process, "FullDescrp");
> echo "$Description <br>";
> }
> odbc_close ($sqlconnect);
> ?>
>
> But when i try to connect to the database using the mssql_xxxx functions
like:
> <?php
> $dsn = "btc";
> $user = "";
> $password = "";
> $myDB = "BACSDB_test";
> $sqlconnect = mssql_connect ("$localhost", $user, $password);
> $sqldb = mssql_select_db($myDB, $sqlconnect) or die("Couldn't open
database $myDB");
> $sqlquery = "SELECT FullDescrp FROM BTCCode3;";
> $result = mssql_query ($sqlquery);
> echo $sqlquery;
> echo "<br><br>";
> while ($row = mssql_fetch_array ($result))
> {
> echo $row['FullDescrp']."<br>\n";
> }
> mssql_close ($sqlconnect);
> ?>
>
> It is not getting conencted. The following error is given:
> "Warning: mssql_connect(): message: Login failed for user '(null)'.
Reason: Not associated with a trusted SQL Server connection. (severity 14)
in c:\program files\apache group\apache\htdocs\btc_test.php on line 8
>
> Warning: mssql_connect(): Unable to connect to server: in c:\program
files\apache group\apache\htdocs\btc_test.php on line 8
>
> Warning: mssql_select_db(): supplied argument is not a valid MS SQL-Link
resource in c:\program files\apache group\apache\htdocs\btc_test.php on
line 9
> Couldn't open database BACSDB_test"
>
> Please help....
> Any help received will be highly appreciated.
>
> thanks
> penjo
>
> Yahoo! India Matrimony: Find your life partneronline.
--- End Message ---