In the code below:
<SCRIPT>
var randomJS = Math.floor(Math.random()*11)
<?php
$randomPHP = "<script>document.write(random)</script>";
?>
</SCRIPT>
<?php
echo $randomPHP;
?>
The php code will echo a random value in the webpage. This is all fine. But if I email it will echo the following:
<script>document.write(random)</script>
I don't want that. I just need a single numeric value.
Please let me know how to get this done?
Thank You.
UPDATE: Instead of email, lets assume I am trying to attach the random number in the link.
<form class="form-inline" action="index.php#<?php echo $randomPHP ?>" method = "post" >
// Form code
</form>
This will output: I dont want that...
www.url/index.php#<script>document.write(random)</script>
I need this...
www.url/index.php#{-some-random-value-}