Hello people,
I am pretty new to PHP,
I have made following pages
Index.php
contains following code:
Below is my code for pag2.php
'eval' does that mean you check if the PHP code is valid?
(I believe you use the 'eval' to check for errors ? correct me if I am wrong)
If I don't want to use the 'eval', just call the function (foo)
how should I write the code instead?
Thank you in advance
I am pretty new to PHP,
I have made following pages
Index.php
contains following code:
PHP:
<?php
session_start();
$_SESSION['foo']='
<?php
function foo()
{
echo "asdasdd";
}
?>';
?>
<a href="pag2.php">link </a>
Below is my code for pag2.php
PHP:
<?php
session_start();
eval('?>'.$_SESSION['foo']);
foo();
?>
'eval' does that mean you check if the PHP code is valid?
(I believe you use the 'eval' to check for errors ? correct me if I am wrong)
If I don't want to use the 'eval', just call the function (foo)
how should I write the code instead?
Thank you in advance