Topic: “PHP Control Structures”

 


 

Assignment ‘A’: Registration Form

 

TASK#1:

• In this assignment we will practice submitting form data to a web site, and returning a response to the user.

 

• We will also, verify that the user has entered data into the user name field on the form.

 

® First, you need a Form.

 

Create the HTML form seen below:

 

 

NOTE: Use PHP to retrieve and display the current date on the page.

 

<?php

 

echo "Date: " . date('F dS, Y'); ?>

 

 

 

Remember to save this page with a .php extension!

 

Save your HTML form page as registerForm.php, upload it to the server and test it in your browser.


TASK#1:

Next, you need to create the reply.php script which simply captures the values submitted via the form and:

 

  First, checks to see if the user name field is empty.

 

o If the user left this field blank, print the following message:

 

“You did not enter a user name.”

 

“Please return to the form and re-enter your information.”

 

o Otherwise, print the message:

 

“Thank you {print form value of username here!}.”

 

“You live in lovely region of: {print form value of region here!}.”

 

Output (Sample screen capture) IF FORM NOT EMPTY

 

Note: “Using the empty() function”

 

<?php

if (empty($variable))

{

print “message here”;

}

else

{

print “ ”;

}

?>

 

Save your SCRIPT as reply.php, upload it to the web server, and test.

 

 

module_3_assign_A_php1.doc

代写计算机编程类/金融/高数/论文/英文


  

本网站支持淘宝 支付宝 微信支付  paypal等等交易。如果不放心可以用淘宝或者Upwork交易!

E-mail:414745755@qq.com   微信:sziiitcn  工作时间:无休息工作日-早上8点到凌晨3点


如果您用的手机请先保存二维码到手机里面,识别图中二维码。如果用电脑,直接掏出手机果断扫描。

联系客服提交作业获取报价与时间?

最快2~12小时即可完成,用技术和耐心帮助客户高效高质量完成作业.