I have problem to calling function in string concatenation
i have this function :
function site_url() {
include("../connect.php");
$title= mysql_query("select * from shop_option where shop_key='site_url' ");
$row_title= mysql_fetch_array($title);
print ''.$row_title['shop_feild'].'';
}
This function will tell website url eg ( http://google.com )
and i want to call this function in string concatenation
echo '<script language="javascript">'.'window.location =
"'.site_url().'";'.'</script>';
i also called function into variable ! to testing but it's not work
$page = site_url();
echo '<script language="javascript">'.'window.location = "'.$page.'";'.'</script>';
so how can i call function when i want to string concatenation ?
error_logor inline error should give you a pretty good idea on what's wrong with your code$row_title['shop_feild']or shouldn't that be$row_title['shop_field']