New to PHP and MSPWS for W2K

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jamesjl
Forum Newbie
Posts: 5
Joined: Sun Aug 25, 2002 5:34 am
Location: UK

New to PHP and MSPWS for W2K

Post by jamesjl »

Hi All,

I have just joined this forum and already I have a question. I have bought a couple of books on PHP. I have copied a chunk of code out, checked it a hundred times for errors but it still doesn't work quite right. Atleast it doesn't work quite right on PWS on my W2K machine. When I uploaded it to my web site it worked fine, the forms were processed and it even sent me email.

The source code can be viewed athttp://www.dive-master.org/formprocess2.txt.

On my PWS version I get the error
Notice: Undefined index: step in c:\inetpub\wwwroot\formprocess2.php on line 10
at the top of the page but the form does display. Once I have completed the form I click the continue button but the page does not display. Instead the address line in my browser now reads
and I get a Page cannot be displayed error.

Does anyone have any suggestions as so what could be wrong. I think that it is porbably something to do with the PHP configuration, but I am not sure. I only downloaded and installed the smaller MSI binary from php.net

Any thoughts or even solutions would be most appreciated.

many thanks,

Jason james.
User avatar
Xelmepa
Forum Commoner
Posts: 41
Joined: Sat Aug 24, 2002 3:02 pm
Location: Athens, Greece
Contact:

Post by Xelmepa »

PWS as in?
jamesjl
Forum Newbie
Posts: 5
Joined: Sun Aug 25, 2002 5:34 am
Location: UK

Post by jamesjl »

PWS is Microsoft's Personal Web Server or Internet Services Manager as it is called on Widows 2000.

Sorry for the confusion.

Regards,

Jason.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

please read Sticky: Before Post Read: Concerning Passing Variables in PHP 4.2+

you should also take a look at the list of
Predefined Variables

if you replace line 10 from
$form =& $HTTP_POST_VARS;
to
$form = &$_POST;

and <form action="<?php $PHP_SELF ?>" method="POST">
to <form action="<?= $_SERVER['PHP_SELF'] ?>" method="POST">

it might also work on your system
jamesjl
Forum Newbie
Posts: 5
Joined: Sun Aug 25, 2002 5:34 am
Location: UK

Post by jamesjl »

Hi Volka,

thanks for the help. That has solved the first problem and the error message has gone and the form is displayed correctly:-).

However, when I submit the form I still get a garbled address line and the new pages does not load.

Any ideas,

Jason.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

hmmm...possibly no short-tags on your system.
Anyway - I don't like them, too ;)
change <?= $_SERVER['PHP_SELF'] ?>
to <?php print($_SERVER['PHP_SELF']); ?>

does this work?
edit & btw: you can leave the whole action-thingeling empty as long as the same script/page shall be called (and it will be by PHP_SELF).
try: <form method="POST">
JPlush76
Forum Regular
Posts: 819
Joined: Thu Aug 01, 2002 5:42 pm
Location: Los Angeles, CA
Contact:

Post by JPlush76 »

I also run PWS and PHP... from my PWS experience PWS doesn't run mail(), creating images or pretty much anything without and outside download. :roll:

What are the new msgs you're getting?
jamesjl
Forum Newbie
Posts: 5
Joined: Sun Aug 25, 2002 5:34 am
Location: UK

Post by jamesjl »

Hi all,

I took Volka's advice and removed the action part of the form tag and all is well. This also works on my hosted site as well. :D

Do you suggest that I stop using PWS and use something else instead? Any suggestions? If I install Apache will it interfere with my PWS installation?

Thanks again,

Jason.
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

Does anyone know where to download PWS? I've seen the URL several times and tried all of them but no luck...
jamesjl
Forum Newbie
Posts: 5
Joined: Sun Aug 25, 2002 5:34 am
Location: UK

Post by jamesjl »

PWS comes with most of the latest Microsoft operating sytems, including W2K and XP. It may not be installed at the time that the operating system is installed but it is on the disk. I believe it is also in the NT4.0 option pack that can be downloaded from downloads.microsoft.com.

I hope this helps.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

for win nt or 95 you there is a download section on http://www.microsoft.com
http://www.microsoft.com/msdownload/ntoptionpack/download.asp?StepNumber=1

If you are using Windows 98, the Personal Web Server is included on the CD
w2k prof./server as well but it is called Internet Information Services (even if you've installed something called PWS is's still IIS5.0 ;) )

You may install IIS and apache side by side if they're using diffrent ports.
atm I have apache running on port 80 and IIS on 7070.

On both servers PHP works as expected. (And apache:80 keeps those annoying FrontPage-scanners down :D )
Post Reply