[PHP-WIN] file processing question

2003-02-20 Thread paradiddles

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 pstrong 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 pOrder 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



[PHP-WIN] basic variable question

2003-02-13 Thread paradiddles

  Hi everyone. Why does my code work when I enter just 1 for the quantity, but only 
returns $1.10 when I enter a quantity of 2 or more? 

 

   $totalqty = 0.00;
   $totalamount = 0.00;

   define(HALLTABLE, 800);

   $totalqty =  $_POST[hallqty]; //quantity

   $totalamount =  $_POST[hallqty] * HALLTABLE; //total cost

$totalamount = number_format($totalamount, 2);
 echo $totalamount;
 echo br\n;
 echo Items ordered:  .$totalqty.br\n;
 echo Subtotal:   $.$totalamount.br\n;

 $taxrate = 0.10; // local sales tax is %10
 $totalamount = $totalamount * (1 + $taxrate);

 $totalamount = number_format($totalamount, 2);


 echo br\n;
 echo Total including tax: $.$totalamount.br\n;

 




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



[PHP-WIN] code change in new version?

2003-02-04 Thread paradiddles

Hey everyone!

I noticed that in the older version of php (when register globals was 'on' by default) 
that coding for 'post' variables (where info is passed from the form into the 
variables) took an easier approach ...ie. 

$totalqty = $tireqty + $oilqty + $sparkqty; (old way)

$HTTP_POST_VARS[tireqty] + $HTTP_POST_VAR[oilqty] + HTTP_POST_VARS[sparkqty];  
(new way)

2 questions:

1.) Is there a shorter way to code this stuff now?

 2.) Do I need to change the way I code for everything now, or do the changes only 
apply to retrieveing form variables?

thanks-




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



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


[PHP-WIN] newbie form question..

2003-01-24 Thread paradiddles

I just created a simple html form and a .php file as a test to be sure php is working 
right. All I want the form to do is test the echo construct (which prints the text 
between the opening and closing php tags) to be sure my php interpreter is working 
right. 

The line in my html form used to identify the method looks like this:

form action=processorder.php method=post

The line in my html form used to trigger the submit button looks like this:

input type=submit value=Submit Order

The code in my php file called processorder.php looks like this:

html
head
   titleSeans Designs - Order Results/title
/head
body
h1Seans products/h1
h2Order Results/h2
?
   echo pOrder processed.;
?


/body
/html

The problem is when I hit the submit button on my form, I see all the text accept for 
the text Order processed which is contained in the php tag. In other words, its as if 
the echo construct is being completely ignored. I think the problem has something to 
do with the register_globals=on or off thing. So, I changed the setting from off 
(which was the default setting) to on and restarted apache. No joy!

Is there something in the code that I need to change?

thanks




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



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


RE: [PHP-WIN] newbie form question..

2003-01-24 Thread paradiddles

Rich,

thanks for your response. I've tried using the ?php tag- no joy and I can view the 
code in my php file. Also, you mentioned that I should take a look at the server log. 
Where would I find that?

 

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



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


RE: [PHP-WIN] newbie form question..

2003-01-24 Thread paradiddles

Warren,

that was it! I wasn't envoking the form from the 'local host'. Instead I was browsing 
the c drive. Now I can see the text w/in the php echo tag.

Thanks again for the help guys-

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



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


[PHP-WIN] Help!

2003-01-23 Thread paradiddles
Greetings everyone,
I successfully installed (locally) the php/mysql/apache bundle called swamp-0.1.1. 
I created my 1st php file that I've attached along w/a very basic .html form that it is supposed to parse (from the bookPHP and MySQL Web Development by Welling and Thomason). the php file does not seem to recognize the text passed to PHP's simple echo construct tag. 
When I click the "submit" button on the form, the php file is called up and displays "Sean's products" and "Order results"...but the text w/in the echo construct tag "Order processed" does not display.
I saved both the form and the php file locally in a dir. called www which is in the root of my swamp directory

Any ideas?
thanks."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 SkynardDo you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-WIN] HTTP 404 File not found error

2003-01-10 Thread paradiddles

Hey everyone,

I installed php 4.3.0-win32, mysql-3.23.54-win and apache_1.3.27 on Win2000 last week, 
followed instal directions (from the manual) as best I could. 

For testing purposes, I created a file called phpinfo.php. When I try and load it 
locally, my browser returns the HTTP 404 File not found error.

I've been troubleshooting this for week now and have posted some questions dealing 
with this problem earlier.

As a final attempt to get this resolved, I'm requesting someone who has the exact same 
setup that I do, send me their php.ini and httpd.config files so I can compare them to 
my own. Along with the files, I request that you send me any preliminary installation 
steps that I may have overlooked.

Otherwise, I'm tempted to abort this process and download everything again starting 
from scratch (which I really hope to avoid unless I have no other option). I'm not 
giving up!

Thanks-

Patrick




you can observe a lot by watching

  ~ Yogi Berra



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


RE: [PHP-WIN] HTTP 404 File not found error

2003-01-10 Thread paradiddles

Thanks for your response. So far, so good. I added everything you suggested and ran 
apache from the cmd line. In doing so, I got an errror (please see below):

C:\Program Files\Apache Group\Apacheapache
Syntax error on line 194 of c:/program files/apache group/apache/conf/httpd.conf
:
Cannot load c:/php/sapi/php4apache.dll into server: (126) The specified module c
ould not be found:

Note the errors or messages above, and press the ESC key to exit.  0
C:\Program Files\Apache Group\Apachecd acache group

What do you make of it?

thanks again,

Patrick 




you can observe a lot by watching

  ~ Yogi Berra



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


RE: [PHP-WIN] HTTP 404 File not found error

2003-01-10 Thread paradiddles
Its in thereI still get the same error. Perhaps there is something not quite right in my httpd.conf file.
I attatched it. Please take a quick peak here and see if you notice any ass backward entries.
thanks,
Patrick"you can observe a lot by watching"
 ~ Yogi BerraDo you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See URL:http://www.apache.org/docs/ for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  
#
# After this file is processed, the server will look for and process
# C:/Program Files/Apache Group/Apache/conf/srm.conf and then C:/Program Files/Apache 
Group/Apache/conf/access.conf
# unless you have overridden these with ResourceConfig and/or
# AccessConfig directives here.
#
# The configuration directives are grouped into three basic sections:
#  1. Directives that control the operation of the Apache server process as a
# whole (the 'global environment').
#  2. Directives that define the parameters of the 'main' or 'default' server,
# which responds to requests that aren't handled by a virtual host.
# These directives also provide default values for the settings
# of all virtual hosts.
#  3. Settings for virtual hosts, which allow Web requests to be sent to
# different IP addresses or hostnames and have them handled by the
# same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with / (or drive:/ for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with /, the value of ServerRoot is prepended -- so logs/foo.log
# with ServerRoot set to /usr/local/apache will be interpreted by the
# server as /usr/local/apache/logs/foo.log.
#
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., c:/apache instead of c:\apache).
# If a drive letter is omitted, the drive on which Apache.exe is located
# will be used by default.  It is recommended that you always supply
# an explicit drive letter in absolute paths, however, to avoid
# confusion.
#

### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#

#
# ServerType is either inetd, or standalone.  Inetd mode is only supported on
# Unix platforms.
#
ServerType standalone

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
ServerRoot C:/Program Files/Apache Group/Apache

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
#
PidFile logs/httpd.pid

#
# ScoreBoardFile: File used to store internal server process information.
# Not all architectures require this.  But if yours does (you'll know because
# this file will be  created when you run Apache) then you *must* ensure that
# no two invocations of Apache share the same scoreboard file.
#
ScoreBoardFile logs/apache_runtime_status

#
# In the standard configuration, the server will process httpd.conf (this 
# file, specified by the -f command line option), srm.conf, and access.conf 
# in that order.  The latter two files are now distributed empty, as it is 
# recommended that all directives be kept in a single file for simplicity.  
# The commented-out values below are the built-in defaults.  You can have the 
# server ignore these files altogether by using /dev/null (for Unix) or
# nul (for Win32) for the arguments to the directives.
#
#ResourceConfig conf/srm.conf
#AccessConfig conf/access.conf

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to Off to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15

#
# Apache on Win32 always creates one child process to handle requests.  If it
# dies, another child process is created automatically.  Within the child
# process multiple threads handle incoming requests.  The next two
# directives control the behaviour of the threads and processes.
#

#
# MaxRequestsPerChild: the number 

RE: [PHP-WIN] HTTP 404 File not found error

2003-01-10 Thread paradiddles

I deleted that line (which is not where I put my php file, its in the htdocs).

Anyway, I ran apache after that and now it seems that random syntax errors are popping 
up. For example: (see below) 

C:\Program Files\Apache Group\Apacheapache
Syntax error on line 344 of c:/program files/apache group/apache/conf/httpd.conf
:
AllowOverride not allowed here
Note the errors or messages above, and press the ESC key to exit.  6
C:\Program Files\Apache Group\Apacheapache
Syntax error on line 349 of c:/program files/apache group/apache/conf/httpd.conf
:
order not allowed here
Note the errors or messages above, and press the ESC key to exit.  0
C:\Program Files\Apache Group\Apache

Sounds like my config file may be messed up beyond repair. 

What do you think?

 




you can observe a lot by watching

  ~ Yogi Berra



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


Re: [PHP-WIN] [newbie] What does this mean?

2003-01-08 Thread paradiddles

Jim,

thanks for the response. Well- I think your right! I created index.htm and saved it to 
my htdocs dir.

I get the file not found when I try and bring it up. To answer your question ... I 
have:

DocumentRoot C:/Program Files/Apache Group/Apache/htdocs/


typed into my httpd.conf file just under: # symbolic links and aliases may be used to 
point to other locations.
#

Patrick

 




you can observe a lot by watching

  ~ Yogi Berra



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


RE: [PHP-WIN] newbie ...instal question.

2003-01-07 Thread paradiddles
Robert, Did you add this php4apache2.dll to the config file in some way? If so, how 
should I add it? thanks- pr



you can observe a lot by watching

  ~ Yogi Berra



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


[PHP-WIN] [newbie] What does this mean?

2003-01-07 Thread paradiddles

Hey list,

I'm still having problems loading my ?php phpinfo;? where I get the HTTP 404 - File 
not found error.

When I view the apache error log, I see..

 [Tue Jan 07 11:56:21 2003] [error] [client 127.0.0.1] (2)No such file or directory: 
script not found or unable to stat: c:/php-4.3.0-win32/php.exe/phpinfo.php

Do you think this is the crux of the problem?

thanks-

PR






you can observe a lot by watching

  ~ Yogi Berra



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


Re: [PHP-WIN] [newbie] What does this mean?

2003-01-07 Thread paradiddles

Sorry,

In reference to my last question, I did type ?php phpinfo();? correctly and it still 
gives me 

the file not found error.

pr




you can observe a lot by watching

  ~ Yogi Berra



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


[PHP-WIN] newbie ...instal question.

2003-01-06 Thread paradiddles

I just installed php 4.3.0-win32, mysql-3.23.54-win and apache_1.3.27 on Win2000 in 
hopes of

getting my feat wet. Well, I've yet to get past the phpinfo.php (test) page w/out 
getting the file not found error. 

After following the instructions from php.net, I thought that I was on target. The 
last thing I tried was to add the... LoadModule mod_php4 
c:/php/php-4.3.0-win32/sapi/php4apache.dll ...line to the config file after I copied 
my DLL file into the system 32 directory. When I go to fireup apache, I get the error: 
can't locate API module structure 'mod_php4 in the 
c:/php/php-4.3.0-win32/sapi/php4apache.dll ...

Any smart people out there who can lend a freshman a bit of help?

 

thanks,

Patrick





you can observe a lot by watching

  ~ Yogi Berra



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now