how can i make a php string and variable accessible by all php files

Normally what you do for womething like this is to setup a php file with the variables in it you need for every php script (for example vars.php). Then in each of the the php scripts on one of the lines before you attempt to use any of the variables you put:

include 'vars.php';

Here ios a link to a web site that discusses the use of include:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.