Hey, Just wondering if somebody can show off some php skills for me. Im using <?php echo $mid; ?> on one of my pages and I get the page error: xxxxxx is undefined. (xxxxxx = whatever i set it as) At the very top of my page i have this in the code: <?php $gid = $_COOKIE['gid']; $yid = $_COOKIE['yid']; $mid = $_COOKIE['mid']; $sid = $_COOKIE['sid']; ?> It echos properly and the pages loads however I get that error on page message. Any ideas? Any suggestions would be great. Cheers, Swerd
What output do you see when you use the echo statement. I mean are you getting the expected value set by the cookie - thru the $_COOKIE array? Also check if you are using this code in the very first page where you are trying to set cookie. If it is so, you can read the cookie value only on the subsequent pages only.
I think you have somewhere a misspelling. I guess it is something like echo $$mid instead of $mid. If you show exactly the code will be easier
Hey, this is the full code: [CODE <SCRIPT> microsoft_adcenterconversion_domainid = <?php echo $mid; ?>; microsoft_adcenterconversion_cp = 5050; </script> <SCRIPT SRC="http://0.r.msn.com/scripts/microsoft_adcenterconversion.js"></SCRIPT> <NOSCRIPT><IMG width=1 height=1 SRC="http://<?php echo $mid; ?>.r.msn.com/?type=1&cp=1"/></NOSCRIPT>[/CODE] If i remove that code from the page it loads fine. But with it, I get the page error with the little yellow icon in the status bar. krishmk - yes, it displays what has been set as the cookie properly bozghiyy - no mispellings, though i wish it were something simple like that. cookies are enabled. Thanks for the help guys.
hmm, just did a bit of playing around. it actually seems to be a problem with the conversion tracking code.. not with my echo's. I just took out the echos and put in text and the page still shows an error.
Ok, I just added quotes around the echo like this: microsoft_adcenterconversion_domainid = "<?php echo $mid; ?>"; This has fixed the page error. However my question now is: Will these quotes affect the tracking?