Jump to content

naeembhatti

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Posts posted by naeembhatti

  1. hi friends h r u?
    i use simple stored procedure e.g
    in mysql=============================
    CREATE PROCEDURE `test`.`users` (OUT returnval int)
    BEGIN
    set returnval = 100;
    END //
    how to get its value in php===================i am currently using this

    $mysqli = new mysqli("localhost", "root", "bhatti", "test");

    if (mysqli_connect_errno())
    {
      printf("Connection failed: %s\n", mysqli_connect_error());
      exit();
    }

    $SQL = "CALL users(@retval)";
    if (!$mysqli->real_query($SQL))
    {
      printf("Invalid query: %s\nWhole query: %s\n", $mysqli->error, $SQL);
      exit();
    }

    if ($result = $mysqli->store_result())
    {
      while ($myrow = $result->fetch_array(MYSQLI_ASSOC))
      {
          print_r($myrow);
      }
      $result->close();
    }

    $mysqli->close();

    =======================================

    but when i wrote in phpmyadmin like CALL users(@retval); SELECT @retval; it returns me value but how to get it in php?
  2. [code]
    <input type=checkbox name=list[] value=1>
    <input type=checkbox name=list[]  value=6>
    <input type=checkbox name=list[] value=4>
    <input type=checkbox name=list[] value=13>
    <input type=checkbox name=list[] value=19>
    make it an array.
    <?
    just print the array.
    for($i=0; $i< count($_REQUEST['list']); $i++)
    {
    echo  $_REQUEST['list'][$i];

    }
    ?>
    [/code]
  3. hi guys how are u i am in trouble plz help me, my prob is.

    i have 3 arrays

    A = Array ( [0] => 2 [1] => 1 [2] => 3 [3] => 4 [4] => 5 [5] => 7 [6] => 6 )
    B=  Array ( [0] => http://localhost/script/images/children/img1.jpg [1] => http://localhost/script/images/children/img3.jpg [2] => http://localhost/script/images/children/img2.jpg [3] => http://localhost/script/images/children/img4.jpg [4] => http://localhost/script/images/children/img10.jpg [5] => http://localhost/script/images/children/img10.jpg [6] => http://localhost/script/images/children/img10.jpg )
    C=  Array ( [0] => http://localhost/script/01 [1] => http://localhost/script/03 [2] => http://localhost/script/! [3] => http://localhost/script/04 [4] => http://localhost/script/10 [5] => http://localhost/script/a [6] => http://localhost/script/description )
    ======================
    array(A)-> defines the sort order
    array(B)-> should be as sort order of array(A)
    array(C)-> should be as sort order of array(A)

    actually array(A) is a main array which contains the sort order like in [0]=>2 , [1]=>1
    i want so make a single array having sort order of array(A)

    like if array(A) have its 1st element to 2 then i want to pick 2nd element from array(B) and from array(C)
    i want to make a double dimension array
  4. okey but if i want to get only text in a body which contains bold tag e.g
    <b>Hello World</b>
    Or
    <b class='something'>Hello World</b>
    Or
    <b><span class='somthing'>Hello World</span></b>
    anyother text contains bold or having strong tag
    i want to search for only this please tell me how and also please help me where i can found more detail about RegExp();
    thanks a lot.
  5. how can i search for html body for text in <p>hi h r u?</p> tags or in <b>hello world</b>

    e.g
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    </head>

    <body>
    aaaaa<p>hi h r u?</p>bbbbbbbbbbbbbb<b>hello world</b>ccccccc
    </body>
    </html>

    i need only "hello world" or "hi h r u?"
    please help me
  6. actually i did not want that this site redirect to other page
    i need to get the contents of current page having same variables
    i use this as u recommend me.
    <?php
    // create a new CURL resource
    $ch = curl_init();

    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, "http://www.canadiantire.ca/assortments/product_detail.jsp?FOLDER%3C%3Efolder_id=1408474396669883&ASSORTMENT%3C%3East_id=1408474396670271&bmUID=1159850265943&PRODUCT%3C%3Eprd_id=845524441896143&assortment=primary&fromSearch=true");
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

    // grab URL and pass it to the browser
    echo curl_exec($ch);

    // close CURL resource, and free up system resources
    curl_close($ch);
    ?>

    thank u for help.
  7. this is my example code.

    [code]<?php
    $fp = fsockopen("www.canadiantire.ca", 200, $errno, $errstr, 30);
    if (!$fp) {
      echo "$errstr ($errno)<br />\n";
    } else {
      $out = "GET / HTTP/1.1\r\n";
      $out .= "Host: http://www.canadiantire.ca/assortments/product_detail.jsp?FOLDER%3C%3Efolder_id=1408474396669883&ASSORTMENT%3C%3East_id=1408474396670271&bmUID=1159779949708&PRODUCT%3C%3Eprd_id=845524441896143&assortment=primary&fromSearch=true
    \r\n";
      $out .= "Connection: Close\r\n\r\n";

      fwrite($fp, $out);
      while (!feof($fp)) {
          echo fgets($fp, 128);
      }
      fclose($fp);
    }
    ?>[/code]

    this function works for all sites but when ever i use this function for canadiantire.ca it generates this error
    "
    HTTP/1.0 302 Found Server: CacheFlow-Proxy/1.0 Location:http://www.http.com/ Connection: close Content-Length: 90
    Redirect
    "

    i don't know what could be its solution please help me out.

    [nobbc][edited by a moderator kenrbnsn, to surround the code with [code][/code] tags][/nobbc]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.