Link to home
Start Free TrialLog in
Avatar of DaveKid
DaveKid

asked on

Post Form to Specific WordPress Page Template

I have a form that a built.   I want the action of the form to be a page template called "InitialPlacement_Action".  I know that could post the page back to itself but like I said I'd like to be able to post it to that template page.

Any way to do this?
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

HTML forms make the request (GET or POST) to the URL given in the action= attribute of the form tag.
http://php.net/manual/en/tutorial.forms.php
Avatar of DaveKid
DaveKid

ASKER

@Ray

This is really more of a WordPress question.  I should have made that more clear but since I was choosing WordPress as my primary section I was posting to, I didn't think it necessary.  Will make that update.
Avatar of Jason C. Levine
Why is this WordPress specific?  Even in WordPress, a form uses the action attribute to send the data to a specific page.

Your page template is just a PHP file in the theme folder.  That's the action:

http://yoursite.com/wp-content/themes/yourtheme/pagetemplate.php
Avatar of DaveKid

ASKER

Sorry, I must have used the wrong "word" to describe my action page.  I NEVER use WordPress and am only doing a one off for a friend of mine.  I can describe it better like this:

I set up a "new page" in WordPress.  I titled that page InitialPlacement_Action.  How do I post to that new "page"?
ASKER CERTIFIED SOLUTION
Avatar of Jason C. Levine
Jason C. Levine
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DaveKid

ASKER

Yes, testing = important.

(although, i have a php plugin installed so I can run custom php)

I'm guessing by your post that it needs to be the fully qualified URL?
"Needs" is a relative term (at a minimum it "needs" to be something that works).  A fully qualified URL is perfectly fine in most cases, and often a good path to a working solution.  OTOH it limits the ability to reuse the code.