DaveC426913
Programmer
I'm tasked with upgrading an app from PHP4 to PHP5.
Is there a diff in how they read the querystring?
In PHP5, I'm using $_GET[], but the code for PHP4 does not have this, it seems to access the variables directly.
URL:
select_date.php?fm=eventForm&fld=event_date
PHP4 code in select_date.php:
<script>
function oldValue(){
var rawDate = window.opener.document.forms['<?= $fm ?>'].<?= $fld ?>.value;
}
</script>
<body onLoad="JavaScript
ldValue()">
In PHP5 this code does not work. $fm and $fld are undefined - unless I add this:
$fm = $_GET['fm'];
$fld = $_GET['fld'];
Question is: How does the original code manage to work?
Is there a diff in how they read the querystring?
In PHP5, I'm using $_GET[], but the code for PHP4 does not have this, it seems to access the variables directly.
URL:
select_date.php?fm=eventForm&fld=event_date
PHP4 code in select_date.php:
<script>
function oldValue(){
var rawDate = window.opener.document.forms['<?= $fm ?>'].<?= $fld ?>.value;
}
</script>
<body onLoad="JavaScript
In PHP5 this code does not work. $fm and $fld are undefined - unless I add this:
$fm = $_GET['fm'];
$fld = $_GET['fld'];
Question is: How does the original code manage to work?