Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
What do you mean “in wordpress”, are you saying you’ve just moved a file inside a theme directory and it doesn’t work?
No, it’s when I include it. The file itself opened from in the theme works. I also tried without including the file, thus with only the code included, then it doesn’t work. I don’t know if it works with a template, but I want to use it with “search.php”, I don’t see how to make a search page out of a template.
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
It sounds like a permissions issue if the only thing you’ve done is moved the file.
The permissions I changed also. As you see I edited my former answer.
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
. I also tried without including the file, thus with only the code included, then it doesn’t work.
Can you re-explain what you mean by this? It doesn’t read well for me (personal opinion).
Sorry.
header
<main>
.....
<?php
ini_set('display_errors', 'On');
error_reporting(E_ALL);
$search = $_GET['s'];
$file=fopen("visitors.txt","a");
fwrite($file, "$search");
fclose($file);
?>
</main>
footer
I’m only trying to get the ‘s’ value written to the text file. It is about searches done on the site.
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
I see.
Can you post the snippet showing how you’re including the file? Also, can you repeat the theme file you’re editing for this?
And what URL are you accessing to run the file?
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
The theme file I edit was ‘search.php’
You reach it from any what page when you do a search but it is on
http://www.buyonauction.eu/art/search.php
But it has little sense to give that now, as it doesn’t work with an ordinary include, thus <?php include(‘…
Yes that’s what I’m saying.
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
What happens when you use the full theme path in your include?
Starting from /wp-content
Nothing as far as I see. I searched for “Picasso”.
Including the whole path from /domains/ gave an error about a parameter that should be 1.
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
I wouldn’t include the whole path from domains, just from the ‘wp-content’ bit.
Were you receiving an error message when you started this thread?
It wasn’t for the error message when I included the whole path. I found it strange that there was no error message at all without the path. Then I tried it in a part of my hosting where no WordPress is and there it worked. For that reason I came to this forum, I wondered if WordPress blocks that function maybe for safety.