php-windows Digest 31 May 2002 20:59:14 -0000 Issue 1171
Topics (messages 14038 through 14040):
Re: Somebody please help beginner with variable problem
14038 by: Zoombie
htaccess and PHP in general
14039 by: Matt Babineau
14040 by: Scott Hurring
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 noticed in your code that you use the short PHP tag, '<?'. PHP now
disables short tags by default. Try using '<?php' instead.
"Sim" <[EMAIL PROTECTED]> wrote in message
000001c2081c$ac9b7190$6401a8c0@athlon">news:000001c2081c$ac9b7190$6401a8c0@athlon...
> Hi,
>
> Please don't reply with RTFM. I just installed Apache 2.0.36 and PHP
> 4.2 in Win XP Pro. Apache is running fine */localhost/ is working* and
> <? phpinfo() ?> is showing the config. I have set register_globals =
> On. So I practice following the source code from the book (and even
> used the book's files), it seems that the form (in html) does not pass
> the variable to the php file, all I can see is the html with the current
> time (**echo date("H:i, jS F"); **). So if I can see the time output in
> html that means PHP is working but why aren't the variables
> passed/shown? I have been looking all over the mailing lists and I
> can't find anybody with the exact same problem.
>
> --------------
> HTML FILE:
> --------------
> <html>
> <head>
> <title>Bob's Auto Parts</title>
> </head>
> <body>
> <h1>Bob's Auto Parts</h1>
> <h2>Order Form</h2>
>
> <form action="processorder.php" method=post>
> <table border=0>
> <tr bgcolor=#cccccc>
> <td width=150>Item</td>
> <td width=15>Quantity</td>
> </tr>
> <tr>
> <td>Tyres</td>
> <td align=center><input type="text" name="tyreqty" size=3
> maxlength=3></td>
> </tr>
> <tr>
> <td>Oil</td>
> <td align=center><input type="text" name="oilqty" size=3
> maxlength=3></td>
> </tr>
> <tr>
> <td>Spark Plugs</td>
> <td align=center><input type="text" name="sparkqty" size=3
> maxlength=3></td>
> </tr>
> <tr>
> <td colspan=2 align=center><input type=submit value="Submit
> Order"></td>
> </tr>
> </table>
> </form>
> </body>
> </html>
>
> -------------------
> PHP FILE:
> -------------------
> <html>
> <head>
> <title>Bob's Auto Parts - Order Results</title>
> </head>
> <body>
> <h1>Bob's Auto Parts</h1>
> <h2>Order Results</h2>
> <?
> echo "<p>Order processed at "; // Start printing order
>
> echo date("H:i, jS F");
> echo "<br>";
> echo "<p>Your order is as follows:";
> echo "<br>";
> echo $tyreqty." tyres<br>";
> echo $oilqty." bottles of oil<br>";
> echo $sparkqty." spark plugs<br>";
>
> $totalqty = 0;
> $totalamount = 0.00;
>
> define("TYREPRICE", 100);
> define("OILPRICE", 10);
> define("SPARKPRICE", 4);
>
> $totalqty = $tyreqty + $oilqty + $sparkqty;
> $totalamount = $tyreqty * TYREPRICE
> + $oilqty * OILPRICE
> + $sparkqty * SPARKPRICE;
>
> echo "<br>\n";
> echo "Items ordered: ".$totalqty."<br>\n";
> echo "Subtotal: $";
> echo number_format($totalamount, 2);
> echo "<br>\n";
>
> $taxrate = 0.10; // local sales tax is 10%
> $totalamount = $totalamount * (1 + $taxrate);
> $totalamount = number_format($totalamount, 2);
> echo "Total including tax: $".$totalamount."<br>\n";
>
> ?>
> </body>
> </html>
> -----------------
> Result:
> -----------------
>
>
> Bob's Auto Parts
>
>
> Order Results
>
> Order processed at 16:54, 30th May
> Your order is as follows:
> tyres
> bottles of oil
> spark plugs
>
> Items ordered: 0
> Subtotal: $0.00
> Total including tax: $0.00
>
> Sim
>
>
--- End Message ---
--- Begin Message ---
I have a client that wants to use htaccess for verification and
authentication into certain areas of a web site. I suggested to use a
combination of PHP/MySQL to get the jobs done. it makes my life easier
and reduces low-level administration tasks on his part letting me bundle
all the administrative tasks into one neat PHP application. Rather then
administer qmail and htaccess access via text files or however they do
it. Does anyone have any good insight on what they think would be best?
I don't know alot about htaccess, so its a little foreign to me. But a
PHP/MySQL authentication system seems as secure and far far more salable
to both my abilities and his needs. Any thoughts?
Matt Babineau
Freelance Internet Developer
-----------------------------------------
e: <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
p: 603.943.4237
w: <http://www.criticalcode.com/> http://www.criticalcode.com
PO BOX 601
Manchester, NH 03105
--- End Message ---
--- Begin Message ---
Handle everything thru PHP/Mysql, but write a little function
that will read thru the Mysql database and write the .htaccess
files to disk as needed.
Of course, you'll have to set proper permissions on the files.
That's what i'm doing now for a project i'm working on...
all user data is in the database, and eveyrtime a change
is made to the DB, the .htpasswd file is written to disk
to keep it constantly updated.
---
Scott Hurring
Systems Programmer
EAC Corporation
[EMAIL PROTECTED]
Voice: 201-462-2149
Fax: 201-288-1515
> -----Original Message-----
> From: Matt Babineau [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 31, 2002 10:40 AM
> To: 'Php-Win (E-mail)'
> Subject: [PHP-WIN] htaccess and PHP in general
>
>
> I have a client that wants to use htaccess for verification and
> authentication into certain areas of a web site. I suggested to use a
> combination of PHP/MySQL to get the jobs done. it makes my life easier
> and reduces low-level administration tasks on his part
> letting me bundle
> all the administrative tasks into one neat PHP application.
> Rather then
> administer qmail and htaccess access via text files or however they do
> it. Does anyone have any good insight on what they think
> would be best?
> I don't know alot about htaccess, so its a little foreign to me. But a
> PHP/MySQL authentication system seems as secure and far far
> more salable
> to both my abilities and his needs. Any thoughts?
>
> Matt Babineau
> Freelance Internet Developer
> -----------------------------------------
> e: <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
> p: 603.943.4237
> w: <http://www.criticalcode.com/> http://www.criticalcode.com
> PO BOX 601
> Manchester, NH 03105
>
>
--- End Message ---