Dynamic title with submit form (wordpress)

469 views Asked by At

I'm trying to make an job board with wordpress and have the following issue:

On a common page you will see all the avaiable jobs. If you click on a job you will go to a job page. This is just working fine.

The next step shoud be a submit form with the job title. It should be like this:

JOBS Page --> JOB XXX --> SUBMIT form with the job title/id.

  • How can i get the jobs title on the form page?
  • How can i send the dynamic title/id etc of that page to my mailbox with contact form 7 (dynamic text extension).
1

There are 1 answers

0
Moeed Farooqui On

You can get the current page title by using post_title and can put it in a hidden field.
Something like below

<input type="hidden" id="job_title" name="job_title" value="<?php echo $post->post_title; ?>"/>

On the submitted page:

$jobtitle = $_REQUEST['job_title']; // and you can mail this by using mail() function