Jump to content

Does anyone have a script that works?


godfather

Recommended Posts

Well,
Does anyone have script in preg_match_all-function that works. I have tried his one.
[code]<?php
$url =  "http://www.svenskaspel.se/pl.aspx?PageID=281&menuid=3&parentid=4377";

$stryk = file_get_contents($url);


# find <p class="text" och "<br \>" and erase them...
$change = array('', '<td class="lwb">', '<tr class=sbr', '');
$to_this = array('<table>','<tr>', '<td>', '</td>', '</tr>', '</table>');

$stryklink = str_replace($change, $to_this, $stryk);

# Find all links in  $stryklink
preg_match_all("/\<a href\=\".*\"\>(.*)/", $stryklink, $matches);
  foreach($matches[0] as $rows => $link);
?>
[/code]
And this is the page code that I want to shown on my page
[code]<td width=35>&nbsp;</td>
<td width=350 valign=top><br>
    <br><BR><TABLE WIDTH='350' CELLPADDING='2' BORDER='0' CELLSPACING='0' BGCOLOR='#0A235A'>
  <TR>
      <TD width='160' class='lwb'>
        <TABLE width='100%'>
            <TR>

              <TD nowrap='true' width='100%' class='lwb'>Veckans omgång (v.32)</TD>
            </TR>
        </TABLE>      </TD>
      <TD class='lwb'>
        <TABLE>
            <TR>
              <TD class='swb'>Spelstopp 12/8 15:55</TD>
            </TR>
            <TR>
              <TD class='swr'>Klicka på en match för att få fram matchfakta.</TD>
            </TR>
        </TABLE>      </TD>
  </TR>
</TABLE>
<TABLE WIDTH='350' CELLPADDING='6' BORDER='0' CELLSPACING='0'>

  <TR NOWRAP='true' BGCOLOR='#cc0000'>
      <TD CLASS='mwb' COLSPAN='2'>MATCH</TD>
      <TD ALIGN='CENTER' NOWRAP='true' CLASS='swb'>SVENSKA FOLKET</TD>
  </TR>
  <TR BGCOLOR='#FFFFFF'>
  <TD class='sbr' align='right' valign='top' style='color:red'>1</TD>
      <TD class='sbr' width='60% valign='top' style='color:red'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/>        <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=120025&matchVal=1' style='color:red'>Helsingborg - Djurgården&nbsp;&nbsp;<img src='/img/13plus_logga_liten.gif' border='0' align='absbottom'/>        <br><i>Canal+ Sport 13/8 kl. 18:00</i><br></TD>

      <TD class='sbr' align='center' valign='top' nowrap style='color:red'>46%&nbsp;&nbsp;28%&nbsp;&nbsp;26%      </TD>
</TR>
  <TR BGCOLOR='#E3E3E3'>
  <TD class='sbr' align='right' valign='top' style='color:black'>2</TD>
      <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/>        <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=120023&matchVal=2' style='color:black'>Gefle - IFK Göteborg</TD>
      <TD class='sbr' align='center' valign='top' nowrap style='color:black'>26%&nbsp;&nbsp;23%&nbsp;&nbsp;51%      </TD>
</TR>
  <TR BGCOLOR='#FFFFFF'>
  <TD class='sbr' align='right' valign='top' style='color:black'>3</TD>
      <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/>        <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=120024&matchVal=3' style='color:black'>Halmstad - Öster</TD>
      <TD class='sbr' align='center' valign='top' nowrap style='color:black'>54%&nbsp;&nbsp;24%&nbsp;&nbsp;22%      </TD>
</TR>
  <TR BGCOLOR='#E3E3E3'>

  <TD class='sbr' align='right' valign='top' style='color:black'>4</TD>
      <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/>        <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=120021&matchVal=4' style='color:black'>Hammarby - Örgryte</TD>
      <TD class='sbr' align='center' valign='top' nowrap style='color:black'>68%&nbsp;&nbsp;17%&nbsp;&nbsp;15%      </TD>
</TR>
  <TR BGCOLOR='#FFFFFF'>
  <TD class='sbr' align='right' valign='top' style='color:black'>5</TD>

      <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/>        <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=120022&matchVal=5' style='color:black'>Kalmar FF - AIK</TD>
      <TD class='sbr' align='center' valign='top' nowrap style='color:black'>36%&nbsp;&nbsp;32%&nbsp;&nbsp;32%      </TD>
</TR>
  <TR BGCOLOR='#E3E3E3'>
  <TD class='sbr' align='right' valign='top' style='color:black'>6</TD>
      <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/>        <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=120026&matchVal=6' style='color:black'>Malmö FF - Elfsborg</TD>

      <TD class='sbr' align='center' valign='top' nowrap style='color:black'>45%&nbsp;&nbsp;28%&nbsp;&nbsp;27%      </TD>
</TR>
  <TR BGCOLOR='#FFFFFF'>
  <TD class='sbr' align='right' valign='top' style='color:black'>7</TD>
      <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/>        <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=116357&matchVal=7' style='color:black'>Brommapojkarna - Mjällby</TD>
      <TD class='sbr' align='center' valign='top' nowrap style='color:black'>68%&nbsp;&nbsp;17%&nbsp;&nbsp;15%      </TD>
</TR>
  <TR BGCOLOR='#E3E3E3'>
  <TD class='sbr' align='right' valign='top' style='color:black'>8</TD>
      <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/>        <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=116356&matchVal=8' style='color:black'>Ljungskile - Umeå FC</TD>
      <TD class='sbr' align='center' valign='top' nowrap style='color:black'>52%&nbsp;&nbsp;25%&nbsp;&nbsp;23%      </TD>
</TR>
  <TR BGCOLOR='#FFFFFF'>

  <TD class='sbr' align='right' valign='top' style='color:black'>9</TD>
      <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/>        <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=116360&matchVal=9' style='color:black'>IFK Norrköping - Landskrona</TD>
      <TD class='sbr' align='center' valign='top' nowrap style='color:black'>43%&nbsp;&nbsp;30%&nbsp;&nbsp;27%      </TD>
</TR>
  <TR BGCOLOR='#E3E3E3'>
  <TD class='sbr' align='right' valign='top' style='color:black'>10</TD>

      <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/>        <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=116358&matchVal=10' style='color:black'>Qviding - Jönköpings Södra</TD>
      <TD class='sbr' align='center' valign='top' nowrap style='color:black'>44%&nbsp;&nbsp;29%&nbsp;&nbsp;27%      </TD>
</TR>
  <TR BGCOLOR='#FFFFFF'>
  <TD class='sbr' align='right' valign='top' style='color:black'>11</TD>
      <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/>        <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=116361&matchVal=11' style='color:black'>Trelleborg - Assyriska        <br><i>SPORT-Expressen 14/8 kl. 19:00</i><br></TD>

      <TD class='sbr' align='center' valign='top' nowrap style='color:black'>63%&nbsp;&nbsp;20%&nbsp;&nbsp;17%      </TD>
</TR>
  <TR BGCOLOR='#E3E3E3'>
  <TD class='sbr' align='right' valign='top' style='color:black'>12</TD>
      <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/>        <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=116355&matchVal=12' style='color:black'>Väsby United - Falkenberg</TD>
      <TD class='sbr' align='center' valign='top' nowrap style='color:black'>44%&nbsp;&nbsp;29%&nbsp;&nbsp;27%      </TD>
</TR>
  <TR BGCOLOR='#FFFFFF'>
  <TD class='sbr' align='right' valign='top' style='color:black'>13</TD>
      <TD class='sbr' width='60% valign='top' style='color:black'><IMG SRC='/img/pil.gif' WIDTH='10' HEIGHT='11'/>        <a href='pl.aspx?PageID=1169&menuid=3&prod=stryk&omg=3932&parentid=4377&match=116359&matchVal=13' style='color:black'>Örebro - GIF Sundsvall</TD>
      <TD class='sbr' align='center' valign='top' nowrap style='color:black'>63%&nbsp;&nbsp;21%&nbsp;&nbsp;16%      </TD>
</TR>
</TABLE>
<br/></td>
<td width=35>&nbsp;</td>
<td width=185 valign=top><br/></td></tr></table>[/code]

Somebody know what I'm doing wrong?
Or do you have a better script.

My output is a blank white page men execute this code on my server  >:(

Thanx for y'all help.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.