Results 1 to 8 of 8

Thread: Getting Information

  1. #1

    Thread Starter
    Hyperactive Member New to VB 6's Avatar
    Join Date
    Apr 2002
    Posts
    362

    Question Getting Information

    Is this code right?

    PHP Code:
    $LEVEL $data[27753], $data[27754], $data[27755], $data[27756], $data[27757], $data[27758], $data[27759], $data[27760]; 
    Last edited by New to VB 6; Mar 17th, 2003 at 11:39 PM.
    [VBCODE]
    Option Explicit
    Dim XXX As Porn
    Dim Wife As Nag

    Private Sub *****_Resize()
    On Error Resume Next
    Get Viagra
    End Sub
    [/VBCODE]

  2. #2
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    what are you trying to do?

    If you're trying to concatenate them, you will have to use a "." (fullstop - no quotes) to do this

  3. #3
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    this

    PHP Code:
    $LEVEL $data[27753] . $data[27754] . $data[27755] . $data[27756] . $data[27757] . $data[27758] . $data[27759] . $data[27760]; 
    or this
    PHP Code:
    $LEVEL = {$data[27753]} {$data[27754]} {$data[27755]} {$data[27756]} {$data[27757]} {$data[27758]} {$data[27759]} {$data[27760]}; 
    both do the samething

  4. #4

    Thread Starter
    Hyperactive Member New to VB 6's Avatar
    Join Date
    Apr 2002
    Posts
    362
    Thanks for all the help...

    However, maybe you could help me out some more?

    I am using the code at the top of this thread to find out what the letters are at the $data[xxxxx] possitions in an html file.

    is there a better way to find a specific word or string in an html?

    i.e. look for {color} or <img src="/images/file.jpg">
    [VBCODE]
    Option Explicit
    Dim XXX As Porn
    Dim Wife As Nag

    Private Sub *****_Resize()
    On Error Resume Next
    Get Viagra
    End Sub
    [/VBCODE]

  5. #5
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    what code?

    all you have is numbers. how is that finding a string in a html document?

    plus depending on how you are dioing it, you can open the html page up in fopen() and search for the string.

  6. #6

    Thread Starter
    Hyperactive Member New to VB 6's Avatar
    Join Date
    Apr 2002
    Posts
    362
    this is exactly what I'm using
    PHP Code:
    <?php 

    $fp 
    fopen("http://www.boogiebug.com/folder/index.html""r"); 
    $data ""

    while(!
    feof($fp)) 

    $data .= fgets($fp4096); 


    if (
    $data[27753] . $data[27754] . $data[27755] . $data[27756] . $data[27757] . $data[27758] . $data[27759] . $data[27760] . $data[27761] . $data[27762] . $data[27763] . $data[27764] == 'file1.jpg')

    $LEVEL "file1.jpg";
    }
    else {
    $LEVEL "Oops";
    }

    echo 
    $LEVEL;
    ?>
    What I now need to know is; Is there a better (not necessarily easy) way to find a string such as <img src="/images/file1.jpg">,
    so I can dynamicly change which image is displayed on my page according to what is displayed on the other page?
    [VBCODE]
    Option Explicit
    Dim XXX As Porn
    Dim Wife As Nag

    Private Sub *****_Resize()
    On Error Resume Next
    Get Viagra
    End Sub
    [/VBCODE]

  7. #7
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    where do you get those numbers???

    $data[27753]


    don't tell me you are counting all the lines? that is totally wrong.

    if you want to find a <img> tag then use regular expression.

    PHP Code:
    $fp fopen("http://www.boogiebug.com/folder/index.html""r");
    $arrlen count($fp);
    fclose($fp);
    $length count($newArray);
    for (
    $j 0$j <$length $j++) {

    if (
    preg_match ('/^[file1.jpg]/i'$fp[$j], $matches)) {
    $LEVEL "file1.jpg";
    } else {
    $LEVEL "Oops"
    }

    echo 
    $LEVEL
    something like that. what worrry about numbers.

    not tested but should work.

  8. #8
    New Member
    Join Date
    Mar 2003
    Posts
    1
    Yeah, use the strstr()-function.

    PHP Code:
    $string '<img src="/images/file1.jpg">';
    $container $data;

    if(
    strstr($container,$string)) { 
        
    $LEVEL "your-file"
    } else { 
        
    $LEVEL "you-missing-file";

    You can find out more at http://www.php.net/manual/en/function.strstr.php

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width