I am required to change ip adress everytime this function gets executed I am trying this code below .But I am completly confused.How can I do this

function getData($domainName, $ext)
{
    $proxy = array(
        1 => array(
            '88.255.101.247',
            '8080'
        ),

        2 => array(
            '176.53.2.122',
            '8080'
        ),

        3 => array(
            '37.123.96.237',
            '8080'
        )

    );

    shuffle($proxy);

    $servers = array(
        "biz" => "whois.neulevel.biz",
        "com" => "whois.internic.net",
        "us" => "whois.nic.us",
        "info" => "whois.nic.info",
        "name" => "whois.nic.name",
        "net" => "whois.internic.net",
        "tv" => "whois.nic.tv",
        "ru" => "whois.ripn.net",
        "org" => "whois.pir.org",

        "com.tr" => "whois.nic.tr",
        "gen.tr" => "whois.nic.tr",
        "web.tr" => "whois.nic.tr",
        "k12.tr" => "whois.nic.tr",
        "org.tr" => "whois.nic.tr"
    );
    $serverName = trim($servers[$ext]);
    $fullName = $domainName . "." . $ext;

    $curl=curl_init();
    curl_setopt($curl, CURLOPT_URL, $serverName);
    curl_setopt($curl, CURLOPT_PORT, 43);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_TIMEOUT, 5);
    curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $fullName . "\r\n");
    curl_setopt($curl, CURLOPT_PROXY, $proxy[0][0]);
    curl_setopt($curl, CURLOPT_PROXYPORT, $proxy[0][1]);

    curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
    $result = curl_exec($curl);
    curl_close($curl);

    print_r($result);

  }

  $veri = getData( "google", "com");

  echo htmlspecialchars($veri);

I have been working for hours to get this works the problem is that when I first execute this code everything is ok but second time nothing displays. Then I realized that if I wait 20-25 seconds gets executed again I am using this way

whois("google","web.tr")

I dont get any problem the other extensions(com,net) so on

 function whois($domainName, $ext)
 {
 $servers = array(
    "biz" => "whois.neulevel.biz",
    "com" => "whois.internic.net",    
    "com.tr" => "whois.nic.tr",
    "gen.tr" => "whois.nic.tr",
    "web.tr" => "whois.nic.tr",
    "k12.tr" => "whois.nic.tr",
    "org.tr" => "whois.nic.tr"
  );
$serverName = trim($servers[$ext]);
$tamAd=$domainName.".".$ext;
$whois = array();

$output = "";
if (function_exists('curl_version')) {
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $serverName);
    curl_setopt($curl, CURLOPT_PORT, 43);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_TIMEOUT, 5);
    curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $tamAd. "\r\n");
    $result = curl_exec($curl);
    curl_close($curl);
    print_r($result);
   } 
 }
       whois("google","web.tr");

What should I do .I dont understand why "web.tr" doesnt work properly.The other works great Any idea plase

I am required to pass a parametre to jquery post and then get it using $_POST method .But it doesnt work this way.I cant display on the page

<!doctype html>

Document Tıkla $(document).ready(function(){ $('#tikla').click(function () { $.post( "xx.php", {"isim": "tayfun"}) .done(function(data){ }); }) })

I am required to download different type of files from a spesicif folder using ajax .The problem is that when execute the code I get this message this I have looked for the similar tutorials I coundnt find a solution Could you please help

This my index.php file

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div class="table-responsive">
<div id="data"></div>
</div>
</body>
</html>

<script>
$(function(){
    fetchData();

    function fetchData(){
    $.ajax({
        url:"ajax.php",
        method:"post",
        success:function(data){
        $('#data').html(data);
        }
    })
    }

    $(document).on('click','.download',function(e){
        e.preventDefault();
var fileName=$(this).attr("id");
    $.ajax({
            url:"download.php",
            method:"post",
            data:{fileName:fileName},
            success:function(e){
                alert(e);
            }
        })

    });
})

this my ajax.php file that I am using populate the file Information table (like names, and download Count)

<?php

$handleDir = opendir($directory) or die('error');
$fileName = array();
$count = (count(scandir($directory)) - 2);
$output .= '<table class="table table-bordered">
<th width="20%">File Name</th>
<th width="10%">Download Count</th>
';
if ($count) {
    while ($file = readdir($handleDir)) {
        if ($file == '.' || $file == '..') {
            continue;
        }

        $fileName[] = $file;
    }

    $query = 'select * from download_manager order by  id desc';
    $fileInfo = array();
    $result = mysqli_query($link, $query);
    if (mysqli_num_rows($result)) {
        while ($singleFile = mysqli_fetch_array($result)) {
            $fileInfo[$singleFile['filename']] = $singleFile['downloads'];
        }
    }

    foreach ($fileName as $key => $value) {
        $output .= '<tr><td >
        <span class="download" id="'.$value.'">'.$value.'</span>
       </td>
       <td>'.$fileInfo[$value].'</td>
       </tr>';
    }
} 

$output .= '</table>';
echo $output;

?>

And this is my download php file error occurs in here

if (isset($_POST['fileName'])) {
    $fileName = $_POST['fileName'];

    if (file_exists($directory.'/'.$fileName)) {
        header('Content-Description: File Transfer');
        header('Content-Type: application/octet-stream');
        header('Content-Disposition: attachment; filename='.$directory.'/'.$fileName);
        header('Content-Length: '.filesize($directory.'/'.$fileName));
        ob_clean();
        flush();
        readfile($directory.'/'.$fileName);
        echo 'ok';
        exit;
    } else {
        echo ...

I have a table called download_manager .It has two columns filename and downloads .What I want to do is to get file name and its download count and display them inside ul element.
I am able to get file names but I cant display the download count I'm getting undefined index error.This is my code

    <?php
    $handle = opendir($directory) or die('Error');
    $files = array();
    while ($file = readdir($handle)) {
        if ($file[0] == '.') {
            continue;
        }
        $files[] = $file;
    }
    sort($files, SORT_STRING);

    $query = 'select * from download_manager';
    $data = mysqli_query($link, $query);
    $fileInfo[] = array();
    if (mysqli_num_rows($data)) {
        while ($singleFile = mysqli_fetch_array($data)) {
            $fileInfo[$singleFile['filename']] = $singleFile['downloads'];
        }
    }

    ?> <!DOCTYPE html> <html> <head> </head> <body> <ul> <?php

    foreach ($files as $key => $value) {
         echo '<li><a href="download.php?file='.urlencode($value).'">'.$value.'</a> <span>'.$fileInfo[$value].'</span> ';
    }

    ?> </ul> </body> </html>

why would you do something like that in the first place?

thats simple practising

if you don't set that icon, the application runs as should? then don't change the icon

the point is not that application runs as should .how can i make progress this way.. when you hit an abstacle nevermind leave it .is that what you mean

hi everybody i am trying to update db using gridview but all attempts end up with failure i dont get execptions just nothing happens when i push update button

<asp:GridView ID="ResultGridView" runat="server" AutoGenerateColumns="False" ShowFooter="True"
    DataKeyNames="VendorId" 
    AllowPaging="True" 
    CellPadding="3" 
    OnPageIndexChanging="ResultGridView_PageIndexChanging" 
    OnRowDeleting="ResultGridView_RowDeleting" 
    OnRowEditing="ResultGridView_RowEditing" 
        OnRowUpdating="ResultGridView_RowUpdating" 
        OnRowCancelingEdit="ResultGridView_RowCancelingEdit" PageSize="5" 
        BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" 
        CellSpacing="2" OnRowCommand="ResultGridView_RowCommand" 
    >
        <Columns>
            <asp:TemplateField HeaderText="FirstName" SortExpression="VendorFName">
                <EditItemTemplate>
                    <asp:TextBox ID="txtFName" Width="100px" runat="server" Text='<%# Bind("VendorFName") %>'></asp:TextBox>
                </EditItemTemplate>
                <FooterTemplate>
                <asp:TextBox ID="txtFName1" runat="server"  Width="100px"></asp:TextBox> 
                </FooterTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("VendorFName") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="LastName" SortExpression="VendorLName">
                <EditItemTemplate>
                    <asp:TextBox ID="txtLName"  Width="100px" runat="server" Text='<%# Bind("VendorLName") %>'></asp:TextBox>
                </EditItemTemplate>
                <FooterTemplate>
                <asp:TextBox ID="txtLName1" Width="100px" runat="server" ></asp:TextBox> 
                </FooterTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("VendorLName") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="City" SortExpression="VendorCity">
                <EditItemTemplate>
                    <asp:TextBox ID="txtCity"  Width="100px" runat="server" Text='<%# Bind("VendorCity") %>'></asp:TextBox>
                </EditItemTemplate>
                <FooterTemplate>
                <asp:TextBox ID="txtCity1"  Width="100px" runat="server" ></asp:TextBox> 
                </FooterTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("VendorCity") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="State" SortExpression="VendorState">
                <EditItemTemplate>
                    <asp:TextBox ID="txtState" Width="100px" runat="server" Text='<%# Bind("VendorState") %>'></asp:TextBox>
                </EditItemTemplate>
                <FooterTemplate>
                <asp:TextBox ID="txtState1" Width="100px" runat="server" ></asp:TextBox> 
                </FooterTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("VendorState") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Country" SortExpression="VendorCountry">
                <EditItemTemplate>
                    <asp:TextBox ID="txtCountry" Width="100px" runat="server" Text='<%# Bind("VendorCountry") %>'></asp:TextBox>
                </EditItemTemplate>
                <FooterTemplate>
                <asp:TextBox ID="txtCountry1" Width="100px" runat="server" ></asp:TextBox> 
                </FooterTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label5" runat="server" Text='<%# Bind("VendorCountry") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="VendorDescription" SortExpression="VendorDescription">
                <EditItemTemplate>
                    <asp:TextBox ID="txtDescription" TextMode="MultiLine" runat="server" Text='<%# Bind("VendorDescription") %>'></asp:TextBox>
                </EditItemTemplate>
                <FooterTemplate>
                <asp:TextBox ID="txtDescription1" runat="server" TextMode="MultiLine" ></asp:TextBox> 
                </FooterTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label6" runat="server" Text='<%# Bind("VendorDescription") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="Edit" ShowHeader="False"> 
            <EditItemTemplate> 
              <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update" Text="Update"></asp:LinkButton> 
              <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"></asp:LinkButton> 
                &nbsp;<asp:LinkButton ID="LinkButton5" runat="server">LinkButton</asp:LinkButton>
            </EditItemTemplate> 
            <FooterTemplate> 

            </FooterTemplate> 
            <ItemTemplate> 
              <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit"></asp:LinkButton> 
            </ItemTemplate> 
            </asp:TemplateField> 
            <asp:CommandField ...