Reading a form in wordpress with the plugin Exec-PHP

9

We are using the Exec-PHP to use PHP in our wordpress page. But we got a problem, we cant read from a textfield form. Is this a Exec-PHP limmitation (If so could anyone recommend a plugin who does allow this) Or is something wrong in our code?

This is our code:

<form action="" method="post">
<input type="text"  value="voornaam"  />
<input type="submit" value="Verzend" />
<input type="hidden" name="button_pressed" value="1" />

<?php

if(isset($_POST['button_pressed']))
{
    echo $_POST["voornaam"];
    echo 'Done';
}

?>
993

Answer

Solution:

You should add:

<input type="text" value="voornaam" />

Then, in your PHP, you can use:

echo $_POST["voornaam"];

Your form:

<form action="" method="post">
  <input type="text" value="voornaam" />
  <input type="submit" value="Verzend" />
  <input type="hidden" name="button_pressed" value="1" />
</form>

People are also looking for solutions to the problem: php - jQuery Looping JSON Data

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.