Help 4 a noob Pls
Posted: Tue Jan 12, 2010 5:25 pm
Hi everyone
This is my first post on a forum ever so let me know if im doing something wrong...
Having trouble with a php form. I want to use a form to insert data into a mysql database with 3 rows, username, password & url, so I have three field boxes. The problem is I also want a folder created on my server with the same name as one of the fields. Heres my code so far...
<?php
$con = mysql_connect("localhost","user","pass");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("test", $con);
$sql="INSERT INTO dbase (username, password, address)
VALUES
('$_POST[username]','$_POST[password]','$_POST[address]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
$ftpstream = @ftp_connect('localhost');
$login = @ftp_login($ftpstream, 'ftpuser', 'pass');
if($login) {@ftp_mkdir($ftpstream, '/public_html/clients/ THIS BIT I CANT GET TO WORK');
}
ftp_close($ftpstream);
echo "record added";
mysql_close($con)
?>
Any help would be greatly appreciated!
Thanks
This is my first post on a forum ever so let me know if im doing something wrong...
Having trouble with a php form. I want to use a form to insert data into a mysql database with 3 rows, username, password & url, so I have three field boxes. The problem is I also want a folder created on my server with the same name as one of the fields. Heres my code so far...
<?php
$con = mysql_connect("localhost","user","pass");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("test", $con);
$sql="INSERT INTO dbase (username, password, address)
VALUES
('$_POST[username]','$_POST[password]','$_POST[address]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
$ftpstream = @ftp_connect('localhost');
$login = @ftp_login($ftpstream, 'ftpuser', 'pass');
if($login) {@ftp_mkdir($ftpstream, '/public_html/clients/ THIS BIT I CANT GET TO WORK');
}
ftp_close($ftpstream);
echo "record added";
mysql_close($con)
?>
Any help would be greatly appreciated!
Thanks