Question

In: Computer Science

1)   (chapter 3)What is a sticky form? 2)What is the purpose of using the following statements:...

1)   (chapter 3)What is a sticky form?

2)What is the purpose of using the following statements:
if ($_SERVER['REQUEST_METHOD'] = = 'POST') {
   // Handle the form.
   } else {
   // Display the form.
   }

3)   (PHP Chapter 2) PHP programming: POST and GET methods of a form, how to retrieve the input in the submission php code. $_POST, $_GET(), which way is more secure than the other? Why?

4) You can find how many records get affected in php Which function to use?

Solutions

Expert Solution

Ans-1) Sticky form in PHP is a standard HTML form that saves that data have been entered in a form. It’s really helpful for end-user because they don’t need to re-type data into the form if there’s an error while submitting.

Ans-2)if ($_SERVER['REQUEST_METHOD'] = = 'POST')

statement is used to check whether the request was done via $_POST or $_GET. $_POST are almost always done in some kind of form whether it’d be through Javascript or HTML, you’re still submitting the form. $_GET is usually through the URL or link. $_GET can also be passed through Javascript using a GET declaration.

and on basis of this condition, it will display the form if the request was not done via 'POST' else execute the code written in if block.

Ans-3)POST is more secure than GET for a couple of reasons :

GET parameters are passed via URL. This means that parameters are stored in server logs and browser history. When using GET, it makes it very easy to alter the data being submitted the server as well, as it is right there in the address bar to play with.

The problem when comparing security between the two is that POST may deter the casual user, but will do nothing to stop someone with malicious intent. It is very easy to fake POST requests, and shouldn't be trusted outright.

The biggest security issue with GET is not malicious intent of the end-user, but by a third party sending a link to the end-user. I cannot email you a link that will force a POST request, but I most certainly can send you a link with a malicious GET request.

Ans-4)The affected_rows / mysqli_affected_rows() function returns the number of affected rows in the previous SELECT, INSERT, UPDATE, REPLACE, or DELETE query.


Related Solutions

1- What is the purpose of ANOVA ? 2- What are the assumptions of ANOVA? 3-...
1- What is the purpose of ANOVA ? 2- What are the assumptions of ANOVA? 3- When and how should you use multiple comparison procedures for evaluating pairwise combinations of the group means?
1. Using the information in this chapter, label each of the following statements true, false, or...
1. Using the information in this chapter, label each of the following statements true, false, or uncertain. Explain briefly. a. U.S.GDPwas32timeshigherin2014thanitwasin1960. b. When the unemployment rate is high, the participation rate is also likely to be high. c. The rate of unemployment tends to fall during expansions and rise during recessions. d. IftheJapaneseCPIiscurrentlyat108andtheU.S.CPIisat 104, then the Japanese rate of inflation is higher than the U.S. rate of inflation. e. The rate of inflation computed using the CPI is a better...
1. Using the information in this chapter, label each of the following statements true, false, or...
1. Using the information in this chapter, label each of the following statements true, false, or uncertain. Explain briefly. a. The largest component of GDP is consumption. b. Government spending, including transfers, was equal to 18.1% of GDP in 2014. c. The propensity to consume has to be positive, but other- wise it can take on any positive value. d. One factor in the 2009 recession was a drop in the value of the parameter c0. e. Fiscal policy describes...
1) Describe in 1-2 short paragraphs, a) the purpose of the following types of financial statements...
1) Describe in 1-2 short paragraphs, a) the purpose of the following types of financial statements and b) why as a leader/manager you must be familiar with them:    - Balance sheet    - Income statement    - Capital statement 2) If, as a manager, you could only pick one financial ratio to look at on a weekly/monthly basis, which would it be?    a) Write/type out the equation    b) Discuss (1-2 short paragraphs) why you picked that equation, what information that would give...
Chapter 35:1.What is the purpose of insurance?2.How does a rider become part of an...
Chapter 35: 1.What is the purpose of insurance? 2.How does a rider become part of an insurance policy? 3.When can an estoppel arise? Chapter 36: 1.Why does an insured normally obtain life insurance? 2.What is a double indemnity rider? 3.What does an 80 percent coinsurance clause in an insurance policy mean? 4.May a beneficiary assign a life insurance policy? Explain.  
Taxpayer Form 1 Form 2 Form 3 Form 4 1 109 115 126 120 2 98...
Taxpayer Form 1 Form 2 Form 3 Form 4 1 109 115 126 120 2 98 103 107 108 3 29 27 53 38 4 93 95 103 109 5 62 65 67 64 6 103 107 111 128 7 83 82 101 116 8 122 119 141 143 9 92 101 105 108 10 107 113 127 113 11 103 111 111 108 12 54 64 67 62 13 141 145 142 160 14 92 94 95 102 15...
1. What are the purpose of studying psychological distress. 2 what are the key findings. 3...
1. What are the purpose of studying psychological distress. 2 what are the key findings. 3 any recommendation for people
What is the purpose of each of these financial statements? What is the purpose of the...
What is the purpose of each of these financial statements? What is the purpose of the different types of financial statements
What is the purpose and value of each of the 3 financial statements? What story does...
What is the purpose and value of each of the 3 financial statements? What story does each tell and how does each help a manager manage? Be sure to consider the balance sheet, income statement and the statement of cash flow.
Please provide a 2 to 3 paragraphs response to the following questions. What is the purpose...
Please provide a 2 to 3 paragraphs response to the following questions. What is the purpose of a capital budget? How is capital budgeting the same or different for government and non-profit agencies?  
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT