hi i want to know how i can make a variable equal to itself.
so if i echo $var
it show show $var
on my screen.
ive been trying to write a whole php script to a new file using php, but when i write to the file everything works except my variables disappear and i suspect that its because they equal nothing so im trying to get them to equal themselves.
$my_file = '../../../'.$_POST['username'].'.php';
$handle = fopen($my_file, 'w') or die('Cannot open file: '.$my_file);
$data = "
<?php
$db_host = 'localhost';
$db_user = 'root';
$db_pass = '';
$db_database = 'fitnesstest';
$con = mysql_connect($db_host,$db_user,$db_pass) or die('Unable to establish
a DB connection');
mysql_select_db($db_database,$con);
$date = strtotime('+3 day');
$dates = date('M d, Y', $date);
mysql_query('INSERT INTO ".$_POST['username']."
(`id`, `name`, `push_ups`, `sit_ups`, `burpees`, `pull_ups`, `body_rows`, `overs`,
`tricep_dips`, `run`, `plank_hold`, `squat_hold`, `thrusters`, `hanging_abs`, `row`,
`weight`, `bi`, `tri`, `s_scap`, `s_illiac`, `arm`, `chest_hip`, `waist`,
`belly_delts`, `thigh`)
VALUES
(NULL, '$dates', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',
'0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')');
?>
";
file_put_contents($my_file, $data);
fclose($handle);
every variable in $data
becomes a blank space in the new file that its written to.
please help, it will be much appreciated. thanks in advance.