Using PHP in React Server Components
NEXT.JS main.jsx 'use php' ?! You can use it in React Server Components just like this: return ( <button formAction={async () => { 'use php' (new PDO('mysql:host=localhost:3306;dbname=public', 'root', 'root')) ->prepare("INSERT INTO Bookmarks (slug) VALUES (?)") ->execute(array('new')); }} Insert Bookmark </button> )
A surprised elderly man appears beside a Next.js graphic showing the phrase 'use php', followed by a code example of a React Server Component that uses PHP and PDO to insert a bookmark into a database. The joke is that PHP is being used in an unexpected way inside a modern React and Next.js context, creating mock confusion and surprise for web developers. EN: A surprised elderly man appears beside a Next.js graphic showing the phrase 'use php', followed by a code example of a React Server Component that uses PHP and PDO to insert a bookmark into a database. The joke is that PHP is being used in an unexpected way inside a modern React and Next.js context, creating mock confusion and surprise for web developers.
elderly man / пожилой мужчинаglasses / очкиwhite shirt / белая рубашкаblue patterned tie / галстук с синим узоромNext.js logo / логотип Next.jsReact logo / логотип Reactcode editor window / окно редактора кодаmacOS-style window buttons / кнопки окна в стиле macOSquestion mark / вопросительный знакexclamation mark / восклицательный знакcomputer code / компьютерный кодdatabase connection / подключение к базе данныхbookmark insertion / добавление закладкиdark background / тёмный фон
- @ithueti / 10778 2023-11-03
- Type
- image
- Size
- 800×731 · 61.5 KiB
- Mood
- confused, absurd
- Language
- en
- Added