php-windows Digest 27 Jun 2003 16:28:15 -0000 Issue 1798
Topics (messages 20587 through 20603):
Re: is_dir: runs bad under IIS/Win2K
20587 by: Nadim Attari
20588 by: Nadim Attari
20589 by: Nadim Attari
20597 by: morris71.libero.it
PHP application URL
20590 by: Thai Thanh Ha
20592 by: Cristian MARIN
20593 by: Raul IONESCU <LYNX Fil Impex
20594 by: Thai Thanh Ha
May I request for some function?
20591 by: cmkpl
Re: FastCGI & PHP 4.3.1 & MSSQL & IIS5 problem :(
20595 by: Xavier Serna
20600 by: Frank M. Kromann
variables problem
20596 by: Felipe Lorente
20598 by: morris71.libero.it
20599 by: Felipe Lorente
or die problem
20601 by: Croskerry, Dan
20602 by: Cristian MARIN
20603 by: Croskerry, Dan
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 ---
<< is_dir(session_save_path()) >>
if (filetype(session_save_path()) == 'dir')
{
echo "It is a directory... SMILE PLZ";
}
Nadim Attari
http://www.alienworkers.com
--- End Message ---
--- Begin Message ---
> << is_dir(session_save_path()) >>
if (filetype(session_save_path()) == 'dir')
{
echo "It is a directory... SMILE PLZ";
}
Nadim Attari
http://www.alienworkers.com
--- End Message ---
--- Begin Message ---
<< is_dir(session_save_path()) >>
if (filetype(session_save_path()) == 'dir')
{
echo "It is a directory... SMILE PLZ";
}
Nadim Attari
http://www.alienworkers.com
--- End Message ---
--- Begin Message ---
Just a few notes about my problem!
It seems that PHP 4 on Windows 2000 with IIS 5.0 all directories of level 1
(starting from the "root") aren't visible as "directories".
In fact, I have tested some directory-paths with "is_dir" function, with
different paths and PHP is able to recognize only / (root) and paths at more
deep levels. For example:
/TMP/PHP_SESSIONS is_dir? 1
/TMP is_dir?
\TMP\PHP_SESSIONS is_dir? 1
c:/TMP/PHP_SESSIONS is_dir? 1
c:/TMP is_dir? [NOT RECOGNIZED]
c:\TMP\PHP_SESSIONS is_dir? 1
c:/ is_dir? 1
c:/inetpub/ftproot is_dir? 1
c:/inetpub is_dir? [NOT RECOGNIZED]
As you can see, all directories are recognized (1) but not those at 1st
level (like /TMP or C:/INETPUB). I don't know if this strange behaviour
regards the specific PHP version used on Win2k or if it's a bug (on
IIS/WinXP all runs well).
My problem (checking if SESSION_SAVE_PATH directory exists) is now resolved:
simply, I use /TMP/PHP_SESSIONS as path and not only /TMP (as on every other
standard PHP installation).
Hope this note can help!
Bye
Francesco
--- End Message ---
--- Begin Message ---
Hi all,
I want to get the URL of my application (and don't want to define it in a
config file - I don't like telling my customers to config the app, even run
some install.php file). Anyone has code for this? I know that in generally I
cannot use a PHP function for this because we don't have true "PHP web
applications" (like Java-based web applications) ( and most of the PHP
applications define constants, like APP_BASE_URL,...). But I guess if I put
a special file (like "APP_ROOT") in my base application directory, I can
find out the application URL from the URL of the requested file and file
path of the requested file (The code for determining URL can be put in
another PHP file and be included). Anyone have code like this? Please help
me. Thanks in advance.
Thai
--- End Message ---
--- Begin Message ---
To know the full URL of a called page you can use this:
$url='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] ;
After this with preg_replace you can do what ever you want to with the URL.
--
-------------------------------------------------
Cristian MARIN - Developer
InterAKT Online (www.interakt.ro)
Tel: +4021 312.53.12
Tel/Fax: +4021 312.51.91
[EMAIL PROTECTED]
"Thai Thanh Ha" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Hi all,
>
> I want to get the URL of my application (and don't want to define it in a
> config file - I don't like telling my customers to config the app, even
run
> some install.php file). Anyone has code for this? I know that in generally
I
> cannot use a PHP function for this because we don't have true "PHP web
> applications" (like Java-based web applications) ( and most of the PHP
> applications define constants, like APP_BASE_URL,...). But I guess if I
put
> a special file (like "APP_ROOT") in my base application directory, I can
> find out the application URL from the URL of the requested file and file
> path of the requested file (The code for determining URL can be put in
> another PHP file and be included). Anyone have code like this? Please help
> me. Thanks in advance.
>
> Thai
--- End Message ---
--- Begin Message ---
in fact better solution would be
$url = 'http://'.$_SERVER['HTTP_HOST'];
$url .=
isset($_SERVER['REQUEST_URI'])?$_SERVER['REQUEST_URI']:(empty($_SERVER['QUERY_STRING'])?$_SERVER['PATH_INFO']:($_SERVER['PATH_INFO'].'?'.$_SERVER['QUERY_STRING']));
don't think so?
-----------------------------------------------------------------
Raul IONESCU - IT Technician & WebMaster
LYNX Fil Impex (www.lynx.ro)
Art Business Romania (www.artbusinessromania.com)
e-mail: [EMAIL PROTECTED], [EMAIL PROTECTED]
Tel/Fax: +4021 3103002, +4021 3159230, +4021 3145190, +4021 3143875
"Cristian Marin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> To know the full URL of a called page you can use this:
>
> $url='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] ;
>
> After this with preg_replace you can do what ever you want to with the URL.
>
> --
> -------------------------------------------------
> Cristian MARIN - Developer
> InterAKT Online (www.interakt.ro)
> Tel: +4021 312.53.12
> Tel/Fax: +4021 312.51.91
> [EMAIL PROTECTED]
> "Thai Thanh Ha" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> >
> > Hi all,
> >
> > I want to get the URL of my application (and don't want to define it in a
> > config file - I don't like telling my customers to config the app, even
> run
> > some install.php file). Anyone has code for this? I know that in generally
> I
> > cannot use a PHP function for this because we don't have true "PHP web
> > applications" (like Java-based web applications) ( and most of the PHP
> > applications define constants, like APP_BASE_URL,...). But I guess if I
> put
> > a special file (like "APP_ROOT") in my base application directory, I can
> > find out the application URL from the URL of the requested file and file
> > path of the requested file (The code for determining URL can be put in
> > another PHP file and be included). Anyone have code like this? Please help
> > me. Thanks in advance.
> >
> > Thai
>
>
--- End Message ---
--- Begin Message ---
Cristian,
The problem here is the code (in a PHP page, e.g. utils.php) will be called
from other PHP pages in my application. And I want to always get the same
URL, for example (http://myhost/myapp/). How to use the preg_replace
function to get my *base* URL?
-----Original Message-----
From: Cristian MARIN [mailto:[EMAIL PROTECTED]
Sent: Saturday, June 28, 2003 12:11 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Re: PHP application URL
To know the full URL of a called page you can use this:
$url='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] ;
After this with preg_replace you can do what ever you want to with the URL.
--
-------------------------------------------------
Cristian MARIN - Developer
InterAKT Online (www.interakt.ro)
Tel: +4021 312.53.12
Tel/Fax: +4021 312.51.91
[EMAIL PROTECTED]
"Thai Thanh Ha" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Hi all,
>
> I want to get the URL of my application (and don't want to define it in a
> config file - I don't like telling my customers to config the app, even
run
> some install.php file). Anyone has code for this? I know that in generally
I
> cannot use a PHP function for this because we don't have true "PHP web
> applications" (like Java-based web applications) ( and most of the PHP
> applications define constants, like APP_BASE_URL,...). But I guess if I
put
> a special file (like "APP_ROOT") in my base application directory, I can
> find out the application URL from the URL of the requested file and file
> path of the requested file (The code for determining URL can be put in
> another PHP file and be included). Anyone have code like this? Please help
> me. Thanks in advance.
>
> Thai
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Dear php group,
I am a developer of Visual Basic.I am writing a simple web server.I want
to add php support.But by the "shell" function of Visual Basic,it is too
slow to execute through php.exe or \cli\php.exe,and it causes some security
problems too!
So,is there any better methods?
I think the developing group can write a somple .dll file.There is only
a function that I can pass the varible to the .dll.And after the execution
of php.The results send back to the Visual Basic program by the same
varible. I think it is not so diifficult to write. I think it can help a lot
of developers who do not know C++ very much.
Please reply.
Thanks for your attention.
Yours faithfully,
Harold Chan
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.491 / Virus Database: 290 - Release Date: 18/6/2003
--- End Message ---
--- Begin Message ---
Thanks for your answer Melih.
I think both charsets are correct, I simply deactivated the automatic ANSI
to OEM conversion in the Client Network DB Library of mssql and all works
fine now... please, how can I check the character sets in both PHP & MSSQL?
I think in MSSQL have set de code page 1252, and in PHP.INI i've set the
charset to ISO-8859-1.
Thanks,
Xavier Serna.
"Melih Onvural" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Are you sure that your character set is correct in both PHP and the MSSQL?
There was a big discussion about correctly setting the right code-type on
another PHP list that I'm on, and the ultimate outcome was that some
characters refuse to communicate between programs simply because their
encodings are different. Just a thought,
>
> melih
> >
> > From: "Xavier Serna" <[EMAIL PROTECTED]>
> > Date: 2003/06/26 Thu AM 10:58:42 EDT
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-WIN] FastCGI & PHP 4.3.1 & MSSQL & IIS5 problem :(
> >
> >
>
--- End Message ---
--- Begin Message ---
The MSSQL dblib (used in the mssql extension) detects the codepage of the
environment it is running under.
Caling a php script with php.exe can be done in at least 3 ways:
1) From IIS as CGI- this sets the codepage to 125x (ANSI)
2) From a command line - this sets the code page to 437 or whatever is the
default on yoyr system
3) From IIS as FastCGI - this sets the code page to 437 or whatever is the
default on yoyr system
I think it wold be possible to change the FastCGI manager to launch
php.exe the same way IIS does and have it working with ANSI codepage. I'm
going to have a look at this.
Disabling the automaitc ANSI to OEM does fix this problem. Codepage 1252
and ISO-8859-1 is the same thing.
- Frank
> Thanks for your answer Melih.
> I think both charsets are correct, I simply deactivated the automatic
ANSI
> to OEM conversion in the Client Network DB Library of mssql and all
works
> fine now... please, how can I check the character sets in both PHP &
MSSQL?
> I think in MSSQL have set de code page 1252, and in PHP.INI i've set
the
> charset to ISO-8859-1.
>
> Thanks,
> Xavier Serna.
>
> "Melih Onvural" <[EMAIL PROTECTED]> wrote in message
>
news:[EMAIL PROTECTED]
> > Are you sure that your character set is correct in both PHP and the
MSSQL?
> There was a big discussion about correctly setting the right code-type
on
> another PHP list that I'm on, and the ultimate outcome was that some
> characters refuse to communicate between programs simply because their
> encodings are different. Just a thought,
> >
> > melih
> > >
> > > From: "Xavier Serna" <[EMAIL PROTECTED]>
> > > Date: 2003/06/26 Thu AM 10:58:42 EDT
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP-WIN] FastCGI & PHP 4.3.1 & MSSQL & IIS5 problem :(
> > >
> > >
> >
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Hello all,
I have a php page which calls another with header function. This is the
sintax:
header("Location: validation.php?name=$name&mail=$mail&message=$message);
The problem is that in the next php page, it only gets the first word of
the first variable, and it shows an error of no identified variables mail
and message. Does anyone know why?
Thanks,
Felipe.
--- End Message ---
--- Begin Message ---
Hi Felipe.
First of all... the lacking double-quotes at the end ot the string! So, the
right way is:
header("Location: validation.php?name=$name&mail=$mail&message=$message");
This line works well if...
Regarding your "question", the problem is in a uncorrect usage of the
variables while composing the Location string. Follow me:
1. consider you have a name composed of 2 or more "words". For instance:
$name="Felipe Lorente"; (but the same for $mail and $message).
When expading/substituting $name in the "header" function you have exactly
this:
header("Location: validation.php?name=Felipe Lorente&mail.....
As you can see the string has a "blank" space inside, so PHP thinks the
string ends to "Felipe", avoiding the rest!!!
2. it's a normal behaviour for PHP :-)
3.the correct syntax when working with URLs is to transform "normal values"
in "url-encoded values". That is to translate in a understandable way the
strings passed as URLs to a browser (in fact, when you call a Location, it's
the same as you type that URL directly in the browser). So before calling
Header("Location... make the following:
$name=urlencode($name);
$message=urlencode($message);
...
This function will transform all "strange" character in the string in
special values (i.e., "Felice Lorente" becomes "Felipe+Morente". As you can
see not more 2 differents words but just ONE!!!
4. While retrieving urlencoded values from validation.php, you must
(obviously :-) url-decode these values. So in validation.php before using
URL-passed params you have to:
$name=urldecode($name)
$message=urldecode($message)
...
I hope these notes can help you.
Bye
--
Francesco
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
<[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> Hi Felipe.
> First of all... the lacking double-quotes at the end ot the string! So,
the
> right way is:
> header("Location: validation.php?name=$name&mail=$mail&message=$message");
> This line works well if...
>
> Regarding your "question", the problem is in a uncorrect usage of the
> variables while composing the Location string. Follow me:
>
> 1. consider you have a name composed of 2 or more "words". For instance:
> $name="Felipe Lorente"; (but the same for $mail and $message).
> When expading/substituting $name in the "header" function you have exactly
> this:
> header("Location: validation.php?name=Felipe Lorente&mail.....
> As you can see the string has a "blank" space inside, so PHP thinks the
> string ends to "Felipe", avoiding the rest!!!
>
> 2. it's a normal behaviour for PHP :-)
>
> 3.the correct syntax when working with URLs is to transform "normal
values"
> in "url-encoded values". That is to translate in a understandable way the
> strings passed as URLs to a browser (in fact, when you call a Location,
it's
> the same as you type that URL directly in the browser). So before calling
> Header("Location... make the following:
> $name=urlencode($name);
> $message=urlencode($message);
> ...
> This function will transform all "strange" character in the string in
> special values (i.e., "Felice Lorente" becomes "Felipe+Morente". As you
can
> see not more 2 differents words but just ONE!!!
>
> 4. While retrieving urlencoded values from validation.php, you must
> (obviously :-) url-decode these values. So in validation.php before using
> URL-passed params you have to:
> $name=urldecode($name)
> $message=urldecode($message)
> ...
>
> I hope these notes can help you.
>
>
> Bye
> --
> Francesco
> [EMAIL PROTECTED]
>
>
Ok, thanks, now it is working perfectly. I didnt know the urlencode
function.
Regards,
Felipe.
--- End Message ---
--- Begin Message ---
I'm new to the windows platform for php development and I have been having
problems with the or die function when running sql queries. It is being
called even when I run a valid query. I have tested it with valid queries
and it is always triggered. I have had to stop using it which is not good. I
never had problems with or die when I was working in a linux environment.
Does anyone know if there is a setting in the php.ini file that I have to
set for or die to work? My DB is MS SQL 2000.
Thanks in advance,
Dan
--- End Message ---
--- Begin Message ---
Maybe not the query is the problem, maybe the connection or the
authentication ...
Try executing the sql without the die part and then print out the
mysql_error() if the mysql_errno()!=0
mysql_query($your_query_here);
if (mysql_errno()!=0){
die (mysql_error());
}
--
-------------------------------------------------
Cristian MARIN - Developer
InterAKT Online (www.interakt.ro)
Tel: +4021 312.53.12
Tel/Fax: +4021 312.51.91
[EMAIL PROTECTED]
"Dan Croskerry" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm new to the windows platform for php development and I have been having
> problems with the or die function when running sql queries. It is being
> called even when I run a valid query. I have tested it with valid queries
> and it is always triggered. I have had to stop using it which is not good.
I
> never had problems with or die when I was working in a linux environment.
>
> Does anyone know if there is a setting in the php.ini file that I have to
> set for or die to work? My DB is MS SQL 2000.
>
> Thanks in advance,
> Dan
>
--- End Message ---
--- Begin Message ---
There is no error message. It happens mostly when I am doing an update or
insert statement. There is no problem with the sql because the data gets
written to the db. If I use or die it still writes to the db but the or die
kills the processing. It's strange.
-----Original Message-----
From: Cristian MARIN [mailto:[EMAIL PROTECTED]
Sent: Friday, June 27, 2003 10:18 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Re: or die problem
Maybe not the query is the problem, maybe the connection or the
authentication ... Try executing the sql without the die part and then print
out the
mysql_error() if the mysql_errno()!=0
mysql_query($your_query_here);
if (mysql_errno()!=0){
die (mysql_error());
}
--
-------------------------------------------------
Cristian MARIN - Developer
InterAKT Online (www.interakt.ro)
Tel: +4021 312.53.12
Tel/Fax: +4021 312.51.91
[EMAIL PROTECTED]
"Dan Croskerry" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm new to the windows platform for php development and I have been
> having problems with the or die function when running sql queries. It
> is being called even when I run a valid query. I have tested it with
> valid queries and it is always triggered. I have had to stop using it
> which is not good.
I
> never had problems with or die when I was working in a linux
> environment.
>
> Does anyone know if there is a setting in the php.ini file that I have
> to set for or die to work? My DB is MS SQL 2000.
>
> Thanks in advance,
> Dan
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---