84
Chapter 2
Step 2: Request the customer’s address
Next up is sending the phone number we got in
Step 1 to Break Neck’s web server, and asking for the
customer’s address based on that phone number.
<script>
var request...
function foo()
{
...
}
</script>
JavaScript
Customer’s Phone Number
2. Next, using the phone
number you just got from
the web form, you can set
up a new request with that
phone number as the data
in the request.
1. You’ll need to create a request
object in our JavaScript, just like
you did back in Chapter 1.
4. The Break Neck web server needs a
PHP script that can look up a customer’s
address using his phone number.
Web Server
Man, Break Neck pizza rocks. There’s
nothing like a breakfast of cold pizza, a
whipped latte from Starbuzz, and the
Webville Times to read.
<script>
var request...
function foo()
{
...
}
</script>
JavaScript
<script>
var request...
function foo()
{
...
}
</script>
Customer’s Phone Number
Customer’s Address
Customer’s Order
3. You can use the request object
to send the customer’s phone
number to the Break Neck server.
We’re on to the next part
of our Break Neck diagram.
Is the browser involved at all in this step? If
you think it is, add a note to this page saying
what you think the browser does.
Where’s Waldo?
the Web Browser
making a request