Help with writing "$" with fopen


Posted on 16th Feb 2014 07:03 pm by admin

I just can't get my syntax correct. Could someone help me please? I am trying to write a connect file for inclusion as part of the installation routine for an app I am working on. I need this line to be:

$hostname="whatever the use typed on the previous page";

Did you know?Explore Trending and Topic pages for more stories like this.
Here is the code I am attempting to use:

Code: $dir="../includes2/";
$file="connect.inc";
$handle=fopen($dir.$file,'w');
$data="<?phpn";
fwrite($handle,$data);
$data="$hostName ='" . $loc . "'; ";
fwrite($handle,$data);
fclose($handle);
echo "Check and see if it worked."
?>The line in question is :
$data="$hostName ='" . $loc . "'; ";
So far, I have only been successful at getting the following end result:

Code: <?php
='localhost'; What escape characters do I need to use to "$" without php looking for a variable value?

Thanks for the help
No comments posted yet

Your Answer:

Login to answer
304 Like 21 Dislike
Previous forums Next forums
Other forums

Working with Global Variables
hi, I'm not really sure why the following code is returning a "Call to a member function getBan

Bar charts using Graphical Framework.
I am using Graphical Frameworks(GFW) to create a chart Graphic . There is no problem with the data d

Problems with strings containing
Hey all,

I have encountered something strange in a script. I am trying to write an XML heade

SESSION question
I am building an application , a directory for auctions.
For SEO i made a script which copies a p

How do I use ValidatorCallout extender in Login control?
Hi,I'd like to customize the look and feel of the login control a little bit. One thing I'd love to

how to remove in php string display
My code is

$message="We're looking at developing our website.";

$body= "

Downloading file (Headers)
I'm trying to make users download a file, but they must wait 60 seconds before it begins.

But

Need help making a script that moves data into acrhive table
Hi,

I'm kinda new to php/mysql

And i wrote a simple script to store sales lead for a b

quick question about System Change Number(SCN) in FlashBack Query topic
i know tht we can get the SCN of the database using flashback concept as follows

SQL>

function not returning the correct value
I have a program that needs to return a value from a function. I have an output statement inside the

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash