Twitter (ทวิตเตอร์) คือ เครือข่ายสังคมออนไลน์ ที่เน้นความเรียบง่ายและรวดเร็ว โดยผู้ใช้สามารถส่งข้อความยาวไม่เกิน 280 ตัวอักษร ว่าตนเองกำลังทำอะไรอยู่ ได้มีการเปิดให้ใช้งานการส่งทวีตได้ทั้งระบะ iOS บน iPhone และ Smartphone สัญลักษณ์ของทวิตเตอร์ คือ นกสีฟ้า
โดยบทความนี้จะกล่าวถึงการทำปุ่มแชร์ไปบน Twitter (ทวิตเตอร์) โดยใช้การเขียนโค้ด PHP และ CSS ไปแสดงบน WebSite (เว็บไซต์) ของเราเอง
ตัวอย่างโค้ด
<div class="btn-n navbar-right" data-scribe="component:button" style="width: 65px;">
<a href="https://twitter.com/intent/tweet?original_referer=<?php echo $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>" class="btn-b" id="b"><i></i>
<span style="padding: 0px 0px 0px;" class="label" id="l">ทวีต</span>
</a>
</div>
<style>
.btn-n {
position: relative;
height: 20px;
box-sizing: border-box;
padding: 1px 8px 1px 6px;
background-color: #1b95e0;
color: #fff;
border-radius: 3px;
font-weight: 500;
cursor: pointer;
}
.btn-b i {
position: relative;
top: 2px;
display: inline-block;
width: 14px;
height: 14px;
background: transparent 0 0 no-repeat;
}
</style>
ผลลัพธ์
ผลลัพธ์
ข่าวสารเพิ่มเติมเกี่ยวกับ PHP