Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JQuery failing to provide Success message. After user enters an email in the email field, the form auto populates other fields. Display a message asks

JQuery failing to provide Success message.

After user enters an email in the email field, the form auto populates other fields. Display a message asks if user needs to update the information. If so, use can update the information (After user hits the Update button, display a message saying your information has been updated. Keep other parts on the screen as it is). Do all these using AJAX/JQuery.

------index.html-----------

include('db.php'); $email=$_POST['email']; $address=$_POST['address']; $phone=$_POST['phone'];

$stmt = $DBcon->prepare("INSERT INTO student(email,address,phone) VALUES(:email, :address,:phone)");

$stmt->bindparam(':email', $email); $stmt->bindparam(':address', $address); $stmt->bindparam(':phone', $sphone); if($stmt->execute()) { $res="Data Inserted Successfully:"; echo json_encode($res); } else { $error="Not Inserted,Some Probelm occur."; echo json_encode($error); } ?>

Email:
Address:
Phone:

----------db.sql---------

CREATE TABLE USER_INFO

(EMAIL varchar(40) NOT NULL,

ADDRESS VARCHAR(100) NOT NULL,

PHONE VARCHAR(10) NOT NULL,

PRIMARY KEY (EMAIL) );

INSERT INTO USER_INFO(

Email,

Address,

Phone)

values('fake@ppp.com', '123 Easy St.', '555555555');

INSERT INTO USER_INFO(

Email,

Address,

Phone)

values('notreal@ppp.com', '555 Main St.', '123456789');

INSERT INTO USER_INFO(

Email,

Address,

Phone)

values('unreal@pp.com', '8008 5th Ave.', '987654321');

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mastering Real Time Analytics In Big Data A Comprehensive Guide For Everyone

Authors: Lennox Mark

1st Edition

B0CPTC9LY9, 979-8869045706

More Books

Students also viewed these Databases questions

Question

6. Define a collection of events E a , 0 Answered: 1 week ago

Answered: 1 week ago

Question

4. Label problematic uses of language and their remedies

Answered: 1 week ago