Simple idiot-proof $_REQUEST[] meets idiot ! PLEASE LOOK!

hi guys,

going nuts here. WATCH variable “cd”. WHY WON’T IT PRINT !!!

########################################################

my PHP code:
if ($access) { echo " onclick=\“x=eventWin('index.php?cP=11&id=”.$eid.“&cd=”.$date.“'); x.focus(); return false;\”"; }

generates this source code:
<div class=“item point” style=“color: #000000; background: #FF4444;” onclick=“x=eventWin(‘index.php?cP=11&id=3&cd=2012-02-29’); x.focus(); return false;” onmouseover="…

then I echo:
echo "event ID: " . $_REQUEST[‘id’] . “<br />”;
echo "calendar’s Date: " . $_REQUEST[‘cd’] . “<br />”;
die();

########################################################

all vars present in URL, but just the value for id prints… why not cd!! have tried re-arranging things and substituting literal values with no luck, and no more ideas.

any ideas at all are welcome! thank you!

Run var_dump on $_GET. And do not use $_REQUEST…


var_dump( $_GET );

done, getting:
array(1) { [“cP”]=> string(2) “11” } , that’s all she wrote… ???

var_dump($_GET[‘cd’]);

returns NULL

if I swap $date and $id then $date WILL print, and id does not…

var dump for all 3:
print "event ID: " . $_REQUEST[‘id’] . “<br />”;
print "calendar’s Date: " . $_REQUEST[‘cd’] . “<br />”;
var_dump($_REQUEST[‘cP’]); // prints string(2) “11”
var_dump($_REQUEST[‘id’]); // prints string(1) “3”
var_dump($_REQUEST[‘cd’]); // prints NULL
die();

thanks ROBINGAGA, but do not understand your message…

I’m guessing your javascript has an error in it. Use something like firebug to see exactly what is being sent back to the server.

What exactly is supposed to fill ‘cd’?

it’s a date. see source code below

my PHP code:
if ($access) { echo " onclick=\“x=eventWin('index.php?cP=11&id=”.$eid.“&cd=”.$date.“'); x.focus(); return false;\”"; }

generates this source code:
<div class=“item point” style=“color: #000000; background: #FF4444;” onclick=“x=eventWin(‘index.php?cP=11&id=3&cd=2012-02-29’); x.focus(); return false;” onmouseover="…

and what’s the code for eventWin? Cause it’s not a standard function afaik…

Thanks StarLion… I am modifying someone else’s code to suit my needs. am adding one var to URL string. upon closer examination I see I am in over my head. would appreciate greatly any help with this! need to make sense of this:

the problem lies somewhere in here: // runs AFTER my mod

$link=‘%<a\s[^<>]?href=“http://([\w-_./?&=#]{5,})”[^<>]?>([^<>]*?)</a>%’;
$_POST[“description”] = preg_replace($link,‘[$1|$2]’,$row[“description”]);

looks like I need to add a 3rd field to $link but will struggle with syntax… do you happen to know correct format please?