php echo in html form value

I cant get this part of my code to work
[php]value="<?php echo $dbname; ?>" [/php]

Has anyone got any ideas, im sure its pretty simple but im just starting out
Here is the whole snippet

[php]if(mysql_query($sql,$con))
{
echo (“table has been created” .’

First Name:
Database Name:
') ; }[/php]

The form comes up fine, the value in the 'Database Name ’ field is the code itself and not the echo.

you’re already inside the php tags… rather than <?php ?> just use the . operator:

echo (“table has been created” .’

First Name:
Database Name:
')
Sponsor our Newsletter | Privacy Policy | Terms of Service