Read File, Take text from file in to web page. |
Read File, Take text from file in to web page. |
Anette |
Dec 31 2020, 08:38 AM
Post
#1
|
Group: Members Posts: 1 Joined: 31-December 20 Member No.: 27,705 |
Hello!
I want to take text from a text file and put it in to a web page. I have an php menu, and I want to show the text in an specific "box". So I can keep the menu and change the text only in the content, when something is pressed in the meny. I that possible? Can I do it with php...or ? I can do it with a lot of php files, but I wonder if there is another way. Grateful for all help! This post has been edited by Anette: Dec 31 2020, 09:07 AM |
Christian J |
Dec 31 2020, 10:40 AM
Post
#2
|
. Group: WDG Moderators Posts: 9,722 Joined: 10-August 06 Member No.: 7 |
Hello! I want to take text from a text file and put it in to a web page. I have an php menu, and I want to show the text in an specific "box". Hello! Not sure what you mean with "PHP menu", but that could be done with https://www.php.net/manual/en/function.include.php or https://www.php.net/manual/en/function.file-get-contents.php QUOTE So I can keep the menu and change the text only in the content, when something is pressed in the meny. If you don't want to load a completely new page you'd need an IFRAME or Ajax (javascript), but I don't recommend that. It's much more reliable to load a new page. What is the purpose of chainging the text in the content --is it to make updating the site's menu or its content easier for the site owner? The former is best done by instead including the menu from an external text file. The latter can be done with PHP, the important part is to prevent malicious users from abusing the script. |
Lo-Fi Version | Time is now: 24th September 2024 - 04:16 PM |