CASP+ CAS-003 – Question 269

0
100
⚠️ Retired / Legacy Exam: This exam has been retired or replaced. These practice questions are kept for reference only. Please check the official vendor website for current exam versions before studying.

A developer is reviewing the following transaction logs from a web application:
Username: John Doe
Street name: Main St.
Street number: <script>alert(‘test’)</alert>
Which of the following code snippets should the developer implement given the above transaction logs?

A. if ($input != strcmp($var1, “<>”)) {die();}
B. <form name =”form1″ action=”/submit.php” onsubmit=”return validate()” action=POST>
C. $input=strip_tags(trim($_POST[‘var1’]));
D. <html><form name=”myform” action=”www.server.com/php/submit.php action=GET”

Correct Answer: C

Cloud Tech
Cloud Tech is a small, independent team that writes free practice questions for Microsoft Azure, AWS and CompTIA certification exams. We write every question ourselves against the current official exam outline, explain why each option is right or wrong, link to the vendor's documentation, and update or archive sets when an exam changes. Spotted a mistake? Email [email protected].