[PHP-DB] retreiving encrypted password

2005-11-15 Thread W Roothman
Dear all,

When adding a new record to my db using '...password('password')...', it ads a 
' * ' with the encrypted number when I work on Apache / MySQL, but not on IS. 
When trying to validate if the user has been registered, it does not validate 
and request the user to register even though already registered.

Also tried 'encode(password, salt)' with the same result.

Regards,

W

[PHP-DB] Remove MySQL Server

2005-10-20 Thread W Roothman
Dear All,

Anyone knows how to remove the MySQL server from XP under 'Services'? No option 
to delete or uninstall.

R's,

Will

[PHP-DB] MySQL Connect using Dreamweaver

2005-10-12 Thread W Roothman
Dear All,

I have installed MySQL 5 with PHP 4.3.3.

When trying to connect to a database form the 'Database' tab in Dreamweaver, I 
now get the following error when trying to select a DB:

'1251 Client does not support authentication protocol requested by server; 
consider upgrading MySQL client'

Regards,

Will

[PHP-DB] NOT NULL - newbie

2005-10-05 Thread W Roothman
Dear All,

When declaring values for an identifier with unsigned auto_increment, is it 
necessary to include NOT NULL?

my_id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,

or

my_id INT  NOT NULL UNSIGNED AUTO_INCREMENT PRIMARY KEY,

Regards,

Will 

[PHP-DB] Sending mail through localhost

2004-09-17 Thread W Roothman
Dear All,

Do I need to install a mail server, such as ArGoSoft Mail Server, on my computer (MS 
XP) in order to prevent this error when sending mail through a form (ref: N: Mail 
functions, PHP manual):

Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for 
[EMAIL PROTECTED] in c:\inetpub\wwwroot\..sendfeeback.php on line 22

php.ini is set to:

[mail function]
; For Win32 only.
SMTP = localhost ; for Win32 only

; For Win32 only.
sendmail_from = [EMAIL PROTECTED] ; for Win32 only

Thanks  regards,

Will

[PHP-DB] Newby variable error

2004-09-15 Thread W Roothman
Wizards,

I am VERY new to PHP, paging through Meloni's 'PHP Essentials' I get the following 
error which I assume is very simple to solve, but for me. I have tried different 
approaches in identifying the 'price' variable with no luck:

error:

Notice: Undefined variable: price in c:\inetpub\wwwroot\php exercises\do_calculate.php 
on line 20

Notice: Undefined variable: price in c:\inetpub\wwwroot\php exercises\do_calculate.php 
on line 24

You ordered 1 bags of Ethopian Harrar.

Bags of Ethopian Harrar are R0.00 each.

Your subtotal is R0.00.

Sales tax is 14% in this location.

R0.00 has been added to your order.

You owe R0.00 for your coffee.

code:

show_calculate_b.php

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
HTML
HEAD
TITLEBean Counter Form/TITLE
/HEAD
BODY
FORM method=POST action=do_calculate.php
PSelect a bean type:/P
SELECT name=beans size=1
 OPTION value=Ethiopian HarrarEthiopian Harrar - $14.25/OPTION
 OPTION value=KonaKona - $16.25/OPTION
 OPTION value=SumatraSumatra - $13.00/OPTION
/SELECT
PHow many bags would you like?/P
SELECT name=quantity size=1
 OPTION value=11/OPTION
 OPTION value=22/OPTION
 OPTION value=33/OPTION
 OPTION value=44/OPTION
 OPTION value=55/OPTION
/SELECT
INPUT type=submit value=Submit
/FORM
/BODY
/HTML

do_calculate_b.php

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
HTML
HEAD
TITLEBean Counter Results/TITLE
/HEAD
BODY
?php
// set up the pricing assignments
if ($_POST[beans] == Ethiopian Harrar) {
 $price = 14.25;
} else if ($_POST[beans] == Kona) {
 $price = 16.25;
} else if ($_POST[beans] == Sumatra) {
 $price = 13.00;
}
$sales_tax = .0825;
$sub_total = $price * $_POST[quantity];
$sales_tax_amount = $sub_total * $sales_tax;
$sales_tax_pct = $sales_tax * 100;
$grand_total = $sub_total + $sales_tax_amount;
$fmt_price = sprintf(%0.2f,$price);
$fmt_sub_total = sprintf(%0.2f,$sub_total);
$fmt_sales_tax_amount = sprintf(%0.2f,$sales_tax_amount);
$fmt_grand_total = sprintf(%0.2f,$grand_total);
echo PYou ordered $_POST[quantity] bags of $_POST[beans]./p;
echo PBags of $_POST[beans]  are \$$fmt_price each./p;
echo PYour subtotal is \$$fmt_sub_total./p;
echo PSales tax is $sales_tax_pct% in this location./p;
echo P\$$fmt_sales_tax_amount has been added to your order./p;
echo PYou owe \$$fmt_grand_total for your coffee./p;
?
/BODY
/HTML

Regards and many thanks,

Will