|
|
|
เซฟรูปไปเก็บที่ไฟล์ฐานข้อมูลไม่ได้ครับ จะเอาไว้เป็นภาพประจำตัวของแต่ละUserครับ |
|
|
|
|
|
|
|
ข้อมูลเข้าหมดยกเว้นรูปภาพน่ะครับ T^T
ขอบคุณครับ
Code
<?
mysql_connect("localhost","root","1234");
mysql_select_db("cgweb");
if(trim($_POST["txtUsername"]) == "")
{
echo "Please input Username!";
exit();
}
if(trim($_POST["txtPassword"]) == "")
{
echo "Please input Password!";
exit();
}
if($_POST["txtPassword"] != $_POST["txtConPassword"])
{
echo "Password not Match!";
exit();
}
if(trim($_POST["txtName"]) == "")
{
echo "Please input Name!";
exit();
}
$strSQL = "SELECT * FROM member WHERE Username = '".trim($_POST['txtUsername'])."' ";
$objQuery = mysql_query($strSQL);
$objResult = mysql_fetch_array($objQuery);
if($objResult)
{
echo "Username already exists!";
}
else
{
$strSQL = "INSERT INTO member (Username,Password,Name,Status,user_img) VALUES ('".$_POST["txtUsername"]."',
'".$_POST["txtPassword"]."','".$_POST["txtName"]."','".$_POST["ddlStatus"]."','".$_POST["files"]."')";
$objQuery = mysql_query($strSQL);
echo "Register Completed!<br>";
echo "<br> Go to <a href='login.php'>Login page</a>";
}
copy($files,$files_name);
$pic_size = filesize($files_name);
$pic_data = addslashes(fread(fopen($files_name,"r"),$pic_size));
$sql = "insert into $tblname(images) values ('$pic_data')";
$dbquery = mysql_db_query($dbname, $sql);
mysql_close();
?>
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2012-02-22 16:00:29 |
By :
chocobeam |
View :
1099 |
Reply :
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณครับ
|
|
|
|
|
Date :
2012-02-22 16:42:20 |
By :
chocobeam |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|