Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Undefined Function WP

Featured Replies

This is odd.

 

I've created a form on a Wordpress page, it POSTs to filename.php. Filename.php is basically a page template that should then display the information submitted.

 

However, doing it this way it doesn't work, complaining that "get_header" etc are all undefined. It would seem that whatever file you're POST'ing too, can't use Wordpress functions.

 

Any ideas on this? Workarounds? Doesn't seem quite right to me...

 

I also tried making a page, setting the PHP file as the pages template, then POSTing to that, but that just loads the homepage :S however if you then refresh you get the right page - but minus the form information.

Edited by brightonmike

  • Author

I can't give you a link, but basically, imagine you have your action file, e.g.

 

<form id="homequoteform" action="<?php bloginfo('template_directory'); ?>/contactengine.php" method="post">

 

In that file, you want to echo the fields the user has typed in. You obviously don't want it to be a blank white page displaying the fields, so you reference your WP header/footer etc.

 

That's what doesn't work. However, I am thinking of not doing it this way....though it'd still be interesting to find out why you can't POST to a php file that uses Wordpress functions.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.