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

add to sql result
ok see rite now my sites hit counter is counted from the mysql visitor log i need to clear it aft

Not "Just Another" MMORPG - text based.
Hello,

I've been learning MySQL and PHP for the last 2-3 years.
Though, I've had long paus

for some reason mysql query not working, not inserting, please check it out
This code is not inserting anything into my db, don't know why, the $_SESSION variable does contain

cPanel API
Hi Guys,

Need a little guidance. I'm trying to get my script to communicate with cPanel (or W

Sales orders ans reservations not taken into account on MPS / MRP
Hello,

I am implementing the MPS / MRP and I have the following problem:

I ha

Users and Groups with PHP Classes
Hi,

I have setup what I hope to be a good working User class. Now I want to introduce group m

Problem in OnClientClick and OnClick sync
Hi,Strange and irritating problem: I have below button declaration in markup of the aspx page:

How to pass parameter to tag query?
Hi,
I want to get the value of a tag at a specific time (like 10/27/09 15:29:59), I need to giv

Disable Scrollbar in TableControl
Hello everbody,

please can anybody help me - outherwise i'm going to become desperate :P<

socket makes browser hang...
I have a socket server, and I am having a problem at the moment...

A browser sends a http hea

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