Forum Moderators: coopster
I have a file that receives information (variables X,Y,Z) from a link, searches a database and display results. No problem with that.
Now I need to use that same information (X,Y,Z) and send it to another page. (A plain page for printing the data)
$X = $_POST['value1'];
$Y = $_POST['value2'];
$Z = $_POST['value3'];echo ('Data information for variables');
echo ( $X $Y $Z);echo ('<a href="somefile.php?value1=$X&value2=$Y&value3=$Z">Print View</a>');
$strSQL = "SELECT table.* FROM table WHERE field1='X' AND field2='Y' AND field3='Z";
Rest of the file
'
ifelse
while ($row =
'
My problem is that is not no passing the information, in the link only shows:
[mysite.com...]
and not the value of the variables.
What am I doing wrong?
I use the same system to get the information in the first place.
Thanks for any help
Set your error reporting level to E_ALL at the top of your script, this may help with debugging.
error_reporting(E_ALL);
As BarryStCyr pointed out, double quotes allow you to parse a string without quoting variables. With your original string you would need:
echo '<a href="somefile.php?value1='.$X.'&value2='.$Y.'&value3='.$Z.'">Print View</a>';
dc