0

I need a string appended to a variable.

$name = "app200.php";

$string = <form name = "$name" method = "post">

echo "$string";

The result I need is

<form name = [B]"app200.php"[/B] method = "post">

But I am not able to echo the string this way. Any help.
Thanks

Edited by raghujosh: n/a

4
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by raghujosh
0
$string = "<form name = \"$name\" method = \"post\">";

Sorry, but this did not work.

0

Try this

$name = "app200.php";

$string = "form name = \"$name\" method = \"post\"";

echo $string;
0

Pritaeas has it. The fact that you can't see it may be due to the fact the this tag isn't displayed. Look at view source in your browser and you should see it. If you don't, you've omitted to include something.

Otherwise if you want to display the string in its entirety:

$string = "&lt;form name = \"$name\" method = \"post\"&gt;";

Edited by diafol: n/a

0

Pritaeas has it. The fact that you can't see it may be due to the fact the this tag isn't displayed. Look at view source in your browser and you should see it. If you don't, you've omitted to include something.

Otherwise if you want to display the string in its entirety:

$string = "&lt;form name = \"$name\" method = \"post\"&gt;";

Thanks. As you say Pritaeas was right. For some reason, it is there in the page source , but is just not displayed. I am just writing it into a file so it does not matter. Your code is displayed in the browser.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.