Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

track.php

0 views
Skip to first unread message

Class Account

unread,
Apr 5, 2003, 12:04:40 AM4/5/03
to
Hi there,

for track.php, we will first accept a tracking #.
At the first time we don't know what that is, and so when we get the
tracking # from
"FORM", tracking # is by default 0.

In my code, as long as the tracking # is <= 0, the error msg, "tracking
# has to be > 0" will
print. However, I dont' know how to distinguish that the tracking # is 0
because the user
enters it or the user clicks the link "track" and because it is the
first time track is run,
no input of tracking # is gotten, and so tracking # is by default 0.

can I just display the error msg at the first time even though the user
does nto do anything wrong,
or how do you find out that the tracking # is not 0 because of the
default but entered by the user?

Boon Thau Loo

unread,
Apr 5, 2003, 2:09:14 AM4/5/03
to

The first time when it is zero, you should not display the error message.
You should only display that when the user enters an invalid tracking
number. So how do we distinguish whether it is the user who entered or the
first time you click the link?

One easy way is to check whether PROCESS="Y" or not. When you entered a
form, you will see:
http://inst.eecs.berkeley.edu/~cs186-cn/hw5/track.php?PROCESS=Y&TRACKNO=1
as the URL. That means PROCESS=Y, and TRACKNO=1. Use that PROCESS flag to
distinguish the two cases u mention below. You can fetch the PROCESS
value using the $_GET['PROCESS'] call.

0 new messages