Computer Science, asked by aravindshajan123, 8 months ago

Consider that a web page displays a form containing two text boxes (named num1 and num2), where the user enters a string data. Write a PHP script which collects this form data, reverse it and place the result in respective textboxes itself. Assume that the script is to be embedded in the web page specified by the action attribute of the form and that the method used when the form is submitted is GET.

Answers

Answered by RitaNarine
0

When comparing two values, you should use HTML's "numerical" class and an if statement.

  • Then you can use javascript to write code that will receive the data and place it into the text boxes.
  • The best thing you could do is separate the logic into 2 php files so you can include both and not worry about sending all of the data.
  • The simplest thing I could do is have one that just receives the values and puts them into the text box. The second one takes the input and passes it back to the first one.
  • Just remember when you are using jQuery or any other JavaScript file to only use it on a new page or reloading of an existing one
  • You will need to pass the values from the previous page to the next page using something like sessions. That way they don't have to retype all of the information.
  • You can also have a session timeout feature in there so they don't stay signed in forever.
  • An excellent idea would be to have a cookie on the first page, and on the next page read the cookie and use the value for anything it needs to do.
  • One more idea would be to use Google Maps. The information could be stored there and then you can pass it to another PHP file that has access to the information.
  • Then the second PHP file will take the values and compare them to google maps. It will check the distance and retrieve an answer.
  • You will also want to use AJAX to send the data from one page to the next. You will want to use XMLHttpRequest instead of using javascript to send the data.

and Hence,

When comparing two values, you should use HTML's "numerical" class and an if statement.

#SPJ1

for more

https://brainly.in/question/17752375

Similar questions