The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Read File, Take text from file in to web page.
Anette
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Dec 31 2020, 10:40 AM
Post #2


.
********

Group: WDG Moderators
Posts: 8,683
Joined: 10-August 06
Member No.: 7



QUOTE(Anette @ Dec 31 2020, 02:38 PM) *

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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 26th January 2021 - 05:55 AM