0

i want to use curl to some site. But the site is required a hidden form. Form HTML is like this:

<form method="get" name="login" action="example.com/procced.php">
    <input id="username" type="text" name="username" placeholder="Your email address" required /><br/>
    <input id="password" type="password" name="password" placeholder="Password" required />
    <input type="text" name="request_token" id="request_token" value="5433db648b28c3aaffcf63e650541c37aaa34614" style="display: none"/>
    <input type="submit" id="submit" value="Log in" />
</form>

how i curl php with that hidden form (name="requrest_token")

devpro
  • 16,184
  • 3
  • 27
  • 38
Japar S
  • 77
  • 2
  • 10

1 Answers1

0

Try to use this:

$url = "otherwebsiterul";  // url where you want to access 
$data = $_POST; // your form data as you want to pass.
$handle = curl_init($url);
curl_setopt($handle, CURLOPT_POST, true);
curl_setopt($handle, CURLOPT_POSTFIELDS, $data);
curl_exec($handle);
devpro
  • 16,184
  • 3
  • 27
  • 38