php-windows Digest 12 Apr 2002 18:07:35 -0000 Issue 1090
Topics (messages 13048 through 13061):
Re: Security using Apache & Windows
13048 by: Svensson, B.A.T. (HKG)
Re: Configuring securely in IIS5 under Windows 2000 Server
13049 by: Svensson, B.A.T. (HKG)
Re: Newbie to php
13050 by: Chris Hogben
Different folder/ local test
13051 by: Tiago Simões
13054 by: Fabian Deutsch
String reduce
13052 by: Kriegers Horst
13053 by: Hugh Bothwell
13058 by: Nicola Delbono
13059 by: Matt Babineau
13060 by: Nicola Delbono
Instructions on how to resolve a DNS
13055 by: R.S. Herhuth
13056 by: Bob Curtis
PHP and ZIP
13057 by: Nicole Amashta
Tutorials on stored procedures using SQL Server
13061 by: R.S. Herhuth
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 ---
This is after all and PHP list, so if you explain the relation to
PHP then people might help you
Otherwise you might try ask in an apache or MS Windows support group....
> -----Original Message-----
> From: Tim Mackenzie
> Sent: Tuesday, April 02, 2002 5:47 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Re: Security using Apache & Windows
>
>
> No one can help?! Please, please, please...
>
> "Tim Mackenzie" <[EMAIL PROTECTED]> wrote in message
> > I'm running W2K with Apache and PHP4. I'm going to be hosting a number of
> > websites that I would like to provide PHP support for. What I don't want is
> > them to be able to access my entire file system. They should, at most, be
> > only allowed read/write access to their site folder. How do I go about
> > doing this? I've looked around, but I haven't found something that
> > addresses this. I know there's the basedir value (I think that's it), but I
> > don't understand how to use it. Could somebody (several people) please post
> > any tips they have for securing the file system of a web server. Thanks!
--- End Message ---
--- Begin Message ---
> Bruce,
>
> Thanks for all of you input, it is much appreciated it.
>
> I do know about securing IIS, but I was concerned about security when
> adding PHP into the mix.
>
> From the answers I received, I am assuming that the security is in the
> OS/Server software, and that there aren't any inherent security measure
> to be taken with PHP? In short, if the OS/web server is fairly secure,
> PHP does not break that, correct? That is my main concern.
As Bruce mentioned in another letter: security could potential be broken
by bad scripting on the server - you need to set up a policy about
what and what's not should be allowed. For example, submitting files
to the server, might induce a security problem, since people with less
moral might upload a "home made" script as a file, and then execute
that script on your server to explore further security issues.
--- End Message ---
--- Begin Message ---
Sorry if i'm posting twice, but i used my nospam address, and i know this
server is pickky on addresses :P
Hi there,
You could always try using mysql_error() to get a better error description.
Try this:
<?php
$db = mysql_connect("nik", "", "");
if (!$db) {
echo "Cannot connect";
exit;
}
$selectdb = mysql_select_db("guestbook");
if (!$selectdb) {
$error = mysql_error();
echo "MySQL Error: $error";
}
?>
Hope this helps
Chris Hogben
"Nik Alleyne" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Good evening everyone,
> I am new (very new) to php. I was doing some research on the net and learn
> of this packaged and after reading just a couple of pages, i figure i
should
> learn this instead of ASP. It looks so easy. Anyhow here is my problem.
>
> I am trying to connect to the database (MySQL) however, I can't I am
> connecting to the server, but I cannot connect to my sample database.
>
> Here is my script?
> <?php
> mysql_connect("nik", "", "") or
> die("could not connect to the database");
> mysql_select_db("guestbook") or
> die ("could not connect to the specified database");
> ?>
> I'm getting the "could not connect to the specified database" message.
>
> Please Help
> Thx
> Nik
>
>
--- End Message ---
--- Begin Message ---
Hello.
I still can't manage to test locally the pages in my notebook, without using
the htdocs directory. As i told you, i managed to install the all the stuff
correctly, made my first test with a php script in the htdocs Apache
instalation folder, but when i tried to put that new directory path in the
httpd.conf file i couldn't see the php script on the designated folder. I
know that in the other case i had to access via http://localhost/test.php
path. How do i test a page that is, let's say, in the c:\website\ folder?
(after i configured its path in httpd.conf file, of course)
i know that i should put something like this in the httpd.conf file
<Directory "C:\WINDOWS\Desktop\work">
AddType application/x-httpd-php .php .phtml .php3
#Next line is optional (for viewing source)
AddType application/x-httpd-php-source .phps
</Directory>
but after that, what path i put in the browser?
Thanks in advance,
Tiago
--- End Message ---
--- Begin Message ---
You could create a VirtualHost using the VirtualHost directive in the
hhtpd.conf. It could look like this:
<Directory C:/WINDOWS/Desktop/work>
Options FollowSymLinks
AllowOverride None
</Directory>
<VirtualHost *:122345>
ServerAdmin [EMAIL PROTECTED]
DocumentRoot C:/WINDOWS/Desktop/work
ServerName dummy-host.example.com
</VirtualHost>
now u can access the direcotry via: http://localhost:12345
fabian
"Tiago SimõEs" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello.
>
> I still can't manage to test locally the pages in my notebook, without
using
> the htdocs directory. As i told you, i managed to install the all the
stuff
> correctly, made my first test with a php script in the htdocs Apache
> instalation folder, but when i tried to put that new directory path in
the
> httpd.conf file i couldn't see the php script on the designated folder. I
> know that in the other case i had to access via http://localhost/test.php
> path. How do i test a page that is, let's say, in the c:\website\ folder?
> (after i configured its path in httpd.conf file, of course)
>
> i know that i should put something like this in the httpd.conf file
>
> <Directory "C:\WINDOWS\Desktop\work">
> AddType application/x-httpd-php .php .phtml .php3
> #Next line is optional (for viewing source)
> AddType application/x-httpd-php-source .phps
> </Directory>
>
> but after that, what path i put in the browser?
>
> Thanks in advance,
> Tiago
>
>
--- End Message ---
--- Begin Message ---
Hi all,
how can I replace the n ; with only one
Mot1;;Mot2;;;;;;;;;;;;;Mot3;;;;;;Mot4;;;;;;;Mot5;;;;Mot6
==>
Mot1;Mot2;Mot3;Mot4;Mot5;Mot6
So that I can explode it in an array.
Thanks for your help
Horst
--- End Message ---
--- Begin Message ---
"Kriegers Horst" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all,
>
> how can I replace the n ; with only one
>
> Mot1;;Mot2;;;;;;;;;;;;;Mot3;;;;;;Mot4;;;;;;;Mot5;;;;Mot6
> ==>
> Mot1;Mot2;Mot3;Mot4;Mot5;Mot6
>
> So that I can explode it in an array.
... why not explode it then unset all the empty items?
--- End Message ---
--- Begin Message ---
try
$str = "Mot1;;Mot2;;;;;;;;;;;;;Mot3;;;;;;Mot4;;;;;;;Mot5;;;;Mot6";
$str = str_replace(";", "_;_", $str);
$str = str_replace("__;_", "", $str);
:-D
*********** REPLY SEPARATOR ***********
On 12/04/2002 at 16.10 Kriegers Horst wrote:
>Hi all,
>
>how can I replace the n ; with only one
>
>Mot1;;Mot2;;;;;;;;;;;;;Mot3;;;;;;Mot4;;;;;;;Mot5;;;;Mot6
>==>
>Mot1;Mot2;Mot3;Mot4;Mot5;Mot6
>
>So that I can explode it in an array.
>
>Thanks for your help
>Horst
>
>
>
>--
>PHP Windows Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
dr. Nicola Delbono
[EMAIL PROTECTED]
Key5 di Delbono Nicola
V. G.M. Rossi, 12
25038 Rovato (Bs)
Tel 39 030 7242266
Fax 39 030 7242266
www.smscitta.com | www.musicalbox.it
www.filosofo.it | www.bollicine.com
--- End Message ---
--- Begin Message ---
What does the underscore do in this situation?
-----Original Message-----
From: Nicola Delbono [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 12, 2002 12:43 PM
To: Kriegers Horst; 'PHP-Windows'
Subject: Re: [PHP-WIN] String reduce
try
$str = "Mot1;;Mot2;;;;;;;;;;;;;Mot3;;;;;;Mot4;;;;;;;Mot5;;;;Mot6";
$str = str_replace(";", "_;_", $str);
$str = str_replace("__;_", "", $str);
:-D
*********** REPLY SEPARATOR ***********
On 12/04/2002 at 16.10 Kriegers Horst wrote:
>Hi all,
>
>how can I replace the n ; with only one
>
>Mot1;;Mot2;;;;;;;;;;;;;Mot3;;;;;;Mot4;;;;;;;Mot5;;;;Mot6
>==>
>Mot1;Mot2;Mot3;Mot4;Mot5;Mot6
>
>So that I can explode it in an array.
>
>Thanks for your help
>Horst
>
>
>
>--
>PHP Windows Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
dr. Nicola Delbono
[EMAIL PROTECTED]
Key5 di Delbono Nicola
V. G.M. Rossi, 12
25038 Rovato (Bs)
Tel 39 030 7242266
Fax 39 030 7242266
www.smscitta.com | www.musicalbox.it
www.filosofo.it | www.bollicine.com
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I added the underscore artificially in order to make the string become
Mot1_;__;_Mot2_;__;__;__;__;__;__;__;__;__;_Mot3_;__;__;_andsoon;;;Mot4;;;;;;;Mot5;;;;Mot6
so ONLY the first(s) ";" begin with just ONE underscore
the other begins with 2 underscores, so you can recognize them
and strip them away.
the correct version would be
$str = "Mot1;;Mot2;;;;;;;;;;;;;Mot3;;;;;;Mot4;;;;;;;Mot5;;;;Mot6";
$str = str_replace(";", "_;_", $str);
$str = str_replace("__;_", "", $str);
$str = str_replace("_;", ";", $str);
The string is:
Mot1;;Mot2;;;;;;;;;;;;;Mot3;;;;;;Mot4;;;;;;;Mot5;;;;Mot6
then becomes
$str = str_replace(";", "_;_", $str);
Mot1_;__;_Mot2_;__;__;__;__;__;__;__;__;__;_Mot3_;__;__;_andsoon;;;Mot4;;;;;;;Mot5;;;;Mot6
then becomes
$str = str_replace("__;_", "", $str);
Mot1_;Mot2_;Mot3_;Mot4_;Mot5_;Mot6
then becomes
$str = str_replace("_;", ";", $str);
Mot1;Mot2;Mot3;Mot4;Mot5;Mot6
It's horrible but it works... ( yet I didn't test it )
Bye
*********** REPLY SEPARATOR ***********
On 12/04/2002 at 12.50 Matt Babineau wrote:
>What does the underscore do in this situation?
>
>-----Original Message-----
>From: Nicola Delbono [mailto:[EMAIL PROTECTED]]
>Sent: Friday, April 12, 2002 12:43 PM
>To: Kriegers Horst; 'PHP-Windows'
>Subject: Re: [PHP-WIN] String reduce
>
>
>
>try
>$str = "Mot1;;Mot2;;;;;;;;;;;;;Mot3;;;;;;Mot4;;;;;;;Mot5;;;;Mot6";
>$str = str_replace(";", "_;_", $str);
>$str = str_replace("__;_", "", $str);
>
>:-D
>
>
>
>
>
>
>*********** REPLY SEPARATOR ***********
>
>On 12/04/2002 at 16.10 Kriegers Horst wrote:
>
>>Hi all,
>>
>>how can I replace the n ; with only one
>>
>>Mot1;;Mot2;;;;;;;;;;;;;Mot3;;;;;;Mot4;;;;;;;Mot5;;;;Mot6
>>==>
>>Mot1;Mot2;Mot3;Mot4;Mot5;Mot6
>>
>>So that I can explode it in an array.
>>
>>Thanks for your help
>>Horst
>>
>>
>>
>>--
>>PHP Windows Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>dr. Nicola Delbono
>[EMAIL PROTECTED]
>Key5 di Delbono Nicola
>V. G.M. Rossi, 12
>25038 Rovato (Bs)
>Tel 39 030 7242266
>Fax 39 030 7242266
>
>www.smscitta.com | www.musicalbox.it
>www.filosofo.it | www.bollicine.com
>
>
>--
>PHP Windows Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
dr. Nicola Delbono
[EMAIL PROTECTED]
Key5 di Delbono Nicola
V. G.M. Rossi, 12
25038 Rovato (Bs)
Tel 39 030 7242266
Fax 39 030 7242266
www.smscitta.com | www.musicalbox.it
www.filosofo.it | www.bollicine.com
--- End Message ---
--- Begin Message ---
I am interested in serving up my own domain from my home computer
running the latest release of Apache on Windows 2000. I have a domain
name already registered. Does anyone know where I can find instructions
on how to set up my domain name to point at my server?
Thanks,
ROn
--- End Message ---
--- Begin Message ---
You might try one of the many DNS newsgroups such as
microsoft.public.windowsnt.dns for this question.
Some basic info: (This is very a very simplified response. You should check
out newsgroups dedicated to this complex subject)
You need to have a static IP address. Your registrar (such as www.netsol.com
will need that address and will at the top level point DNS services for your
registered name to your home computer DNS IP. You need to be running BIND or
similar DNS utility on your DNS server.
If you don't have a static IP address you can use one of many free services
to map your name to your dynamically assigned IP. These services typically
also provide DNS for static IPs. Services that come to mind are
www.dns2go.com or www.dyndns.org.
----- Original Message -----
From: "R.S. Herhuth" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, April 12, 2002 8:03 AM
Subject: [PHP-WIN] Instructions on how to resolve a DNS
>
> I am interested in serving up my own domain from my home computer
> running the latest release of Apache on Windows 2000. I have a domain
> name already registered. Does anyone know where I can find instructions
> on how to set up my domain name to point at my server?
>
> Thanks,
> ROn
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I thought I had seen some functions for creating zip files with PHP. I can't
find what I'm looking for to specifically create .zip files that are
decompressable by, say, winZip.
Anyone have experience creating .zip files with PHP? If so, could you point
me to the name of the function for doing this?
I found ZLib, but this doesn't seem to do what I want.
Much appreciated and TIA!
--
Nicole Amashta
Web Application Development
ABOL Software, Inc.
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Anyone know of any internet based tutorials on using stored procedures
with SQL Server?
Thanks,
ROn
--- End Message ---