troubleshooting Question

How To Run PHP Script With Form Button and Stay on Same Page

Avatar of lleblanc65
lleblanc65Flag for United States of America asked on
2 Comments1 Solution1321 ViewsLast Modified:
I have a button that runs a PHP script that updates prices on my page. Right now the button redirects to the update page (priceupdate.php). I want the button to run this script, but not redirect to it. It'd even greater if the button's name could change from "Update Prices" to "Prices Updated" after it's been clicked.

I'm aware I'll need to use some javascript, but after some heavy googling I haven't found quite what I'm looking for. Here is what I have so far.

<form action="updateprices.php" method="post">
  <input value="Update Prices" type="submit">

Any suggestions? I don't have any text to submit, which is the majority of what I've been finding sample scripts for.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros