Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

58 users online



How to retrieve domains from table rows in an html page?

How to retrieve domains from table rows in an html page?

Currently viewing this thread: 1 (0 members and 1 guests)


Page 2 out of 2
aonic

aonic

Neversidian
Status: Offline!

change the html for Primary and the domain, they both have the same html surrounding them

___________________

-Developer
-Forum Leader
-NeverNET

JohnSaunders

JohnSaunders

Neverside Newbie
Status: Offline!

Ah bummer! Unfortunately, the code is not on my site so I can't change it. Do you know of another way around it?

___________________

Best Regards,

John Saunders

aonic

aonic

Neversidian
Status: Offline!

$re = "/<tr>\r\n<td>\r\n<font face =' Arial,Verdana' size=1>\r\n&nbsp;(.+?)&nbsp;\r\n<\/td>/mis";

___________________

-Developer
-Forum Leader
-NeverNET

JohnSaunders

JohnSaunders

Neverside Newbie
Status: Offline!

Awesome! One last thing....can you tell me how to get them to display like:

domain.net
domain.org
domain.com

instead of

[0] => domain.net
[1] => domain.org
[2] => domain.com

Also, would it be possible to turn them into links as well? I REALLY appreciate the help. Been trying to figure this thing out for hours.

___________________

Best Regards,

John Saunders

Rad

Rad

thinking of something witty to put here
Status: Offline!

It's merely an array, so you can output them however you like:

PHP:


<?php foreach ($result as $domain): ?>
<a href="http://<?php echo $domain?>/"><?php echo $domain?></a>
<?php endforeach; ?>

JohnSaunders

JohnSaunders

Neverside Newbie
Status: Offline!

I tried out your code and this is what it printed out:

<a href="http://Array/">Array</a>

Here's the updated code:

PHP:

<?php

$buf 
file_get_contents("list.html");

$re "/<tr>\r\n<td>\r\n<font face =' Arial,Verdana' size=1>\r\n&nbsp;(.+?)&nbsp;\r\n<\/td>/mis";

preg_match_all($re$buf$result);
unset(
$result[0]);
?>

<?php foreach ($result as $domain): ?>

<a href="http://<?php echo $domain?>/"><?php echo $domain?></a>

<?php endforeach; ?>

Any idea what the problem is?

___________________

Best Regards,

John Saunders

aonic

aonic

Neversidian
Status: Offline!
PHP:

<?php foreach ($result[1] as $domain): ?>
<a href="http://<?php echo $domain?>/"><?php echo $domain?></a>
<?php endforeach; ?>

___________________

-Developer
-Forum Leader
-NeverNET

JohnSaunders

JohnSaunders

Neverside Newbie
Status: Offline!

Thanks for all of your help!

___________________

Best Regards,

John Saunders

Page 2 out of 2
Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0083 seconds.