Hi, I am getting these errors in my code and I am not sure as to
why.
The errors are as follows:
This is further explained in the assessment question
here:
Exercise 5:
• Create a PHP file named Exercise5.php in the practicals/week10
folder of your TWA web site.
• Combine the code from exercise4.html and exercise4.php into
Exercise5.php (this is similar to exercise 3 in week 7 practical
exercises) so that the php script and the html form are in the same
file.
A. Modify the code so that
i. The form uses postback (ie, the form action is the same file
exercise5.php)
ii. Only the form is displayed on first load of the page
iii. The table of products is only displayed when there are
records to display
iv. The form and the messages as described in exercise 4 are
displayed when appropriate in appropriate locations
v. The value that the user enters in the form is maintained in
the text box after form submission
For further information all errors and the table of products
must be displayed on the same page as the input, not on a separate
page.
This Screen Dump might help clarify better what needs to
happen:
As you can see here all error messages display on the same page
as the input, as does the Product Table.
Any help would be greatly appreciated.
Thankyou =)
Quantity in Stock Please enter the quantity to check against stock levels Quantity: Warning: Undefined variable $not_numeric in I:\twa twa220 practicals week10\exercise5.php on line 72 Warning: Undefined variable $msg in l:\twa twa220\practicals week10\exercise5.php on line 73 Submit
Warning: Undefined variable Smysqli in I: twa twa220 practicals week10 exercise5.php on line 16 Fatal error: Uncaught Error: Call to a member function query() on null in I: twa twa220 practicals week10 exercise5.php:16 Stack trace: #0 {main} thrown in I: twa twa220 practicals week10 exercise5.php on line 16
The following screen dumps provide guidance for expected output for the above scenarios: A(ii) only the form displayed on first page load Quantity in Stock Please enter the quantity to check against stock levels Quantity: Submit Query Quantity in Stock Please enter the quantity to check against stock levels A(ii) table of products is only displayed when there are records to display A(iv) The form and the messages as described in exercise 4 are displayed when appropriate in appropriate locations A(v) The value that the user enters in the form is maintained in the text box after form submission Quantity: 100 Submit Query There are no products that have more than 100 in stock. Quantity in Stock Please enter the quantity to check against stock levels Quantity: hello The value entered for quantity was not a number Submit Query A(ii) table of products is only displayed when there are records to display A(iv) The form and the messages as described in exercise 4 are displayed when appropriate in appropriate locations A(v) The value that the user enters in the form is maintained in the text box after form submission Products with stock > 40 Product Code Name Quantity In Stock Price A0987 Google Home Mini 75 R2345 Samsung 320W Dolby Soundbar 50 549 R2456 JBL Junior Pop Kids Wireless Speaker 50 49.95 A(ii) table of products is only displayed when there are records to display A(iv) The form and the messages as described in exercise 4 are displayed when appropriate in appropriate locations A(v) The value that the user enters in the form is maintained in the text box after form submission Quantity in Stock Please enter the quantity to check against stock levels Quantity: 40 Submit
Hi, I am getting these errors in my code and I am not sure as to why. The errors are as follows: This is further explain
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Hi, I am getting these errors in my code and I am not sure as to why. The errors are as follows: This is further explain
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!