...

View Full Version : javascript in php



thindrakhya
11-28-2007, 04:53 AM
hi friends ,

i have this php code


header("Location: merge_cart.php?oldsession=" .urlencode($cart["sessionId"]));


now i want to convert this code into javascript code in php echo statement

e,g
echo (" windows.location(......php) ");

does anyone knows how to do that

when i do iam getting an error

Inigoesdr
11-28-2007, 05:06 AM
window.location('page.php?vars');

thindrakhya
11-28-2007, 06:01 AM
i want to know how my above link will appear in echo statement



echo(" window.location('merge_cart.php?oldsession=" .urlencode($cart["sessionId"])');

This is giving me error

Kalli
11-28-2007, 06:13 AM
echo(" window.location('merge_cart.php?oldsession=" .urlencode($cart["sessionId"])');
is making it...

window.location('merge_cart.php?oldsession=sessionId


echo(" window.location('merge_cart.php?oldsession=" .urlencode($cart['sessionId'])"');");

will output

window.location('merge_cart.php?oldsession=23425');

23425 is an example

and i think you need

<script type="text/javascript">
<!--

//-->
</script>

in the echo somewhere
im not sure if this will work but.....



echo(" <script type='text/javascript'>
<!-- window.location('merge_cart.php?oldsession=" .urlencode($cart['sessionId'])"'); //-->
</script>");



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum