I have an application that is using session variables. I am trying to pass the path of an image to another PHP page, but since the page is in another location my path breaks and the images won't display. Is there a way to concatenate onto the path in the $_SESSION
variable?
page1.php
<?php
session_name('Private');
session_start();
$_SESSION['first_img'] = '<img src="img/first-img.png">';
$_SESSION['second_img'] = '<img src="img/second-img.png">';
?>
page2.php
<?php
session_name('Private');
session_start();
echo $_SESSION['first_img'];
echo $_SESSION['first_img'];
?>
since page2.php
is in another folder, I would need to add ../
to the beginning of the src
in the image path. I can't figure out how to add it to the $_SESSION
variable.