php-windows Digest 17 Jul 2003 02:01:13 -0000 Issue 1826
Topics (messages 20805 through 20811):
Re: Newbie Q
20805 by: H Marc Bower
20806 by: Gabriel_k
20807 by: H Marc Bower
20808 by: Dick Kurtz
Re: What if there is no file?
20809 by: Neil Smith
connect to Mysql Server
20810 by: Michael G. Tracey
20811 by: Paul Menard
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 ---
Um... the file in which you put that command should be there... :)
What is the purpose for knowing the directory name? Maybe there is
something else you can tell us that will get you the answer you're looking
for.
(V)
----- Original Message -----
From: "Gabriel_k" <[EMAIL PROTECTED]>
> What if there is no file?
> "Heyz" <[EMAIL PROTECTED]> skrev i meddelandet
> > It's simple.
> >
> > dirname(__FILE__)
--- End Message ---
--- Begin Message ---
Well, I want my php script to put the TITLE of a html page to the name of
the directory the script is in.
/Gabbah
"H Marc Bower" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Um... the file in which you put that command should be there... :)
>
> What is the purpose for knowing the directory name? Maybe there is
> something else you can tell us that will get you the answer you're looking
> for.
>
> (V)
>
> ----- Original Message -----
> From: "Gabriel_k" <[EMAIL PROTECTED]>
> > What if there is no file?
> > "Heyz" <[EMAIL PROTECTED]> skrev i meddelandet
> > > It's simple.
> > >
> > > dirname(__FILE__)
>
>
>
--- End Message ---
--- Begin Message ---
Well, if you want the path as far as the website is concerned, use
dirname($PHP_SELF). If you want the absolute file system path, use
getcwd().
Example:
Files located on server at
D:\wwwroot\files\uploads\here
By website address at:
http://yourserver.com/files/uploads/here
File being accessed:
http://yourserver.com/files/uploads/here/file.php
<?php
$title = dirname($PHP_SELF);
?>
This will set $title to
/files/uploads/here
<?php
$title = getcwd();
?>
This will set $title to
D:\wwwroot\files\uploads\here
Depends on what value you actually want to use.
(V)
----- Original Message -----
From: "Gabriel_k" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 16, 2003 8:18 AM
Subject: Re: [PHP-WIN] Re: Newbie Q
> Well, I want my php script to put the TITLE of a html page to the name of
> the directory the script is in.
>
> /Gabbah
>
> "H Marc Bower" <[EMAIL PROTECTED]> skrev i meddelandet
> news:[EMAIL PROTECTED]
> > Um... the file in which you put that command should be there... :)
> >
> > What is the purpose for knowing the directory name? Maybe there is
> > something else you can tell us that will get you the answer you're
looking
> > for.
> >
> > (V)
> >
> > ----- Original Message -----
> > From: "Gabriel_k" <[EMAIL PROTECTED]>
> > > What if there is no file?
> > > "Heyz" <[EMAIL PROTECTED]> skrev i meddelandet
> > > > It's simple.
> > > >
> > > > dirname(__FILE__)
> >
> >
> >
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
According to the PHP Manual:
11. Where can I find a complete list of pre-set variables available to
me, and why are these not documented in the PHP documentation?
The best way is to stick a <?php phpinfo(); ?> part on a page and load
it up. This will show you all sorts of information about your PHP setup,
including a list of both environment variables and also special
variables set by your web server. This list can't really be documented
in the PHP documentation because it will change from one server to another.
Dick Kurtz
--- End Message ---
--- Begin Message ---
At 11:14 16/07/2003 +0000, you wrote:
Message-ID: <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
From: "Gabriel_k" <[EMAIL PROTECTED]>
Date: Wed, 16 Jul 2003 13:14:57 +0200
Subject: Re: Newbie Q
MIME-Version: 1.0
What if there is no file?
Then how do you propose your PHP script is stored - by osmosis ?
Of *course* theres a file. Think before you post. LOL.
>"Heyz" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> It's simple.
>
> dirname(__FILE__)
>
>
> "Gabriel_k" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > How can I find out (as a string) in what dir my php script is run?
> >
> > /Gabbah
> >
> >
>
>
--- End Message ---
--- Begin Message ---
Code below comes straight out of the manual. I can connect using mysql client on other
pc, and using SQLyog. but Php will not connect. I can run php scripts with no problem
otherwise.
Setup is: Win2k - sp3; php 4.3.2 ; Mysql 4.1; Apache 2.
This is the error I get:
;
Warning: mysql_connect(): Client does not support authentication protocol requested by
server. Consider upgrading MySQL client in C:\sokkit\site\mysql-conn.php on line 12
Could not connect
****************************
;<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Title here!</title>
</head>
<body>
<?php
/* Connecting, selecting database */
$link = mysql_connect("localhost", "michael", "access")
or die("Could not connect");
print "Connected successfully";
mysql_select_db("my_database") or die("Could not select database");
/* Performing SQL query */
$query = "SELECT * FROM my_table";
$result = mysql_query($query) or die("Query failed");
/* Printing results in HTML */
print "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
print "\t<tr>\n";
foreach ($line as $col_value) {
print "\t\t<td>$col_value</td>\n";
}
print "\t</tr>\n";
}
print "</table>\n";
/* Free resultset */
mysql_free_result($result);
/* Closing connection */
mysql_close($link);
?>
</body>
</html>
Michael G. Tracey
_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!
--- End Message ---
--- Begin Message ---
I was just reading about this on the MySQL web site.
It seems they have change the authentication protocol
starting with version 4.1
There is a note that clients like PHP, Perl etc will
need to be recompiled to support the NEW protocol. For
now I'm sticking with MySQL 4.0.1
Paul
--- "Michael G. Tracey" <[EMAIL PROTECTED]> wrote:
>
> Code below comes straight out of the manual. I can
> connect using mysql client on other pc, and using
> SQLyog. but Php will not connect. I can run php
> scripts with no problem otherwise.
>
> Setup is: Win2k - sp3; php 4.3.2 ; Mysql 4.1; Apache
> 2.
>
> This is the error I get:
>
>
> ;
> Warning: mysql_connect(): Client does not support
> authentication protocol requested by server.
> Consider upgrading MySQL client in
> C:\sokkit\site\mysql-conn.php on line 12
> Could not connect
>
> ****************************
>
>
> ;<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
> <html>
> <head>
> <title>Title here!</title>
> </head>
> <body>
>
>
>
> <?php
> /* Connecting, selecting database */
> $link = mysql_connect("localhost", "michael",
> "access")
> or die("Could not connect");
> print "Connected successfully";
> mysql_select_db("my_database") or die("Could not
> select database");
>
> /* Performing SQL query */
> $query = "SELECT * FROM my_table";
> $result = mysql_query($query) or die("Query
> failed");
>
> /* Printing results in HTML */
> print "<table>\n";
> while ($line = mysql_fetch_array($result,
> MYSQL_ASSOC)) {
> print "\t<tr>\n";
> foreach ($line as $col_value) {
> print "\t\t<td>$col_value</td>\n";
> }
> print "\t</tr>\n";
> }
> print "</table>\n";
>
> /* Free resultset */
> mysql_free_result($result);
>
> /* Closing connection */
> mysql_close($link);
> ?>
>
>
>
>
>
> </body>
> </html>
>
>
> Michael G. Tracey
>
> _______________________________________________
> Join Excite! - http://www.excite.com
> The most personalized portal on the Web!
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
--- End Message ---