I am attempting to set a wordpress site title like a value for any variable.

I have got:

$title = get_bloginfo('name');

that simply returns it as being an undefined variable

and I have also attempted this which does the identical factor.

$title = bloginfo('name');

I have also attempted such as the source file using the bloginfo() function however it just gives another error.

@ruslan

<?

$title = get_bloginfo('name'); 

print "ret_data=$title";
?>

any ideas?

Just appreciated:) In case your file performed from browser and never within the 'wordpress-context' attempt to write in the top it this line

require_once("wp-config.php");
require_once(ABSPATH."wp-includes/wp-db.php");

Second one is required to use wordpress class WPDB to gain access to the database. To make use of get_bloginfo enough first line. I really hope it's helpfull.