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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.