Hello everyone, I don't know why this has been stumping me but maybe you pro's can help.

I am writing an script install program that writes the config file everything works fine except I cannot get it to write the double quotations I need.

Here is the entry form code:

<td width="150" align="right" class="contentfont">Host Name </td>

  <td class="contentfont"><input name="$HOST" type="text" id="$HOST" value="localhost" size="40" /></td>

Here is the fopen code:

$fp = fopen('../includes/config.php', 'w');



if ($fp)

{

	$content = "<?php \n".

	    " \n".

		"/* Database Host Name */ \n".

		"define(\"HOST\"," . $post_details['$HOST'] . "); \n".

		" \n".

Here is the results in the newly created config file:

<?php 

/* Database Host Name */ 
define("HOST",localhost);

needs to be

<?php

/ Database Host Name /
define("HOST","localhost");

I have tried everything I can think of and searched everything here but still no luck. If anyone has an idea for me I sure would appreciate it.

    Have you tried doing the same thing you did for the quotes around the word HOST? 😉

      "define(\"HOST\",\"" . $post_details['$HOST'] . "\"); \n".
      

        Thanks so much for the replies, I could have sworn I tried that. I guess I had a brain freeze

        "define(\"HOST\",\"" . $post_details['$HOST'] . "\"); \n".

        This took care of it.

        Thanks again for the help, you guys are the greatest

          Glad we could help; don't forget to mark this thread resolved (if it is) using the link on the Thread Tools menu above.

          Also (a bit belated): Welcome to PHPBuilder!

            Write a Reply...