I am trying to put a value into this pieice of code, buti cant get it work.
PHP Code:echo "<script type='text/javascript'>
window.location = '$row['redirect_url']'
</script>";
Printable View
I am trying to put a value into this pieice of code, buti cant get it work.
PHP Code:echo "<script type='text/javascript'>
window.location = '$row['redirect_url']'
</script>";
PHP Code:echo "<script type='text/javascript'>
window.location = 'WANTA TO PUT Database value here $something'
</script>";
Or completely from PHPPHP Code:?>
<script type="text/javascript">
window.location = '<?php echo $row['redirect_url']; ?>';
</script>
<?php
PHP Code:echo "<script type='text/javascript'>
window.location = '{$row['redirect_url']}'
</script>";
It is reccommended that you DO NOT put javascript or a great amount of HTML within the PHP tags and echoing it.
I would use RV's first example
I recommend you don't use Javascript to redirect. Use the header function:
PHP Code:header('Location: ' . $row['redirect_url']);