Making a subdirectory php help
yourpages/hometutor making the full path http://godsbusinessway.com/yourpages/.$var
Here's the code I found which will also write to the generated folder
<?php
// change the name below for the folder you want
$dir = "yourpages";
$file_to_write = 'test.txt';
$content_to_write = "The content";
if( is_dir($dir) === false )
{
mkdir($dir);
}
$file = fopen($dir . '/' . $file_to_write,"w");
// a different way to write content into
// fwrite($file,"Hello World.");
fwrite($file, $content_to_write);
// closes the file
fclose($file);
// this will show the created file from the created folder on screen
include $dir . '/' . $file_to_write;
?>
Thanks,
Rick
-
KirkMcD -
[ 1 ] Thanks
{{ DiscussionBoard.errors[10166286].message }} -
-
hometutor -
Thanks
SignatureVideo - How Local Businesses Benefit from Monetized On-Topic Breaking News Releases Linking Back to Their Websites{{ DiscussionBoard.errors[10168137].message }} -
-
KirkMcD -
Thanks - 1 reply
{{ DiscussionBoard.errors[10168175].message }}-
hometutor -
Thanks - 1 reply
SignatureVideo - How Local Businesses Benefit from Monetized On-Topic Breaking News Releases Linking Back to Their Websites{{ DiscussionBoard.errors[10168465].message }}-
KirkMcD -
[ 1 ] Thanks - 1 reply
{{ DiscussionBoard.errors[10169426].message }}-
hometutor -
Thanks
SignatureVideo - How Local Businesses Benefit from Monetized On-Topic Breaking News Releases Linking Back to Their Websites{{ DiscussionBoard.errors[10169913].message }} -
-
-
-