PHP File Creation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nite4000
Forum Contributor
Posts: 209
Joined: Sun Apr 12, 2009 11:31 am

PHP File Creation

Post by nite4000 »

Hey everyone

I am having a problem here I am editing my install file for my script and I need to create a file with the following :

Code: Select all


$license_key='code';

I have most of the code but having a problem with getting it all to show sometimes just the single quotes will be there other times nothing

Here is what I have

Code: Select all

$filename = file.php
$file_content .= chr(ord("<")) . "?php" . "\r\n";

[b]$file_content .=$license_key = "'".$_POST['license']."'";[/b]


$file_content .=chr(ord("?")) . ">";
  
  $handle = fopen($filename, 'w+');
  if($handle) {
    fwrite($handle, $file_content);
    fclose($handle);
  }

The part in bold is the code i am having the issue with and cant seem to figure it out I need help with this fast as possible.
Post Reply