|
 |
|
รบกวนด้วยคะ ส่งค่า form ไปอีกหน้าไม่ได้ ช่วยดูให้หน่อยนะคะ |
|
 |
|
|
 |
 |
|
<form id="form1" name="form1" method="post" action="jobs.php" enctype="multipart/form-data">
^
^
หน้าส่งค่า ถูกต้องมั้ยคะ
------------------
Code (PHP)
<?php
$code = $_POST[code];
$rand1 = $_POST[rand1];
$rand2 = $_POST[rand2];
$name = $_POST[name];
$surname = $_POST[surname];
$position = $_POST[position];
$age = $_POST[age];
$address = $_POST[address];
$tel = $_POST[tel];
$fileupload = $_FILES['fileupload']['tmp_name'];
$fileupload_name=$_FILES['fileupload']['name'];
$fileupload_size=$_FILES['fileupload']['size'];
$fileupload_type=$_FILES['fileupload']['type'];
echo"$name ";
echo"$surname ";
echo"$position";
echo"$age";
echo"$address";
echo"$tel";
echo"$fileupload";
if( $name == " " or $surname == " " or $position ==" " or $age ==" " or $address ==" " or $tel ==" " or $fileupload ==" ")
{
echo "กรุณากรอกข้อมูลให้ครบ ^ ^ <br><br>
<a href='javascript:history.back();' ><img src='images/back.gif' align='top' border='0' ></a> <span class='style10'>ย้อนกลับ</span><br><br>";
exit();
}
$yokky = $rand1 + $rand2 ;
if($code == $yokky)
{
$date_today = date("Y-m-d");
$time_today = date("H:i:s");
include('connect_song.php');
$sql = "INSERT INTO $tb_name4 VALUES (null,'$name','$surname','$position','$age','$address','tel',' ','$date_today','$time_today','$show','$one','$two')";
$result = mysql_db_query($dbname,$sql);
if($fileupload)
{
$array_last = explode(".",$fileupload_name);
$c = count($array_last) -1;
$lastname=strtolower($array_last[$c]);
if($lastname == "doc" or $lastname == "pdf")
{
$sql2 = "SELECT max(id) FROM $tb_name4";
$result2 = mysql_db_query($dbname,$sql2);
$row = mysql_fetch_row($result2);
$jobsname = $row[0].".".$lastname;
copy($fileupload,"jobs/".$jobsname);
$sql3 = "UPDATE $tb_name4 SET fileupload ='$jobsname' WHERE id ='$row[0]' ";
$result3 = mysql_db_query($dbname,$sql3);
}//ใช่ pdf + doc
else
{
echo "นามสกุลไฟล์ doc และ pdf เท่านั้น ^ ^ <br><br>
<a href='javascript:history.back();' ><img src='images/back.gif' align='top' border='0' ></a> <span class='style10'>ย้อนกลับ</span><br><br>";
exit();
}// pdf + doc เท่านั้น
}
$sql3 = "SELECT * FROM $tb_name4 WHERE id = $row[0] " ;
$result3 = mysql_db_query($dbname,$sql3);
$row3 = mysql_fetch_array($result3);
$name = $row3[1];
$surname = $row3[2];
echo "คุณ $name $surname <br>ได้ เรียบร้อยแล้วคะ .. ";
/*echo "<meta HTTP-EQUIV='Refresh' CONTENT='5; URL=index.php'>";*/
}
else
{
echo "บวกเลข ไม่ถูกต้องคะ ^_____^ <br><br>
<a href='javascript:history.back();' ><img src='images/back.gif' align='top' border='0' ></a> <span class='style10'>ย้อนกลับ</span><br><br>";
exit();
}
mysql_close();
?>
รบกวนด้วยคะ มือใหม่
1.ตอนนี้ ไม่สาสมารถเช็คค่าว่างได้คะ .. งง งง คะ
2.อยากให้ ตรง echo "คุณ $name $surname <br>ได้สมัครงานกับ Krotron รียบร้อยแล้วคะ .. "; <--- สามารถแสดงชื่อคนกรอกข้อมูลได้ด้วยคะ
Tag : PHP, MySQL

|
ประวัติการแก้ไข 2011-01-28 14:41:10 2011-01-28 14:46:13 2011-01-28 14:52:33
|
 |
 |
 |
 |
Date :
2011-01-28 14:17:48 |
By :
YOK_A_DI |
View :
1036 |
Reply :
8 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้าหมายถึง การตรวจสอบ ที่ if
ค่าที่คุณ เช็ค มานมะช่ายค่าว่าง ป่าว
"" กับ " "
มือใหม้่หัด ตอบ
|
 |
 |
 |
 |
Date :
2011-01-28 14:53:02 |
By :
birdbird27 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณ คุณ BirdBaan มากคะ ทำตามได้คะ ความรู้ใหม่เลยคะ
|
ประวัติการแก้ไข 2011-01-28 15:05:34
 |
 |
 |
 |
Date :
2011-01-28 15:00:38 |
By :
YOK_A_DI |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
if( $name == "" or $surname == "" or $position =="" or $age =="" or $address =="" or $tel =="" or $fileupload =="")
|
 |
 |
 |
 |
Date :
2011-01-28 15:03:20 |
By :
birdbird27 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
รบกวนอีกนิดนะคะ
พออัพโหลดไฟล์ไปแล้ว เป็นนามสกุล doc
แต่ว่าพอเปิดดูในโฟลเดอร์ที่เราเก็บ ข้อมูลที่อัพโหลดมา
มันกลายเป็น rar คะ ... จะต้องแก้ยังไงคะ
|
 |
 |
 |
 |
Date :
2011-01-28 15:15:12 |
By :
YOK_A_DI |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
.docx ป่าวคับ
|
 |
 |
 |
 |
Date :
2011-01-28 15:18:24 |
By :
birdbird27 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
docx ใช่คะ แต่เราแก้ในการเช็ครับค่า ให้รับ doc pdf docx แล้วคะ
รบกวนด้วยคะ
|
 |
 |
 |
 |
Date :
2011-01-28 15:19:14 |
By :
YOK_A_DI |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผม เคยเป็นนะคับ ปัญหา นี้
แต่ ผมลง apserv ตัวใหม่ ก้อไม่เป็น อีก ไม่รู้ ว่าเพราะอะไรเหมือนกัน
แต่เจอกระทู้นี้ คับ ความ คิดเห็นที่ 4 แต่ ผมไม่แน่ใจนะคับ ว่าใช่ป่าว
เพราะ ผม ก้อเคยเป็น แต่ตอนนั้น ผมแก้ไม่ได้ เลย ห้าม อัพ .docx แต่ตอนนี้ มานอัพได้เฉย
http://webcache.googleusercontent.com/search?q=cache:Ni4BwXil3aIJ:www.thaicreate.com/php/forum/043594.html+upload+docx+%E0%B9%80%E0%B8%9B%E0%B9%87%E0%B8%99+zip&cd=1&hl=th&ct=clnk&gl=th&source=www.google.co.th
|
ประวัติการแก้ไข 2011-01-28 15:30:39
 |
 |
 |
 |
Date :
2011-01-28 15:28:13 |
By :
birdbird27 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แก้ปัญหา ได้แล้วคะ ... ใส่เพิ่มคะ
AddType application/vnd.ms-word.document.macroEnabled.12 .docm
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
AddType application/vnd.ms-powerpoint.template.macroEnabled.12 potm
AddType application/vnd.openxmlformats-officedocument.presentationml.template potx
AddType application/vnd.ms-powerpoint.addin.macroEnabled.12 ppam
AddType application/vnd.ms-powerpoint.slideshow.macroEnabled.12 ppsm
AddType application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
AddType application/vnd.ms-powerpoint.presentation.macroEnabled.12 pptm
AddType application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
AddType application/vnd.ms-excel.addin.macroEnabled.12 xlam
AddType application/vnd.ms-excel.sheet.binary.macroEnabled.12 xlsb
AddType application/vnd.ms-excel.sheet.macroEnabled.12 xlsm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
AddType application/vnd.ms-excel.template.macroEnabled.12 xltm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx
|
 |
 |
 |
 |
Date :
2011-01-28 16:02:18 |
By :
YOK_A_DI |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|