Reputation: 11
How can i use this variable inside this?
<script language="JavaScript">document.title = "{$row['subject']} - Forum - Terraria 7.6";</script>
Tried every way
Upvotes: 1
Views: 202
Reputation: 21449
output the var in <?php ?>
tags
<script type="text/javascript">document.title = "<?php echo $row['subject']; ?>
- Forum - Terraria 7.6";</script>
Upvotes: 1
Reputation: 298582
Wrap it in <?php
tags:
<script type="text/javascript">
document.title = "<?php echo $row['subject']; ?> - Forum - Terraria 7.6";
</script>
Also, the language
attribute is depreciated. Don't use it. Use the type
instead.
Upvotes: 2
Reputation: 1559
document.title = "<?php echo $row['subject'] ?> - Forum - Terraria 7.6";
Upvotes: 2