首页
编程语言
数据库
网络开发
Algorithm算法
移动开发
系统相关
金融统计
人工智能
其他
首页
>
> 详细
ISSS615讲解、辅导PHP_LAB1留学生、讲解c/c++,Python设计、辅导Java程序 辅导R语言程序|调试C/C++编程
ISSS615 Data Management
PHP_LAB1.doc page 1 of 4
SMU Classification: Restricted
PHP Lab 1
Objective:
The objective is to help the students to get hands on writing PHP code. In this lab
exercise, you will create PHP pages based on the requirements specified.
Pre-Requisites:
1. WAMP Server is installed and the icon is ‘Green’ in colour.
Submission:
Please submit all your answers in a single lab1.zip file containing the following to eLearn
(online) by the end of the class
- Exercise1.php,
- Exercise2.php,
- ex1form.html and ex1result.php
- ex3form.html and ex3result.phpISSS615 Data Management
PHP_LAB1.doc page 2 of 4
SMU Classification: Restricted
PART 1: Write basic PHP syntax codes
Exercise 1
Using php WHILE construct and IF-ELSE statement, write a program to display the count
of lowercase letter 'a' appearing in the text string "Data Management". Also display total
number of letters that are not 'a' in the same text string.
Save the file as Exercise1.php
Note: You could make use of the functions strlen and substr for this exercise.
Exercise 2
Write php program to calculate the cumulative sum of numbers from 1 to 10.
Display the result in a table format. Save the file as Exercise2.php
Note: Example of a Table html script that produces a table with 2 rows, a header row and
a content / data row
Header 1
Header 2
Column 1
Column 2
ISSS615 Data Management
PHP_LAB1.doc page 3 of 4
SMU Classification: Restricted
PART 2: Write PHP code for processing HTML Form data
1. Open a text editor, write the following code, and save the file as ex1form.html
A simple form
Enter your name:
2. Open a new page on the text editor, write the following code and save the file as
ex1result.php
print "Hi $_POST[fullname]. Welcome to PHP lab1 !
";>
3. In Internet Explorer/, enter http://localhost/PHPLab1/ex1form.html in the address bar.
You should see an output as follows
4. When you enter your name and click on the send button, the following output is
observed. ISSS615 Data Management
PHP_LAB1.doc page 4 of 4
SMU Classification: Restricted
Exercise 3
Add Gender Identification to the PHP code for processing HTML Form data
Your task is to modify the ex1form.html to include a dropdown box to allow user to select
a gender. Depending on the selected gender, you should print either “Miss” or “Mr”
Hint:
1. Modify ex1form.html to include another input element, a dropdown box named
gender (Male & Female).
-- Select One --
Male
Female
Save the modified file as Exercise3Form.html.
2. Modify the PHP page (ex1result.php) so that it handles the gender information sent
over by the client and save the modified file as Exercise3Result.php.
If Female is selected, the following output is observed.
If Male is selected in the select dropdown list, the following output is observed.
~~ End of PHP Lab 1 ~~
联系我们
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-21:00
微信:codinghelp
热点文章
更多
辅导 cs1b spring 2024 tth hw...
2024-04-19
讲解 managing financial risk...
2024-04-19
辅导 cs 0449 – project 5: /...
2024-04-19
辅导 elec 2141 digital circu...
2024-04-19
讲解 csc171 — videogame pro...
2024-04-19
讲解 comp3411 artificial int...
2024-04-19
讲解 stat3061: random proces...
2024-04-19
辅导 accounting 452, spring ...
2024-04-19
辅导 finc5001 foundations in...
2024-04-19
辅导 7ssmm712 – topics in a...
2024-04-19
讲解 com 337 - film studies ...
2024-04-19
辅导 mes202tc - digital vlsi...
2024-04-19
辅导 geography 2041b distanc...
2024-04-19
辅导 ecos3006 international ...
2024-04-19
讲解 fit5225 2024 sm1 creati...
2024-04-19
讲解 cit 593: introduction t...
2024-04-19
讲解 math 4931: take home ex...
2024-04-19
辅导 csci 547|info 533: syst...
2024-04-19
辅导 cs536-s24 intro to pls ...
2024-04-19
讲解 fit5212 - assignment 1辅...
2024-04-19
热点标签
com6521
can202
cs 6476
basc0003
ee3121
acct2002
comp5313
busi2131
ise529
csit940/csit440
cenv6141
comp3027/comp3927
ftec5580
comp1433
msci223
mark203
en3098
eden1000
ece6483
econ4410
mats16302
elec372/472
ecmt1010
comp222
comp3211
engg1340
fit5216
csc1002
comp10002
cmpsc311
chc6186
econ3208
cs 161
comp27112
comp282
swen20003
comm1190
elec9764
acfi3308
acct7101
fin6035
comp2048
geog0163
comp2013
coen 146
dts101tc
sehh2042
comp30023
comp4880/8880
cs 455
07
stat0045.
fil-30023
celen085
psyc40005
math40082
are271
comp9311
ee5311
imse2113
comp 2322
acct2102
fnd109
int102
is3s664
is6153
data4000
accfin5034
fit5212
cs536-s24
fit5225
ecos3006
mes202tc
finc5001
stat3061
csc171
cs1b
7ssmm712
bu.450.760
comp3411
cs170
swen90004
cpt206
comp5313/comp4313—large
bl5611
kxo206
comp532
elec207
kxo151
cs 2820
cpt108
math2319
dts204tc
qm222
comp2511
ccs599
infs1001
mat2355
eeee4123
25721
ifn647
pols0010
hpm 573
stat0023
csci 1100
qbus6860
comp9417
comp2003j
cse340
cs 2550
cs 61b
cs360
fin 3080
ierg 4080
cs6238
cit 594
finm7406
hw6
elec9713
asb-2522
mso3610
lit301
mcd4540
geog0030
125.330
biol0006
125.320
cs3334
fit2093
acct1101
110.309
masy1-gc
cs314
elec0048
gds104
mg5637
fit2096
math5905
eel4837
sehs4515
cpt s 321
asb2522 investment
ma214
co2104
mgmt2015
32516
math32051
econ1012
mark2052
econ0019
comp3310
dsci 525
abmf3184
aps106
antc27
finm7401
itp122
tech2300
math3026
comp9024
cao107
36318
is2022
cs 211
fit1047
ics4u
2xc3
en.540.635
4qqmn506
finn3081
phys10362
sta601
ec481e
math5165
csi 2120
el1205
comp7250
ecos3013
beam065
info1113
comp2051
csc325
mne 6130
ai6126
ecs150
is61x6
cse115
seng6110
bus265
cpts260
mphy0009
csc306
eco2011
ee3004
inu1111
st332
idepg001
info6001
cpt106
finm7409
联系我们
- QQ: 99515681 微信:codinghelp
© 2024
www.7daixie.com
站长地图
程序辅导网!