PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
the variable $_SESSION[link] is written on the fly and not known in advance of the code execution. So in effect when link is read from the database the $_SESSION[link] part is simply a reference to some dynamic data.
Here is my exact code.
From the database the link row is:
$link_data="/home/$_SESSION[link]";
I am actually adding the link data to a html map - over a grpahic:
I don't think it's a good software solution - does every record in the DB contain the $_SESSION['link'] string? If, so - remove it and concatenate at execution time. If not - using eval() might be a solution, but I would advice you to reconsider your solution.
There are 10 types of people in this world, those who understand binary and those who don't
robburne wrote:Vladsun - the eval method works perfectly, why is it not a good solution?
Because eval() is security vulnerable by nature
I don't know where do you get contents for your DB rows and $_SESSION from and whether they could be injected with a malicious PHP code.
There are 10 types of people in this world, those who understand binary and those who don't