update page now

Voting

: min(five, seven)?
(Example: nine)

The Note You're Voting On

helmizz at yahoo dot com
11 years ago
This is sample script to use curl, Just input curl_setopt,
exp : 
curlsetop[0] ==> name : CURLOPT_URL ; value : http://amazon.com
curlsetop[1] ==> name : CURLOPT_RETURNTRANSFER ; value : true
curlsetop[2] ==> name : CURLOPT_FOLLOWLOCATION ; value : true

You can add form input.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title> New Document </title>
  <meta name="Generator" content="">
  <meta name="Author" content="Helmi Anwar">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
 </head>

 <body>

 <form method="post" action="">
    <table>
    <tr class="rowid_add">
        <td>curl_setopt [0]</td>
        <td>Name : <input type="text" size="50" name="setopt_name[]"></td>
        <td>Value :<input type="text" size="50" name="setopt_value[]"></td>
    </tr>
    <tr class="rowid_add">
        <td>curl_setopt [0]</td>
        <td>Name : <input type="text" size="50" name="setopt_name[]"></td>
        <td>Value :<input type="text" size="50" name="setopt_value[]"></td>
    </tr>
        <tr class="rowid_add">
        <td>curl_setopt [0]</td>
        <td>Name : <input type="text" size="50" name="setopt_name[]"></td>
        <td>Value :<input type="text" size="50" name="setopt_value[]"></td>
    </tr>
    <tr>
        <td><input type="submit" name="submit_yes" value="EXECUTE"></td>
    </tr>
    </table>
 </form>

 
 <?php

    function curl_test($setopt_content)
    {
        $ch = curl_init();
        curl_setopt_array($ch, $setopt_content);
        $result_data = curl_exec($ch);
        curl_close($ch);
        return $result_data;
    }

if($_REQUEST['submit_yes']=="EXECUTE")
{
    
    foreach ($_REQUEST['setopt_name'] as $k => $index_content) 
    {    
        $value_content=$_REQUEST['setopt_value'][$k];
        $index_content =strtoupper($index_content);
        eval('$index_content = '.$index_content.';');
        //echo ($index_content);
        if($index_content!='')
        {
            if(strtoupper($value_content)=='TRUE')
            {$setopt_content[$index_content]=TRUE;}
            elseif(strtoupper($value_content)=='FALSE')
            {$setopt_content[$index_content]=FALSE;}
            else
            {$setopt_content[$index_content]=$value_content;}
        }
    }

    $info=curl_test($setopt_content);

}

 ?>
 <textarea name="result" rows="25" cols="100"><?php echo htmlspecialchars($info);?></textarea>
 </body>
</html>

<< Back to user notes page

To Top