• Hello there,

    I need help understanding a bit of php features.
    I’m using a plugin which makes search forms. Upon completing the form, I get to include a line of code for my page.

    <?php if(function_exists('wp_custom_fields_search'))
    	wp_custom_fields_search('preset-1'); ?>

    Now, results are displayed in the search.php file. And in this file I would like to change html content (in my case <h2>content</h2>) based on the page the search form was submitted.

    What is the best way to achieve this? can php allow one to tell it: “if previous page id is 28, then display this….” ?

    Thanks a lot!

Viewing 1 replies (of 1 total)
  • Posting a url is always helpful…

    PHP renders the page from fresh when your browser makes a call to the server, so the only way to do it with PHP would be to pass a $_POST or $_GET value with the id of the current page which your PHP script would look for and then use in an ‘if’ statement (or similar).

Viewing 1 replies (of 1 total)
  • The topic ‘PHP conditional statements based on previous page?’ is closed to new replies.