Jump to content

Bootstrapped PW does not see submitted form data


Valery
 Share

Recommended Posts

Hello, everyone,

I've been playing around with Processwire since late 2012, so I am pretty much a novice. Hope my question is not too dumb though.

I seem to have a problem which I cannot solve on my own.

I want to be able to have a PW page with some form which, when submitted, is processed by a separate script. I added a form to the basic-page.php template. The code of the form looks like this:

<form id="f" action="/f.php" method="post">
<input type="text" name="char_name" id="ch_name" value=" ">
<button type="submit" id="char_name_submit">Proceed</button>
</form>
 
f.php processes the submitted form. Here's what its code looks like:
 
<?php

// bootstrapping PW
include("/u/www/htdocs/index.php"); 

if($input->post->char_name === null) echo "Form was not submitted";
    else if(!$input->post->char_name) echo "Form was submitted but the value is blank";

//some debug
echo $_POST["char_name"];
?>
 
The problem is, when I submit the form, I get "Form was not submitted" from the f.php script.
 
echo $_POST["char_name"] works just fine.
 
My PW installation runs on php5.3+nginx+OpenBSD.
 
Could you, please, tell me what I am doing wrong? Why is bootstrapped PW not seeing my submitted form data?
 
Thanks a lot for your help.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...