Shaun13 Posted June 7, 2007 Share Posted June 7, 2007 I am creating an install script for people to use my software. Heres the problem: Here is the part of the script we are lookign at: $file1 = fopen("mysql_info.php","w"); echo fwrite($file1," <?php // =========================== // whats my database info? // =========================== $host2=".$host1."; // Host name $username2=".$username1."; // Mysql username $password2=".$password1."; // Mysql password $db_name2=".$database1."; // Database name ?>"); fclose($file1); Ok, heres the problem. It is thinking that $host2, $username2, etc.. are variables I have set, and obviously on mysql_info.php, all I end up with is: <?php // =========================== // whats my database info? // =========================== =somehost; // Host name =someusername; // Mysql username =someonespassword; // Mysql password =someonesdatabasename; // Database name ?> Any Help? ~Shaun Quote Link to comment https://forums.phpfreaks.com/topic/54658-solved-very-quick-question/ Share on other sites More sharing options...
Yesideez Posted June 7, 2007 Share Posted June 7, 2007 You've surrounded the data with double quotes so those variables will show contents and not text - try single quotes instead. (change " for ') Quote Link to comment https://forums.phpfreaks.com/topic/54658-solved-very-quick-question/#findComment-270301 Share on other sites More sharing options...
Yesideez Posted June 7, 2007 Share Posted June 7, 2007 $file1 = fopen("mysql_info.php","w"); echo fwrite($file1,' <?php // =========================== // whats my database info? // =========================== $host2='.$host1.'; // Host name $username2='.$username1.'; // Mysql username $password2='.$password1.'; // Mysql password $db_name2='.$database1.'; // Database name ?>'); fclose($file1); Quote Link to comment https://forums.phpfreaks.com/topic/54658-solved-very-quick-question/#findComment-270303 Share on other sites More sharing options...
per1os Posted June 7, 2007 Share Posted June 7, 2007 $file1 = fopen("mysql_info.php","w"); echo fwrite($file1,' <?php // =========================== // whats my database info? // =========================== $host2='.$host1.'; // Host name $username2='.$username1.'; // Mysql username $password2='.$password1.'; // Mysql password $db_name2='.$database1.'; // Database name ?>'); fclose($file1); Use single quotes, it takes $ as being literal and does not interpret it. Quote Link to comment https://forums.phpfreaks.com/topic/54658-solved-very-quick-question/#findComment-270304 Share on other sites More sharing options...
Shaun13 Posted June 7, 2007 Author Share Posted June 7, 2007 Thanks a ton, it worked! ~Shaun Quote Link to comment https://forums.phpfreaks.com/topic/54658-solved-very-quick-question/#findComment-270309 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.