WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to pass a variable by get method in self page? (11 posts)

  1. erfan_atp
    Member
    Posted 5 months ago #

    Hi, I have a form that its action is null (action="") and my php codes are below of my page, not in another page. So I want to pass a variable by get method in this page after my php codes done?
    You know that the page will reload after my functions.

  2. Christian1012
    Member
    Posted 5 months ago #

    What specifically is your question. How to pass an url parameter?

  3. erfan_atp
    Member
    Posted 5 months ago #

    no! I use header("location:/index?type=true") but it doesn't appear in my url. it doesn't compile header function.

  4. Andrew
    Forum Moderator
    Posted 5 months ago #

    Have you seen the documentation? http://www.php.net/manual/en/function.header.php

  5. erfan_atp
    Member
    Posted 5 months ago #

    sure!!! I used it before, in a php code. but in wordpress it doesn't work.
    My Main problem:
    I have a form in a custom template and when it submitted, I want to show to user : 'Your request submited'.

  6. Andrew
    Forum Moderator
    Posted 5 months ago #

    So can you just use the "action" in the form element?

  7. erfan_atp
    Member
    Posted 5 months ago #

    No, I just return a true value to my form to show to user, any way

  8. Andrew
    Forum Moderator
    Posted 5 months ago #

    Can you pastebin all relevant code?
    http://pastebin.com

  9. erfan_atp
    Member
    Posted 5 months ago #

    summary of my code:
    here

  10. Christian1012
    Member
    Posted 5 months ago #

    You can't send headers or or sessions after your output to the browser. You need to either use an output buffer, or put that code at the top of the page before you output anything to the browser.

  11. erfan_atp
    Member
    Posted 5 months ago #

    tnx Christian1012, Done!

Reply

You must log in to post.

About this Topic