This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useState } from "react"; | |
| type State = any; | |
| const useForm = (initialstates: State) => { | |
| const [values, setValues] = useState(initialstates); | |
| const handleChange = (e: any) => { | |
| setValues({ | |
| ...values, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE `users`( | |
| `id` INT NOT NULL AUTO_INCREMENT, | |
| `username` VARCHAR(255) NOT NULL, | |
| `email` VARCHAR(100) NOT NULL, | |
| `password` VARCHAR(255) NOT NULL, | |
| `avatar` VARCHAR(255) NOT NULL DEFAULT 'default.png', | |
| `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| `updated_at` TIMESTAMP NULL DEFAULT NULL, | |
| PRIMARY KEY (`id`), | |
| UNIQUE KEY (`username`) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require('express'); | |
| const session = require('express-session'); | |
| const PORT = 3000; | |
| const app = express(); | |
| app.set('port', PORT); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // retrieve data file | |
| $filename = $_FILES['berkas']['name']; | |
| $tempname = $_FILES['berkas']['tmp_name']; | |
| //specify the location of the file to be moved | |
| $dirUpload = "terupload/"; | |
| // move the file |