Really simple I just think it’s me.
this is file 1.php
if(ctype_digit($_GET['id']))
{
$item_id = "Hello";
}
else
{
//Something
}
this is file 2.php
function item_show(){
$item_query = "SELECT title FROM tbl_items WHERE id='" . mysql_real_escape_string($item_id) . "' ";
}
Now my question is how do I get the value of $item_id from 1.php inside the function in 2.php ?
To add file 1.php and file 2.php are both included in index.php
Is there anything stopping you just passing it as a function argument like this?
or (the very hacky and not recommended):