• I’ve placed some HTML code in one of my WordPress pages which calls a PHP which I have written. I placed the PHP in the WordPress Includes directory. When the HTML calls the PHP I get an error messsage that the PHP cannot be found.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Your own PHP should not go in to wp-includes folder but in wp-content. That is the only folder user content is intended to be under. The best place to put it is in your theme’s folder, or a subfolder in the theme’s folder.

    That may not be the problem however. Includes need a file path that starts from the server root of your hosting account, not a URL. Post the line of code you used to include the file. Also post the error message.

    Thread Starter maryandpaul

    (@maryandpaul)

    HTML CODE IN PAGE –
    <html>
    <body>
    <form action=”processorder2.php” method=”post”>
    etc
    etc

    THE FILE PROCESSORDER2.PHP PLACED IN THE THEME DIRECTORY OF THE WP-CONTENT FOLDER.

    ERROR MESSAGE RECEIVED –

    Page Not Found

    The page you tried to access does not exist on this server. This page may not exist due to the following reasons:

    You are the owner of this web site and you have not uploaded (or incorrectly uploaded) your web site. For information on uploading your web site using FTP client software or web design software, click here for FTP Upload Information.

    The URL that you have entered in your browser is incorrect. Please re-enter the URL and try again.

    The Link that you clicked on incorrectly points to this page. Please contact the owner of this web site to inform them of this situation.

    <form action="processorder2.php" method="post">

    thats not an include, and in the case of files that you are sending $_POST requests to, they ought to be located in your wordpress root.

    Also, why are you bolding things? We all do ok with normal type around here.

    And if you don’t want it in the wordpress root, you need an absolute path to where processorder2.php is located, not just the name of the file

    for example – if your wp root is https://mydomain.com/wordpress/&#8230;

    action=”/wordpress/wp-content/themes/my-theme/processorder2.php”

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WordPress Includes’ is closed to new replies.