Valery Posted January 15, 2013 Share Posted January 15, 2013 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 More sharing options...
Valery Posted January 15, 2013 Author Share Posted January 15, 2013 Sorry, disregard this post. I really should read the (awesome) PW docs more attentively... 1 Link to comment Share on other sites More sharing options...
diogo Posted January 15, 2013 Share Posted January 15, 2013 This is what I was going to say edit: you can also do: wire('input')->post->char_name For others reading this post, the documentation is here http://processwire.com/api/include/ And welcome to the forums Valery Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now