Migrasi WP

Migrasi WP

update wp_options set option_value = replace(option_value, ‘http://domainsaya.tld’, ‘http://localhost’);
update wp_posts set post_content = replace(post_content, ‘http://domainsaya.tld’, ‘http://localhost’);
update wp_posts set guid = replace(guid, ‘http://domainsaya.tld’,’http://localhost’);
update wp_links set link_url = replace(link_url, ‘http://domainsaya.tld’, ‘http://localhost’);

Lorem ipsum

Lorem ipsum

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Form dan output dalam satu halaman

Ini formnya:


<form method=“post” action=“”> <!– action kosong karena form proses berada di file yang sama –>


<tr><td>Username</td><td><input type=“text” name=“username” autofocus ></td></tr>

<tr><td>Password</td><td><input type=“password” name=“pass”></td></tr>


<input type=“submit” value=“login” name=“login” />



dan ini kuncinya:


if ($_SERVER[‘REQUEST_METHOD’]==‘POST’) { // magic-nya ada di baris ini

$username = $_POST[‘username’]; // ambil input username

$password = $_POST[‘pass’];  // ambil input password

echo “username anda :”.$username.“<br />password anda :”.$password;


HTML JSON form submission

JSON is commonly used as an exchange format between Web client and backend services. Enabling HTML forms to submit JSON directly simplifies implementation as it enables backend services to operate by accepting a single input format that is what’s more able to encode richer structure than other form encodings (where structure has traditional had to be emulated).

User agents that implement this specification will transmit JSON data from their forms whenever the form’s enctype attribute is set to application/json. During the transition period, user agents that do not support this encoding will fall back to using application/x-www-form-urlencoded. This can be detected on the server side, and the conversion algorithm described in this specification can be used to convert such data to JSON. Read more