Admin Required Link
Re: Admin Required Link
Yes, I know...I merely added that code to let him know that adding [exec] code [/exec] using the code I posted did not work.
Re: Admin Required Link
you are going to have to give us more information
what version of flatpress are you using ?
what php version are you using ?
what version of flatpress are you using ?
what php version are you using ?
Proudly using flatpress https://www.mypoppy.uk/blog
Re: Admin Required Link
Thanks for the follow up George.
I am using FlatPress version 1.2.1 and two different domains. One is running php version 5.6.39 and the other one is running php version 7.4.24
I am using FlatPress version 1.2.1 and two different domains. One is running php version 5.6.39 and the other one is running php version 7.4.24
Re: Admin Required Link
i think php version 5.6.39 is too out of date.
7.4 should be fine is your code working out of flatpress?
7.4 should be fine is your code working out of flatpress?
Proudly using flatpress https://www.mypoppy.uk/blog
Re: Admin Required Link
Yes, the code is working out of FlatPress. It doesn't appear that it is going to work and I don't have the coding skills to develop a Plugin to set this up.
Re: Admin Required Link
Your code, embedded in exec tags, works for me (I have no data.txt so I get the "The file cannot be found!" message).
But: Getting this error, exit is called. This stops every PHP execution immediately, so nothing else of your FlatPress will be displayed after that!
I'd recommend removing the exit and rework this in a more if/else fashion. Totally untested:
What I noticed: The code snippet you posted here misses the last semicolon after - could that be your initial problem?
But: Getting this error, exit is called. This stops every PHP execution immediately, so nothing else of your FlatPress will be displayed after that!
I'd recommend removing the exit and rework this in a more if/else fashion. Totally untested:
Code: Select all
if(!file_exists("data.txt")) {
echo "The file cannot be found!";
}
else {
$fp = fopen("data.txt", "r");
if(!$fp) {
echo "File cannot be opened";
}
else {
echo "<table border = 2>";
while(!feof($fp))
{
$info = fgets($fp);
echo "<tr>";
echo "<td>$info</td>\n";
echo "<br />";
}
echo "</tr>\n";
echo "</table>";
fclose($fp);
}
}
Code: Select all
fclose($fp)
Who is online
Users browsing this forum: No registered users and 41 guests