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?
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.