php-windows Digest 21 Nov 2003 12:36:51 -0000 Issue 2009
Topics (messages 22151 through 22153):
Re: PHP mkdir with IIS and network share
22151 by: David Strencsev
Re: Using PHP to reload a page w/variable.
22152 by: H Marc Bower
Compiling
22153 by: Alexandre Trevisani
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 ---
I'm not sure if you need the mode octal in the mkdir funcion in windows.
Anyway I hope you read a comment in the php's online mkdir function manual:
mkdir will create directories with undesired/unexpected owner/group
settings in certain circumstandes when SAFE_MODE is on. See the bug report:
http://bugs.php.net/bug.php?id=24604
You might notice that when you create a new directory using this code:
mkdir($dir, 0777);
The created folder actually has permissions of 0755, instead of the
specified
0777. Why is this you ask? Because of umask(): http://www.php.net/umask
The default value of umask, at least on my setup, is 18. Which is 22 octal,
or
0022. This means that when you use mkdir() to CHMOD the created folder to
0777,
PHP takes 0777 and substracts the current value of umask, in our case 0022,
so
the result is 0755 - which is not what you wanted, probably.
The "fix" for this is simple, include this line:
$old_umask = umask(0);
Right before creating a folder with mkdir() to have the actual value you put
be
used as the CHMOD. If you would like to return umask to its original value
when
you're done, use this:
umask($old_umask);
"Dang Nguyen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi All,
>
> I have a php script that was carried over from an Apache/Solaris
environment
> into a Windows 2000/IIS/PHP 4.3.4 environment. Now I need to tweak the
> script a little to deal with the filesystem differences. The script, as
> originally designed and written, can read files from the filesystem,
create
> directories, write files back to the filesystem, etc. After moving to the
> Windows environment, the script is now required to access files on a
network
> share and create files and directories over the network share. I've
figured
> out how to configure IIS so that PHP scripts will be able to read, using
> opendir(),readdir(), etc., from the network share. However, after the
> reconfiguration of IIS, my scripts still cannot create directories over
the
> network share. No errors are getting written to my error log file either.
>
> I have reconfigured IIS to use an account that has read and write
> permissions on the network share when "anonymous" access is used, which is
> how the scripts can now read and list files on the network share. Does
> anyone have any other suggestions for me to check or do so that the
scripts
> can also create files and directories on the network share?
>
> code snippet:
> $directory = '\\\\seint16\\nt_share\\';
> mkdir($directory,0755);
>
>
> Thanks,
> Dang Nguyen
--- End Message ---
--- Begin Message ---
If I understand what you're trying to do correctly, I would have the form
action come back to the same page, where verification is done. At the top,
you could have a big "if the page has been submitted, execute this code"
section where it does verification of the data. If the data is ok, it can
display a simple "Registration Confirmed. Click here to log in." kind of
message, which then takes them on to the next stage (presumably, logging
in). In the form, I would write the form tags like this:
<input type=password name=regpassword value="<?php echo
$_POST['regpassword']; ?>">
<input type=text name=regusername value="<?php echo $_POST['regusername'];
?>">
etc.
If the value is empty, then it just doesn't get filled in (as in the first
iteration through the page). On the second iteration through the page, if
there is an error, it would fill in the values that were originally entered
(you could put some logic in to not fill in certain fields, if you wish) and
the person needs only change the missing or incorrect values with everything
else still filled in.
In order to get the little messages, you could include a variable in your
error-checking section which sets a variable which is read just
above/below/wherever the form fields.
<?php
if($passworderror == 1)
{
echo "<font color=red>Please make sure your password is 6
characters</font>";
}
?>
<input type=password name=regpassword value="<?php echo
$_POST['regpassword']; ?>">
Or something along those lines.
Hopefully I understood what you were asking correctly. :)
(V)
----- Original Message -----
From: "Roderick Martin" <[EMAIL PROTECTED]>
To: "'PHP Help Desk'" <[EMAIL PROTECTED]>
Sent: Wednesday, November 19, 2003 2:37 PM
Subject: [PHP-WIN] Using PHP to reload a page w/variable.
> I'm finding it hard to believe this is as difficult as it appears, but
> everywhere I search indicates that what I want to do is not an easy
> task.
>
> How do you code this?
>
> You have a user signup page and the user fills it out, filling out two
> password fields to ensure they typed it in properly and hit Submit.
>
> How in PHP do you evaluate the password strings (or other strings like
> checking email for a valid email address) and if something is wrong,
> reload the page.
>
> In my case, I have one page that does multiple things and I pass
> variables to determine what parts of the page load, so ideally, I'd
> like to reload the page and pass a variable so I can reveal some text
> like "Please retype your password".
>
> Is it really as difficult as some sites make it out to be? It seems to
> be a pretty common thing to do.
>
> Thanks!
--- End Message ---
--- Begin Message ---
I have a file with many functions defined for my use in some applications.
How can I compile them so that I can use it as an PHP extension ? Is that
possible ?
--- End Message ---