/    Sign up×
Community /Pin to ProfileBookmark

Little Installer

Since the last time I asked a question about this, I’ve read a lot of php chapters and was able to basicly figure out how to make an installer. One little problem though,
when ran, I get a parse error on line 10, which is the line that opens config.php to open up to write. The line is as following:

[code=php]$fp = fopen($file, “w”) or die (“Couldn’t Open a required file, $file.”);[/code]

in this case, $file is config.php.
Thanks to anyone who can help.
p.s:
just in case, heres the rest of the file:

[code=php]<?php
$file = “config.php”;
$db = “POST_[database]”;
$dbuser = “POST_[databaseuser]”;
$dbpassword = “POST_[databasepassword]”;
$dbhost = “POST_[databasehost]”;
$apass = “POST_[adminpassword]”;
$auser = “POST_[adminusername]”;
$fp = fopen($file, “w”) or die (“Couldn’t Open a required file, $file.”);
fwrite($fp, “$conn = mysql_connect(“$dbhost”, “$dbuser”, “$dbpassword”));
fwrite($fp, “or die(mysql_error());”);
fwrite($fp, “mysql_select_db(“$db”, $conn) or die(mysql_error());”);
fwrite($fp, “$adminuser = “$auser”;);
fwrite($fp, “$adminpass = “$apass”;);
fclose($fp);
?>[/code]

Thanks again ?

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@pyroJan 14.2004 — Got more than one error with that. ?

Try this one out.

[code=php]<?php
$file = "config.php";
$db = $_POST['database'];
$dbuser = $_POST['databaseuser'];
$dbpassword = $_POST['databasepassword'];
$dbhost = $_POST['databasehost'];
$apass = $_POST['adminpassword'];
$auser = $_POST['adminusername'];
$fp = fopen($file, "w") or die ("Couldn't Open a required file, $file.");
fwrite($fp, '$conn = mysql_connect('.$dbhost.', '.$dbuser.', '.$dbpassword.')');
fwrite($fp, 'or die(mysql_error());');
fwrite($fp, 'mysql_select_db('.$db.', $conn) or die(mysql_error());');
fwrite($fp, '$adminuser = '.$auser.';)';
fwrite($fp, '$adminpass = '.$apass.';)';
fclose($fp);
?>[/code]
Copy linkTweet thisAlerts:
@gnomepowerauthorJan 14.2004 — TY ? let me try that right now....
×

Success!

Help @gnomepower spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...