Jump to content

php file


dezkit

Recommended Posts

is it possible so when i submit an input, it creates a php file in the root.

 

<?php

if(isset($_POST['submit'])) {

// stuff 2 do

}

?>

<form action="<? $_SERVER['PHP_SELF']; ?>" method="post">

<table>

<tr>

<td>File Name:

<td><input type="text" name="file">.php

<tr>

<td colspan=2 align=right><input type="submit" value="submit" name="submit" />

</form>

Link to comment
https://forums.phpfreaks.com/topic/105269-php-file/
Share on other sites

PHP can create files if they don't exists with the fopen fwrite and fclose functions. Read the docs on these functions specifically the various modes fopen accepts. You'll need to make sure the directory you are creating the file in has sufficient write permissions.

Link to comment
https://forums.phpfreaks.com/topic/105269-php-file/#findComment-539485
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.