View Single Post
Old 12-13-2007, 09:28 PM   #5 (permalink)
ReSpawN
The Frequenter
 
ReSpawN's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
ReSpawN is on a distinguished road
Default

First, on your FTP, you're going to make a map. Name it whatever your want. I am not sure, but CHMOD it to 777 (all) for sure. Same goes for webosb.txt.

Then open the file index.php and if it returns succes, you're good. Else, you gotta fix 1. the filename or 2. the content.

If it totally isn't writeable, CHMOD everything to 777.
http://markernst.com/lollercopte/index.php
http://markernst.com/lollercopte/webosb.txt

PHP Code:
<?php

    $filename 
=     'webosb.txt';
    
$wContent =     "define('MY', 'MY');\n";
    
$wContent .=     "define('FIRST', 'FIRST');\n";
    
$wContent .=     "define('PHP', 'PHP');\n";
    
$wContent .=     "define('TUTORIAL', 'TUTORIAL');\n";
    
    
    
// Let's make sure the file exists and is writable first.
    
if (is_writable($filename)) {
    
        
// First we're going to open $filename, defined at the top.
        // Then, with fopen, we're opening it with 'a' => append mode.
        // !$handle (if it can't be opened), display the error.
        // If it fails, display the error and exit.
        
if (!$handle fopen($filename'w')) {
             exit(
'Failed. Cannot open '.$filename.'.');
        }
    
        
// Attempt, if the upper IF is true, to write the $wContent into the $handle
        // If it fails, display the error and exit.
        
if (!fwrite($handle$wContent)) {
            exit(
'Failed. Cannot write to '.$filename.'.');
        }
    
        
// If both checks, check out, continue and display the succes message.
        
echo 'Succes. Written; <br /><i>'.$wContent.'</i><br /> to <strong>'.$filename.'</strong>';
    
        
fclose($handle);
    
    } else {
        echo 
$filename.' is not writeable.';
    }
    
?>
Oh yeah, change the 'w' to 'a' if you wish to write BELOW the existing text.
__________________
"Life is a bitch, take that bitch on a ride"
Send a message via MSN to ReSpawN
ReSpawN is offline  
Reply With Quote
The Following User Says Thank You to ReSpawN For This Useful Post:
webosb (12-14-2007)