|
-
Mar 17th, 2003, 09:26 PM
#1
Thread Starter
Hyperactive Member
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]
-
Mar 18th, 2003, 02:25 AM
#2
Conquistador
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
-
Mar 18th, 2003, 08:42 AM
#3
Frenzied Member
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
-
Mar 18th, 2003, 09:34 PM
#4
Thread Starter
Hyperactive Member
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]
-
Mar 18th, 2003, 09:59 PM
#5
Frenzied Member
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.
-
Mar 19th, 2003, 07:20 PM
#6
Thread Starter
Hyperactive Member
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($fp, 4096);
}
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]
-
Mar 19th, 2003, 09:23 PM
#7
Frenzied Member
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.
-
Mar 19th, 2003, 09:30 PM
#8
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|