MCPcopy Create free account
hub / github.com/bufferhead-code/nextjs-use-php / Home

Function Home

src/app/page.tsx:3–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import UsePhpClientComponent from "./components/UsePhpClientComponent";
2
3export default function Home() {
4
5 return (
6 <main className="min-h-screen p-24 bg-white">
7 <UsePhpClientComponent></UsePhpClientComponent>
8 <form>
9 <button
10 className="rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
11 formAction={async () => {
12 'use php'
13 $pdo = new PDO('mysql:host=localhost:33066;dbname=public', 'root', 'root');
14
15 $statement = $pdo->prepare("INSERT INTO Bookmarks (slug) VALUES (?)");
16 $statement->execute(array('new'));
17 }}>
18 Insert Bookmark
19 </button>
20 </form>
21
22 </main>
23 )
24}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected