Log in Register FAQ Memberlist Search Welcome to RCF - WHF Forum Index
alt : test.swf
Welcome to RCF - WHF
4fx3.gif 
calendar_open_closeCalendar 
Another one, NR =]
Post new topic   Reply to topic View previous topic :: View next topic
Welcome to RCF - WHF Forum Index -> Talk PC Add To Bookmarks
Another one, NR =]
PostPosted: 08/27/2007 5:24 PM Reply with quote
Citation
poomerio
Citation
Posts 407
Word Cnt. 10,993
BDay May 28
Sign Gemini
Sex Sex:Male
Joined: Feb 25, 2007
Local time: 2:28 AM
Location: SE England
greatbrE.gif
Hey Nightrider.
Thanks for your help on my other PHP questions. I've been picking it up fast =]

But here's a snag that I hit in my forum installation script.
I've used fwrite() to write th contents of the $towrite variable, yet when I view config.php (th file I want it to write to), it remains empty, but shows a "Modified Date" of when I ran the script.

Code:
<?php

$dbhost = $_POST['dbhost'];
$dbuser = $_POST['dbuser'];
$dbpass = $_POST['dbpass'];
$dbname = $_POST['dbname'];

if ($dbhost=="" or $dbuser=="" or $dbpass=="" or $dbname=="")
{
header('Location: install.php?step_id=3');
}

//Requires header
require("includes/header.php");

  echo "<div id='starter'>
  <div class='border'>
   <div class='block'>
      <div class='bottom'>
  <h3>Step 3: Writing Config.php</h3>
      </div>
      <ol>
Writing to config.php...
        </ol>
        </div>
     </div>
  </div>";

$fq = @fopen("../config.php","w");

$towrite = "$dbhost = $dbhost;
$dbuser = $dbuser;
$dbpass = $dbpass;
$dbname = $dbname;

$connect = mysql_connect($dbhost,$dbuser,$dbpass,$dbname);
if (!$connect)
  {
  die('Could not connect ' . mysql_error());
  }";

@fputs($fp,$towrite);
@fclose($fp);

?>


Being one of the biggest, and most important scripts of the software, I figured that you'd be a great help ^.^

Thanks NR, you're great =]
- Poomie
Back to Top
View user's profile Find all posts by poomerio Send private message   Phoogle Map
 Post new topic  Reply to topic
Information
Welcome to RCF - WHF Forum Index -> Talk PC

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
All times are GMT - 5 Hours

Page 1 of 1


Add To Bookmarks

 
  
  


  Google

Powered by phpBB © 2001, 2005 phpBB Group

Page generation time: 0.0706s (PHP: 57% - SQL: 43%) - SQL queries: 30 - GZIP disabled - Debug on