Jump to content

need code fix


morfin91

Recommended Posts

im traing to get my code to work but it don't work to 100%

the code create a folder and sall create a .html file with in it.

the problem is that the file are not created in the folder.

i need help to fix it.

one other problem is that the file dont get right name it shood get the name from $pass but it get's acc_namn$pass?

 

 

my code is.

<?php
 print_r ($_POST);
$acc_namn = $_POST['accNamn'];
$pass = $_POST['pass'];
$at = "C:/www/Poj/acc/";
$var = "C:/www/Poj/acc/"."acc_namn";

$folder = $acc_namn;
if ( !file_exists($folder)){	mkdir($folder, 770);	}

$file = $var.$pass.'.html';
// Open the file to get existing content
$current = file_get_contents($file);
// Append a new person to the file
$current .= "John Smith\n";
// Write the contents back to the file
file_put_contents($file, $current);


?>

 

Link to comment
https://forums.phpfreaks.com/topic/159745-need-code-fix/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.