Jump to content


Photo

Never Heard submit form


  • Please log in to reply
6 replies to this topic

#1 johntp

johntp
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 29 August 2006 - 05:53 PM

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 ??
There are only 10 kind of people in the world, those who know binary, and those who don't.

#2 Ifa

Ifa
  • Members
  • PipPipPip
  • Advanced Member
  • 88 posts
  • LocationRauma, Finland

Posted 29 August 2006 - 05:56 PM

mkdir($_POST["dirname"]);
I'm just a guy who likes to code for fun...

#3 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 29 August 2006 - 06:08 PM

It sounds like a potential security nightmare to me.  If you do it, you need to be extraordinarily careful about how you do it.
Legend has it that reading the manual never killed anyone.
My site

#4 johntp

johntp
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 29 August 2006 - 07:13 PM

where do i put the mkdir($_POST["dirname"]); ?
There are only 10 kind of people in the world, those who know binary, and those who don't.

#5 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 29 August 2006 - 07:17 PM

in the script that processes the form inputs and AFTER you check the form inputs.  BE CAREFUL
Legend has it that reading the manual never killed anyone.
My site

#6 perezf

perezf
  • Members
  • PipPipPip
  • Advanced Member
  • 301 posts
  • LocationFort Lauderdale

Posted 29 August 2006 - 11:35 PM

i believe this will work

<?php
$makedirectory = $_POST['dirname'];

mkdir($makedirectory);

?>

oh yea and if you didnt know

replace dirname with the name you give to your textbox

#7 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 30 August 2006 - 02:46 AM

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


<?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>";

}
}
?>



test.php
<?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>


Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users