We help IT Professionals succeed at work.
Get Started

PHP - BUTTON HTML question

funkkube
funkkube asked
on
357 Views
Last Modified: 2013-12-12
I need to run the following

 <?php
$query = "insert into wp_posts (post_content,post_title) values ('{$final}','{$_POST["title"]}')";
mysql_query($query);
?> 

Open in new window


when a button is pressed on a page in Wordpress..

I have a bunch of if else statments that check for errors from the previous page and after that there are two buttons..
One to go back and correct the mistakes and then I want another button to appear if there are not any mistakes to correct and then run the above query then goto to the original page..

i have this

 <form> <input onclick="history.go(-1)" type="button" value="Go Back And Correct Entries" /> </form> <form> <input onclick="parent.location='http://www.rodbournehistory.org/?page_id=3279'" type="button" value="ADD ANOTHER RECORD" />
<?php
$query = "insert into wp_posts (post_content,post_title) values ('{$final}','{$_POST["title"]}')";
mysql_query($query);
?>
</form> 

Open in new window


but it is not working exactly..
I know im eing dumb on this but can anyone help?
Thanks
Mat


Comment
Watch Question
This problem has been solved!
Unlock 1 Answer and 9 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE