[PHP] Getting Similar rows from db

2007-02-23 Thread Wikus Möller

Hi.

I need a script that selects all similar rows from a database. Like
only the id would differ, but other fields would be the same as other
rows's fields.

I don't know if there is such a mysql statement like SELECT SIMILAR ...

Please assist me with using the right mysql statement or using php to
get similar rows from the db.

Thanks
*STILL Learning*

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Check if link is on a page

2007-02-24 Thread Wikus Möller

Hi.

I need some help with checking if a certain link is on a page (e.g.
check if http://yahoo.com is on http://google.com/index.php )

Please help me to get the web page and to perform a string match on
the web page.

Thanks
*Still learning*

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Check if link is on a page

2007-02-24 Thread Wikus Möller

Ok, thanks.

That should do it.
By the way, which letter should be used for what at the fopen like you
used an 'r'. Is there an online reference that lists this? Because I
couldn't find it at php.net

Thanks

On 2/24/07, Dave Goodchild <[EMAIL PROTECTED]> wrote:

$web = fopen('http://google.com/index.php', 'r');
$contents = file_get_contents($web);
if (preg_match('/$link/', $contents))... you got it

simplified and no error checking but you get the idea.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Problems with mirror site script

2007-06-26 Thread Wikus Möller

Hi.

I am currently writing a script to put on my site so people can browse
other sites by using my site as a mirror therefore the contents of a
webpage would be retrieved and echoed on my site.

I am having some problems with placing my ad at the top of the page
that is echoed when a user browses a site so that it doesn't interfere
with the headers. I am having problems with where to place the link
e.g. after the body tag, and how to find out what type of page it is
i.e. html, xhtml, etc. so I know if I can use specific effects with my
ads.

Also, when a user clicks on a link on the mirrored page the link
should be mysite.com/index.php?go=http://othersite.com/othersitepage.htm
and not mysite.com/othersitepage.htm

I have tried to use str_replace in the contents of the retrieved
webpage but it doesn't seam to work.

Here is the simple piece of code that I have started with without security etc:

" , $contents);
}

if(strstr($contents, "" , $contents);
}


echo $contents2[0] . $ads . $contents2[1];
?>

Please advise me if there is another better way to place my ad and
check the type of page because this coding is just wrong and
error-prone.

Thanks
Wikus

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php