Reputation: 753
I'm getting the variable within textbox
as $Dataprefix=hello
, but what I want is to show the values within quotes as "hello"
Here's my code.
Data File Prefix Name: <input size="5" name="dataprefix" type="text" value="<?php echo $Dataprefix;?>">
and it shows value within textbox
as hello
Upvotes: 2
Views: 60
Reputation: 388
If you want the variable wrapped quotation marks to be displayed then :
echo '"'.$Dataprefix.'"';
If you only want to echo the variable when it satisfies "hello" :
echo ($Dataprefix === 'hello'? $Dataprefix : '' );
If this isn't what you are looking for then I would recommend rephrasing your question.
Upvotes: 1
Reputation: 21437
Then try this way it'll work for you
Data File Prefix Name: <input size="5" name="dataprefix" type="text" value='"<?php echo $Dataprefix;?>"'>
^^ ^^
Upvotes: 3
Reputation: 2843
You missed the echo
. Try this
Data File Prefix Name: <input size="5" name="dataprefix" type="text" value="<?php echo $Dataprefix;?>">
Upvotes: 2