Jump to content

Never Heard submit form


johntp

Recommended Posts

Hey guys I was wondering if somwhere out there, there is a way to make a dubmit from make a folder on the website.

A little more detail is somone puts their name in a stardard html box, and when they hit submit it will make a folder with that name they put in the box on it.

I know this sounds really odd but can it be done ??
Link to comment
https://forums.phpfreaks.com/topic/19045-never-heard-submit-form/
Share on other sites

Here you go i had fun putting this together this will make a directory with the users id as the directory name ,



The user will enter there register email address and then a directory will be made with there id.


good luck.

tested

[code]

<?php session_start();

$id='00000';

$id=$_POST['id'];
$dir=$_POST['dir'];
$email=$_POST['email'];


$db=mysql_connect("localhost","xxxxx","xxxxx");

$result=mysql_select_db("xxxx",$db)or die("sorry mysql problams");

$query="select * from members where id='$id'";

$result=mysql_query($query);

while($record=mysql_fetch_assoc($result)){

$name=($_POST['name']);

$name=$record['name'];


if(mysql_num_rows($result)){

mkdir($id);



echo "<html>

<head></head>

<title>directory been made</title>


<body bgcolor='blue'>


<table  align='center' bordercolor='black' border='4'>


<td align='center'>

Thank you $name directory made

</td>


</table></html></body>";

}
}
?>

[/code]


test.php
[code]
<?php session_start();

$id=$_POST['id'];
$dir=$_POST['dir'];
$email=$_POST['email'];

$id='00000';

$dir=$id;

if(is_dir($dir)){

echo "<html>

<head></head>

<title>makeing a directory</title>


<body bgcolor='blue'>


<table  align='center' bordercolor='black' border='4'>


<td align='center'>

sorry but you already got a directory

</td>


</table>";


exit;

}


?>

<html>
<head></head>

<title>makeing a directory</title>

<body bgcolor='blue'>

<div align='center'><h1><?php echo $user; ?> activate your user directory please</h1></div>

<br>
<br>

<table  align='center' bordercolor='black' border='4'>

<td align='center'>

<br>

<b><font color='red' > Plase activate your directory</font></b>

<br>
<br>

<b><font color='red'>Please enter you email address as entered when you join our website</font><b>

<br>
<br>

<form method="POST" action="test_result.php">

<input type="text" name="email">

<br>
<br>
<br>

<input type="submit" name="submit" value="Make my new usable directory">

<br>
<br>
<br>

</form>

</td>

</table>

</html>

</body>

[/code]

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.