WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Paths in templates (3 posts)

  1. Jay1980
    Member
    Posted 6 years ago #

    Hi,

    I wrote a template, there is a form which sends data to the same file and beneath is php-script which is doing some calculator stuff.

    Anyway if my template is in my themedirectory and should be able to call itself - what do I have to fill in the action value of the form-element?

    Thanks in advance.

  2. whooami
    Member
    Posted 6 years ago #

    look at how the current 2 themes that are included in the zip handle form submissions. Look specifically at the search stuff.

    do not use $_server['php-self']

  3. Jay1980
    Member
    Posted 6 years ago #

    Thanks this was a great help and it works out.
    I want to share the solution:
    * Go to the WordPress Source Viewer to default theme in the search.php -file (http://phpxref.com/xref/wordpress/nav.html?_constants/index.html)

    * You can see if you like to want to put an URL into a php function use: "functionname(TEMPLATEPATH./'filenameinthetemplatedirevtory.xyz');"

    * If you like to put the filename as a Variable like you need it for a filepointer use:
    "$myfilevariable =TEMPLATEPATH.'/filenameinthetemplatedirectory.xyz';
    $filepointer = fopen($myfilevariable, "r");"

    Ok, hope this helps other hobby coders as well - this cost me some time.

Topic Closed

This topic has been closed to new replies.

About this Topic