I want somethong like this: File PEOPLE.PHP
<?php
$name_surname1='Wiliam Smith';
$name _surname2='Adam BlaBla';
?>
other PHP File - RECORDS.PHP
<?php include 'people.php';?>
<html>
<body>
<div><? echo $ name_surname1;</div>
<div><? echo $ name_surname2;</div>
</body>
</html>
Please, tell me What is wrong in PEOPLE.PHP or how to achieve my task? I am totally new in this field. Thank you very much for your support
It looks like you have an unexpected space in the $name_surname2
variable.
Put this into your people.php :
$name_surname1='Wiliam Smith';
$name_surname2='Adam BlaBla';
Then, to access your vars, do not put spaces between $
and the variable name, and close your PHP tags.
<div><? echo $name_surname1; ?></div>
<div><? echo $name_surname2; ?></div>