<form method="post" action="/index.php"> <div> <label>Email address</label> <input type="email" name="email" placeholder="Enter email"> </div> <div> <label>Password</label> <input type="password" name="password" placeholder="Password"> </div> <div> <input type="checkbox" name="check"> Check me out </div> <div> <button type="submit" name="submit">Submit</button> <div> </form>
<?php if (isset($_POST['submit'])) { $ch = curl_init('https://домен.ru/inbox.php'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($_POST, '', '&')); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_HEADER, false); $html = curl_exec($ch); curl_close($ch); echo $html; }