New to Ajax! Need help.?

Discussion in 'Digital Media' started by webmakersteve, May 22, 2008.

  1. i just started working with AJAX to add some functionality. This is the code i have so far. The php code just echos text it receives from the database, (last line is echo $bid;) Ive been working with php and have tested it so i know its right. could there be any other issues? Thanks.

    xmlHttp.onreadystatechange=function()
    {
    ajaxmessage = document.getElementById("ajax_message").innerHTML;
    currentBid = document.getElementById("current_bid");
    currentBidder = document.getElementById("current_bidder");
    if (xmlHttp.readyState==3) {
    ajaxmessage="Incoming Bid...";
    } else if (xmlHttp.readyState==4) {
    currentBid.firstChild.nodeValue=xmlHttp.responseText;
    }


    }
    url = window.location.search.substring(1);
    limit1 = url.indexOf("id")+3;
    limit2 = url.indexOf("&username");
    if (limit2 <= limit1) {
    limit2=300;
    }


    url_id=url.substring(limit1,limit2);

    xmlHttp.open("GET","getbid.php?id="+url_id,true);
    xmlHttp.send(null);
    ajaxmessage = url_id;
    }

    body.onclick=ajaxFunction();
    <?
    header("Cache-Control: no-cache, must-revalidate");
    // Date in the past
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");

    include('functions.php');
    mysql_new();

    $_GET[id]=$id;

    $sql = "SELECT * FROM bids WHERE sale_id = '".id."'";
    $query_select = mysql_query($sql) or die(mysql_error());
    //define variables so .= works
    $bids = "";
    $i = 0;
    while ($select_row = mysql_fetch_array($query_select)) {
    //get all the bids for it BID must be int
    $bid = $select_row['bid'];
    $bidder = $select_row['bidder'];
    $highbidder[$i] = $select_row['bidder'];
    //$id_2 = $select_row['id'];
    $bid_id[$i] = $select_row['id'];
    //bid_num, which will hold the bids
    $bids[$i] = $bid;
    $i++;
    }
    //find the highest bid, highbidder, and their id
    $highbid = 0;
    for ($a = 0; $bids[$a] <= $i ; $a++) {
    if ($highbid < $bids[$a]) {
    $highbid = $bids[$a];
    $hb_id = $bid_id[$a];
    $high_bidder = $highbidder[$a];
    }
    }
    $highbid = $response;
    echo $response;

    ?> the php code is pretty simple imo
  2. italyroxxxxx Not Active

    italyroxxxxx
    Joined:
    May 22, 2008
    Messages:
    1
    Likes Received:
    0
    A++
    i dont know what this means, but thanks for the 2 points =]
  3. uvwx178 Im banned! :(

    uvwx178
    Joined:
    May 24, 2008
    Messages:
    14
    Likes Received:
    0
    Louis Vuitton Handbags (LV Handbags)

    Louis Vuitton Handbags(LV Handbags)Louis Vuitton handbags were not the first line of products manufactured by Vuitton when he opened his luggage store in France during the mid-1800s. In fact, it wasn't until about 1900 that his company began selling purses. However, all of the company's products, at least for the past 100 years, have displayed the same type of "signature" or "monogram" on their fabric, which makes Louis Vuitton items very recognizable. Because of the huge popularity of Louis Vuitton purses among celebrities, and the fact that non-celebrities want to own them, there are a large number of knock-off Louis Vuittons on the market. Real Louis Vuitton purses sell for between several hundred and several thousand dollars, and the fake ones cost about 90 percent less. It's no wonder that this brand is so commonly counterfeited. In fact, counterfeiting is such a huge problem for the Louis Vuitton handbags brand, it is estimated that almost 99 percent of the so-called Louis Vuitton purses currently owned by people around the world are NOT authentic. Compared to other high-end brands, Louis Vuitton items make up almost 20 percent of all imitation purses and accessories that are manufactured around the world each year.T.T.E. (HongKong) International Trading Co,. Ltd. wholesale LV handbags, T.T.E. The leading Louis Vuitton handbag supplier in China. T.T.E. Contact Information:(HQ) 22/F., Harbour Centre, 35 Harbour Road, HongKong.(Branch) No.1238 South of Guangzhou Road, Guangzhou, China. Phone: +86 - 13719002015Fax: +86 - (20) - 86508285Email: sale3@ttetrading.com
Loading...

Share This Page