Jump to content

blazing_bruce

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Posts posted by blazing_bruce

  1. The very idea of a site having that many h1s is hilarious (and bad SEO form at the same time). What do you intend to do with the nth occurrence?

    Do you need just what <h1> holds? Or do you need the entire <h1> code? Lack of specifics means questioning what to capture (if there is a need to capture in the first place).

     

    Well yes too much <h1> is not a good. I am just trying to get contents inbetween tags.. I tried the following for <td> </td> .

    preg_match_all('/<td [^>]*>((?:<td.+?<\/td|.)*?)<\/td>/si', $sometable, $matches);

     

    It worked like charm :)

  2. Hello,

          I am learning regularexperssion. it is pretty awesome.

    Is it possible to make a pattern in preg_match_all to grab content of 6th or 7th h1 tag's text

     

    <h1 styles.. or any other attributes *>text</h1>

    <h1 styles.. or any other attributes *>text</h1>

    <h1 styles.. or any other attributes *>text</h1>

    <h1 styles.. or any other attributes *>text</h1>

    <h1 styles.. or any other attributes *>text</h1>

     

    The main objective here is.. I am trying to find a text of Nth occurance of <h1 and </h1>

     

    I was trying to use preg_match_all .. But unable to get it. Any help would be much appreciated . Im sorry if it is a silly question :)

  3. i writtened an algorithm for it myself :)

    $checked[0] = 1;
    $checked[1] = 3;
    $checked[2] = 4;
    $checked[3] = 6;
    $checked[4] = 7;

    if you want to get all posiblities of array elements (with out repeating)
    like this
    0 1 2 4
    0 1 2 3
    0 1 3 4
    0 2 3 4
    1 2 3 4

    PHP code follows
    [code]for($n=0;$n<=$total_checked;$n++)
            {
            unset($new);
            $j=0;
            //echo("N=$n<br>");
            $value = $total_checked-$n;
            //echo("value = $value<br>");
                for($b=0;$b<$total_checked;$b++)
                {
                if($b==$value)
                {
            //    echo("Entered condition");
            $notaccepted = $checked[$b];
                continue;
                }
                $new[$j]=$checked[$b];
                echo($j);
    //Change here if you want that combination of array values echo("$new[$j]");
                $j++;
                }
                if($n==0)
                {
                continue;
                }
            //    print_r($new);
                echo("<BR>");
                
            }    [/code]

    Thank you,
    Karthi keyan
  4. Hello all,
    i have an array named $checked;

    $checked[0] = 1;
    $checked[1] = 3;
    $checked[2] = 4;
    $checked[3] = 6;
    $checked[4] = 7;


    i want to make combinations like
    array index
    0 1 2 3 means $checked[0]; $checked[1]; $checked[2]; $checked[3];
    0 1 2 4
    0 1 3 4
    0 2 3 4
    1 2 3 4
    . . . .

    like this manner. it should find all the possible combinations.

    here i said the sizeof array is five. but it may be 7 , 8 or 3 . if the size of array is 'n' then i want combinations in size of 'n-1' .

    is it possible? please help me.

    Thank you,

  5. hello all,
    i have a table named rest

    RID CID
    1 | 2
    1 | 3
    1 | 4
    2 | 2
    2 | 3
    3 | 2
    3 | 4
    4 | 2
    4 | 3
    i want to list records which accepts the cards (CID).

    first i have 4 check boxes in search.php

    for($i=1;$i<=$total_cards;$i++)
    {
    $fetch = mysql_fetch_row($pass_cards);
    $id=$fetch[0];
    $name = $fetch[1];
    echo("<input type='checkbox' name='card[]' value='$id' />$name");
    }

    in list.php
    i want to show the list of records based on check box's value

    getting post values by
    $checked = $HTTP_POST_VARS['card'];

    now i want to list all the records which having all the CID values.

    if i checking the check box 2 and 3 (which is CID)
    then list.php will show 1,2,4 (RID)

    i have tried in many ways, but no use.

    this is wil be a simple MySQL query. please help me.
  6. first try to check is it set on your system. try to use if(isset($_COOKIE['policyusername'])) or empty($_COOKIE['policyusername']) . try to check with junk data it is $username = "try this data"; and setcookie(policyusername, $username);
    and then chck it. if it shows "try this data" in browser then there is a problem in query or empty data returend by mysql.

    Try all the things i told

    Thank you,
    Karthikeyan.
  7. [!--quoteo(post=356919:date=Mar 21 2006, 05:39 PM:name=gk20)--][div class=\'quotetop\']QUOTE(gk20 @ Mar 21 2006, 05:39 PM) [snapback]356919[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    I have a table called item with fields category and item. I can display all distinct categories but I want to display them as links on my home page, so that when u click a category it displays all items in that category on a new page?

    Here my code for displaying each individual category:

    <?php
    include 'db.inc.php';

    $cats = @mysql_query("SELECT DISTINCT category from item ORDER BY category");

    echo '<b>&nbsp Category List<br></b>';

    while ($row = mysql_fetch_array($cats))
    {
    echo '<font color=red size="4">';
    echo '&nbsp;&nbsp;';
    echo $row['category'] . '<br/>';
    echo '</font>';
    }
    ?>

    Can anyone help?
    [/quote]
    if you are trying to link them then
    add two more echos inside of the while
    that is
    while ($row = mysql_fetch_array($cats))
    {
    //like file is
    $link = "$row['category'] "."php"


    echo '<font color=red size="4">';
    echo '&nbsp;&nbsp;';
    echo '<a href='$link'>';
    echo $row['category'] . '<br/>';
    echo '</a>';
    echo '</font>';
    }

    i hope this will work as per your needs.

    Thank you,
    Karthikeyan
  8. hello,
    Not just You are logged in as <?php $_COOKIE["policyusername"] ?>. it will be You are logged in as <?php echo $_COOKIE["policyusername"] ?>.

    [a href=\"http://in2.php.net/manual/en/function.setcookie.php\" target=\"_blank\"]http://in2.php.net/manual/en/function.setcookie.php[/a]

    Thank you,
    Karthikeyan
  9. hello,

    The error Can't connect to ... normally means that there is no MySQL server running on the system or that you are using an incorrect Unix socket filename or TCP/IP port number when trying to connect to the server.

    for more reference about these type of probs [a href=\"http://www.oscommerce.info/kb/osCommerce/General_Information/Common_Problems/69\" target=\"_blank\"]http://www.oscommerce.info/kb/osCommerce/G...mon_Problems/69[/a]

    Thank you,
    Karthi keyan.
  10. Great Prismatic,
    Thanks :)

    Really it is redirecting me. but one problem. i am using that redirecting line inside <iframe> tag so redirect url's content is showing inside of that iframe. if you are not clear with me then have a look at [a href=\"http://karthi.livesoft.info\" target=\"_blank\"]http://karthi.livesoft.info[/a] i want to load redirection page fully in browser atleast open in new window.

    Please help me,

    Thank you,
    Karthi keyan.
  11. hello,
    i am using a script named work.php for two purpose .
    1. displaying banner image
    2. checking remote address and putting clicks and hits informations in tables
    2.1 after making these data base operations, redirecting browser to the $rediurl by using header();

    $rediurl = // my url
    header("Location:$rediurl");

    i spliting my script by two separate if conditions.
    1st condition for displaying image by
    echo("<center><a href=\"$hrf\"><img src=\"$banurl\"> <br> </a></center>");

    in second condition i am checking ip and date values, after that trying to redirect.
    by:
    mysql_close($connection);
    echo("until db Close "); // this is for debugging process
    header("Location: $rediurl");
    i can get dbclose acknowledgement too. the header line didn't executed.
    Pleaese help me.
  12. [!--quoteo(post=356294:date=Mar 19 2006, 06:01 AM:name=Barand)--][div class=\'quotetop\']QUOTE(Barand @ Mar 19 2006, 06:01 AM) [snapback]356294[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    echo("<center><a [!--coloro:#FF6666--][span style=\"color:#FF6666\"][!--/coloro--]herf[!--colorc--][/span][!--/colorc--]=\"$hrf\"><img src=\"$banurl\"> <br> </a></center>");

    try "HREF" or "href" instead of "herf"
    [/quote]


    Ohh what a minor mistake i did :( . Thanks a lot Mr.Barand.
  13. I am doing a banner exchange script.
    this is the banner tag
    "<!-- Banner code begin -->
    <CENTER>'<IFRAME SRC= 'http://domainname.com/subfolder/work.php?ID=$check' width=300 height=400 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling='no'></IFRAME><p>&nbsp;</p></CENTER>
    <!-- Banner code end -->";

    inside work.php
    $hrf = "http://domainname.com/subfolder/work.php?who=$check&redi=$rediurl";
    echo("<center><a herf=\"$hrf\"><img src=\"$banurl\"> <br> </a></center>");

    image was perfectly displayed. but i cannt make a link. please help me.

    Thankyou,
    Karthikeyan.
×
×
  • 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.