• Hi,
    Im trying to add an Adminpanal to my plugin. While it is placed in a subfolder (../plugins/myplugin/myfile.php) I have to use backslashes in the address of the menufile:

    add_options_page('WP Cook', 'WP Cook', 8, 'wp_cookwp_cook_main.php', 'wp_options_page');

    Hence, it depends on the OS wheter I use a backslash(Windows-like servers) or a slah (Unix/Linux-liker servers).

    Thanks in advance!

Viewing 5 replies - 1 through 5 (of 5 total)

  • Hi,
    Im trying to add an Adminpanal to my plugin. While it is placed in a subfolder (../plugins/myplugin/myfile.php) I have to use backslashes in the address of the menufile:

    add_options_page(‘WP Cook’, ‘WP Cook’, 8, ‘wp_cookwp_cook_main.php’, ‘wp_options_page’);

    Hence, it depends on the OS wheter I use a backslash(Windows-like servers) or a slah (Unix/Linux-liker servers).

    Thanks in advance!

    where is your question?

    Thread Starter risehigher

    (@risehigher)

    Im sorry ^^.

    Is there any other solution except getting the server variables and deciding by there value which slash should be used?

    I believe you probably want to use linux-style, as windows will generally ‘do the right thing’ with it.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Use forward slash, always. That would be the “/” character.

    From https://us2.php.net/basename :

    “On Windows, both slash (/) and backslash (\) are used as directory separator character. In other environments, it is the forward slash (/).”

    both of those slashes are workin on unix, windows or linux properly, it’s hard to answer cause it’s not clear what u’re suffering there.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adding an adminpanal depends on Operating System’ is closed to new replies.