php-windows Digest 21 Feb 2003 04:15:46 -0000 Issue 1598

Topics (messages 18636 through 18645):

Re: GD
        18636 by: Olafsson

WMI in PHP
        18637 by: Mike

Writing in txt file...
        18638 by: Afan Pasalic

Re: PHP HTTP Authentication, Win2k & IIS
        18639 by: John Toews

file processing question
        18640 by: paradiddles
        18641 by: Luis Ferro

Upgrade from 4.2.3 to 4.3.1
        18642 by: Nick H.

File upload - permission denied
        18643 by: Frans Bakker

Authenticate user
        18644 by: Rui

Re: PWS or IIS?
        18645 by: Leo G. Divingracia III

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 ---
yes

I used GD2


"Rich Gray" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> > I'm using php 4.3.1 on a Windows XP and I use IIS 5.1 as a
> > server.I tried to
> > use GD lib but is seems like the built in support of bundle GB is
missing.
> > Maybe I'm missing something but for me someone forgot to include
boundled
> > libgd in Windows version. I that true?
> >
> > So can anyone tell my how I install this GD on my system because all the
> > information I find on the web are for version 4.2.x and are running on a
> > Unix or linux platform.
> >
> > Thanx
> > Oli
>
> Did you uncomment out the GD extensions dll in php.ini and restart IIS?
> Rich
>


--- End Message ---
--- Begin Message ---
I am looking for any help for using any WMI in php.  Looking through the
Platform SDK yesterday there were several examples of implementing it with
different scripting languages.  As far as loading it in PHP what do I need
to do?  (If you cant tell i'm new to the windows server side of things).

--
Mike


--- End Message ---
--- Begin Message --- Hi,
I'm working on adding a new row in text file. I use file() to transfer file to array and then after recognizing the row with MARK_HERE hadd new row above the MARK row. It works fine. I use this code:

$AddContent = "Content of the new line...";

$lines = file('old_content.txt');
for($i=0; $i<count($lines); $i++)
{
echo "$i. $lines[$i]<br>";
if(ereg('### MARK_HERE New row comes above this one', $lines[$i]))
{
$NewArray[] = $AddContent;
}
$NewArray[] = $lines[$i];
}

But what then? Code to add new line works fine but can't convert/write back to new_content.txt file. looking for something opposite then file() - taking array and writing it in file...

Thanks for any help!


Afan

--- End Message ---
--- Begin Message ---
Thanks Rich, and Rico...

I turned register_globals on to no effect.
The only odd thing I am doing for IIS is that I
installed PHP under the ISAPI filters tab as well as
the configuration button. Normally I only install
under the configuration button. But it doesn't seem to
help.

Thanks!

--- Rich Gray <[EMAIL PROTECTED]> wrote:
> Are you doing the hack needed to use HTTP
> authentication with IIS? HTTP
> Authentication is only supported by Apache with PHP
> as a module, but there
> is a hack/workaround for IIS/ISAPI.
> 
> Cheers
> Rich
> > -----Original Message-----
> > From: Rico Derks [mailto:[EMAIL PROTECTED]]
> > Sent: 20 February 2003 07:49
> > To: John Toews; [EMAIL PROTECTED]
> > Subject: Re: [PHP-WIN] PHP HTTP Authentication,
> Win2k & IIS
> >
> >
> > Hi,
> >
> > I saw on the Zend page that they global variables.
> Check in your
> > php.ini if
> > your register_globals is on.
> >
> > Cheers, RICO.
> >
> > At 15:58 19/02/2003, John Toews wrote:
> > ><apologies if this came through yesterday as
> well, I never saw
> > it propogate
> > >though>
> > >
> > >Hello All,
> > >
> > >I am experimenting with HTTP authentication in
> IIS 5.0 on a
> > Windows 2000 SP3
> > >server with PHP 4.3.0. PHP is installed as an
> ISAPI module both
> > as a filter
> > >and an application mapping (both point to the
> php4isapi.dll).
> > All forms of
> > >authentication are turned off in IIS (anonymous
> access only). I
> > am using the
> > >php.ini-dist with only the /extensions directory
> changed.
> > >
> > >It appears to me that the user/pass I enter is
> never getting
> > through to PHP.
> > >I've tried authentication examples from
> > >http://www.zend.com/zend/tut/authentication.php
> as well as
> >
>
>http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCode
> > Id=252&lngW
> > >Id=8 with no luck.
> > >
> > >(btw, tested on a friends BSD/Apache, worked fine
> [a simple test from the
> > >zend.com page])
> > >
> > >Thanks!
> > >
> > >
> > >
> > >
> > >--
> > >PHP Windows Mailing List (http://www.php.net/)
> > >To unsubscribe, visit:
> http://www.php.net/unsub.php
> >
> >
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit:
> http://www.php.net/unsub.php
> >
> >
> >
> 

--- End Message ---
--- Begin Message ---
greetings,

I am learning the basics of file processing, starting w/ how to write data to a file. 
So far, I've created the .txt file and wrote the code. This is all being done on my 
local windows 2k PC for practice. My question is, where should I save the .txt file? 
So far, my forms and .php files are in the www directory. To open the file in PHP, I'm 
using the fopen() function. Below is the code I've writen:

//info to be writen to file 

$outputstring = $date."\t".$_POST["luminaireqty"]." luminairs \t" 
  .$_POST['coffeeqty']." coffee tables \t".$_POST['hallqty'].
  " hall tables \t\$".$total ."\t". $address."\n";

  // open file for appending
  @ $fp = fopen("../../orders/orders.txt", "a");

    flock($fp, 2);

    if (!$fp)
    {
      echo "<p><strong> Your order could not be processed at this time.  "
           ."Please try again later.</strong></p></body></html>";
      exit;
    }

    fwrite($fp, $outputstring);
    flock($fp, 3);
    fclose($fp);

   echo "<p>Order written.</p>";


Thanks,

Patrick

 



----------------
"forget your lust for the rich man's gold. All that you need, is in your soul. You can 
do this if you try. All that I want for you my son, is to be satisfied"

  ~ Lynard Skynard
--- End Message ---
--- Begin Message --- All the file functions can work all over the server, and can even work in diferent servers (if you got direct permissions, they work as in the local server, if not, you must send username/password to get permission).

As a rule, it is advisable to read/write all the files in the local server, in a directory outside of directories of the web server... But some hosts don't have that kind of setup and you can end up with writing to a directory inside the web space (which isn't advisable, specially because an outsider can have access of them - there are tricks to avoid that thru).

If required, you can add always the following in the begin of the file:

«
<?php
/*
»

and in the end:

«
*/
?>
»
That will end file snoopers from snooping your files content...

Cheers...
Luis Ferro
Teladigital.net

P.S.- a better option would be to write the content in a database but alas you are testing only ;)


paradiddles wrote:

greetings,

I am learning the basics of file processing, starting w/ how to write data to a file. So far, I've created the .txt file and wrote the code. This is all being done on my local windows 2k PC for practice. My question is, where should I save the .txt file? So far, my forms and .php files are in the www directory. To open the file in PHP, I'm using the fopen() function. Below is the code I've writen:

//info to be writen to file
$outputstring = $date."\t".$_POST["luminaireqty"]." luminairs \t" .$_POST['coffeeqty']." coffee tables \t".$_POST['hallqty'].
" hall tables \t\$".$total ."\t". $address."\n";

// open file for appending
@ $fp = fopen("../../orders/orders.txt", "a");

flock($fp, 2);

if (!$fp)
{
echo "<p><strong> Your order could not be processed at this time. "
."Please try again later.</strong></p></body></html>";
exit;
}

fwrite($fp, $outputstring);
flock($fp, 3);
fclose($fp);

echo "<p>Order written.</p>";


Thanks,

Patrick





----------------
"forget your lust for the rich man's gold. All that you need, is in your soul. You can do this if you try. All that I want for you my son, is to be satisfied"

~ Lynard Skynard



---
[This E-mail scanned for viruses by Declude Virus]

--- End Message ---
--- Begin Message ---
When updating from 4.2.3 to 4.3.1, was there any changes as to where php
pulls the modules from?  In the .ini, I have it set to ./ as the directory
for modules, (.ini is in c:\winnt) but it seems as though it wants to pull
the modules from the c:\php folder.  Is there something I am missing here
that would cause the ini to make the exe pull the modules from the c:\php
directory and not the c:\winnt directory where the ini resides??

Regards,
Nick H.


--- End Message ---
--- Begin Message ---
Hello everybody,

I use PHP (with MySQL) on a Windows2000 machine. For an application that I
am writing I need a simple straight forward file upload system through a
form, like this:

echo "
<form action=\"Example_Action.php\" enctype=\"multipart/form-data\"
method=\"post\">
<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"80000\">
<input type=\"file\" name=\"ImageFile\">
<input type=\"submit\" name=\"btnSubmit\" value=\"Upload\">
</form>
";

In the Example_Action.php I have the simple instruction to test the script:

$AppImageDir = "C:\\Inetpub\\wwwroot\\PremoGroup\\Images";

if (isset($_FILES["ImageFile"])) {
move_uploaded_file($_FILES['ImageFile']['tmp_name'],
$AppImageDir."\\".$_FILES['ImageFile']['name']);
}

Note that the double \\ are to escape "" and \\.

I try the script and the following error appears:

Warning: move_uploaded_file(C:\Inetpub\wwwroot\PremoGroup\Images\21532.jpg)
[function.move-uploaded-file]: failed to create stream: Permission denied in
c:\inetpub\wwwroot\Predan\example.php on line 6

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move
'C:\PHP\uploadtemp\php15.tmp' to
'C:\Inetpub\wwwroot\PremoGroup\Images\21532.jpg' in
c:\inetpub\wwwroot\Predan\example.php on line 6

Does somebody know why and how this error is produced and what I need to do
(what to change in the code, where to set what permissions, etc.)?

Thank you very much,
FRANS BAKKER


--- End Message ---
--- Begin Message ---
I'm trying to make a page that requires an authentification by the user.

A lot of problems appear when I run a script copied from the "O'Reilly : Web
Database Applications".

One of them is the function :clean: that doesn't exist, according with the
php compiler:

  session_start();

  $authenticated = false;

  // Clean the data collected from the user
  $appUsername =
    clean($HTTP_POST_VARS["formUsername"], 10);
  $appPassword =
    clean($HTTP_POST_VARS["formPassword"], 15);

Can someone tell me what is the prob? Where can I get information for this
kind of script?

Thanks.


--- End Message ---
--- Begin Message ---
m1nt ch3w wrote:
Howdy all,

Just got Win XP Pro, and was wondering which server to go for. IIS or PWS? Which one is more stable and stuff like that.
Thanks in advance,
/m1nt


hee hee... neither.  check out apache.   ;)


--
Leo G. Divinagracia III
[EMAIL PROTECTED]

zzzzz

--- End Message ---

Reply via email to