I need to create a php file based on what i get from user input(form)? Tried this but aint working, I have read that if i use the parameter 'a' then it will create one if there isn’t any.... any help would be appreciated...

require_once('../../../includes/config.inc.php');

if(isset($_POST['submit_menu']))
{	
	$title_name = strtolower($_POST['title_name']);
	$language = strtolower($_POST['language']);


$language_name = "INSERT INTO menu_bar (title, lang_name) VALUES('$title_name', '$language')";
$query_language =  mysql_query($language_name);

$dir = '../multiling/content/'.$language."/";
$file = $title_name.'.php';
$path =  $dir.$file;
$file_handle = fopen($path,"a");  
fclose($file_handle);

//echo "<meta http-equiv=\"refresh\" content=\"0;URL=index.php?select=1\">";
}

    Tried this but aint working

    What does that meen? Are you getting any errors? What are they? Do you have permission to write files into the directory?

    Be more specific.

    Seeing how your not actually trying to write anything to the file anyway its probably more efficient to use [man]touch/man instead.

      Write a Reply...