thaiall logomy background
coding : board. boardadd.pl.
my town
Source : Perl | PHP | ASP | JSP | HTML | HTML5 | JavaScript | Java | COBOL | C++ | MS Access | VBNet | VB | Python | โค้ดดี
File : boardadd.pl. ID : 0804
Skin : Default | Sons-of-obsidian | Sunburst | Highlighter | Full
#!/usr/bin/perl
require 'parse.pl';
&parse_form;
print "Content-type:text/html\n\n";   
&checklength;
print'<body>';
if ($v{'email'} =~ /.*\@.*\..*/) { 
  if (!$v{'subj'}) { &breakerror('ไม่ได้กรอกหัวเรื่อง'); }
} else {
  &breakerror('ไม่ได้กรอก E-Mail หรือกรอกผิดพลาด');
}
$filename="number.dat";
open(myfile,"$filename");
@rm = <myfile>;
close(myfile);
if (!@rm) { 
  $number=1000000001999; 
} else { 
  $number=substr($rm[0],0,10);
  $number=$number+1; 
  $number=join '',$number,'999';
}
open(myfile,">$filename");
print myfile $number;
close(myfile);
$title = join ':',$number,$v{'subj'},$v{'email'},$v{'icq'},$v{'answer'},$ENV{REMOTE_ADDR};
$filename = join '.',$number,'txt';
open(myfile,">$filename");
print myfile "$title\n";  
print myfile "$v{'message'}";  
close(myfile);
print "$title<br>Add new message : OK";
# mail process
$mailprog = '/var/qmail/bin/qmail-inject';
open (MAIL, "|$mailprog") || die "Can't open $mailprog!\n";    
print MAIL "To: $v{'email'},$ars[2]\n";
print MAIL "From: perlphpasp\@thaiabc.com \n";  
print MAIL "Subject: You use this email add the content to board\n\n";
print MAIL "Just Inform from http://perlphpaspbook.hypermart.net\n ";
print MAIL "You will get the message if someone reply your content.\n";
print MAIL "If you are not ok, you can delete the content by yourself.\n";
print MAIL "$v{'message'}\n";
close (MAIL);
จำนวน : 43 บรรทัด
าษาเฮชทีเอ็มแอล (HTML = HyperText Markup Language) คือ ภาษาคอมพิวเตอร์ที่ออกแบบมาเพื่อใช้ในการสร้างเว็บเพจที่เรียกดูผ่านทางเว็บเบราว์เซอร์ (Web Browser) เริ่มพัฒนาโดย ทิม เบอร์เนอรส์ ลี (Tim Berners Lee) ในปัจจุบัน HTML ล่าสุดคือ รุ่น 5 เป็นมาตรฐานหนึ่งของ ISO ซึ่งจัดการโดย World Wide Web Consortium (W3C) ในปัจจุบัน ทาง W3C ผลักดัน รูปแบบของ HTML แบบใหม่ ที่เรียกว่า XHTML รุ่นแรกคือ 1.0 (ม.ค.2543) ซึ่งมีโครงสร้างเป็นแบบ XML (eXtensible Markup Language)
าษาพีเอชพี (PHP Language) คือ ภาษาคอมพิวเตอร์ประเภทโอเพนท์ซอร์ท (Open Source Computer Language) สำหรับพัฒนาเว็บเพจแบบไดนามิก เมื่อเครื่องบริการได้รับคำร้องจากผู้ใช้ก็จะส่งให้กับ ตัวแปลภาษา ทำหน้าที่ประมวลผลและส่งข้อมูลกลับไปยังเครื่องของผู้ใช้ที่ร้องขอ ในรูปเอชทีเอ็มแอล ภาพ หรือแฟ้มดิจิทอลอื่นใด ลักษณะของภาษามีรากฐานคำสั่งมาจากภาษาซี เป็นภาษาที่สามารถพัฒนาให้ใช้งานแบบโต้ตอบกับผู้ใช้ได้
ตัวอย่าง Hello World
ปรับปรุงโปรแกรม source.pl : 2565-07-24
rspsocial
Thaiall.com