做成链接吧  用GET传一个参数 然后

解决方案 »

  1.   

    依次取出记录,然后使用curl即可
      

  2.   

    至于curl的用法楼主查一下手册吧,也可以使用file或者file_get_contents
      

  3.   

    <input type="button" value="ttt" name='ttt' onclick='window.location="query.php"'/>
    <?php
     //连接数据库,修改成自己的用户名和密码
     $link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
     mysql_select_db("数据库名", $link);
     $result = mysql_query("SELECT url FROM 表名");
     while($row = mysql_fetch_row($result))
     {
       file_get_contents($row[0]); 
     }
     mysql_free_result($result);
     mysql_close($link);
    ?>
      

  4.   

    这些是我的代码,已经可以实现把相对应的链接读出来在页面上显示,楼上的大哥麻烦教教小弟怎么改
    require('../../config.inc.php');
    require_once('common.php');
    require_once('builds.inc.php');
    require_once('results.inc.php');
    require_once("../../lib/functions/lang_api.php");
    testlinkInitPage();$arrData = array();
    $arrBuilds = getBuilds($_SESSION['testPlanId'], " ORDER BY build.name ");// is output is excel?
    $xls = FALSE;
    if (isset($_GET['format']) && $_GET['format'] =='excel'){
    $xls = TRUE;
    }// 20050919 - fm
    $sql = " SELECT mgttcid,url" .
           " FROM project TP, component COMP, category CAT, testcase TC, mgtcomponent MGTCOMP, mgtcategory MGTCAT " .
           " WHERE MGTCOMP.id = COMP.mgtcompid " .
           " AND MGTCAT.id = CAT.mgtcatid " .
       " AND COMP.projid=TP.id " .
       " AND CAT.compid=COMP.id " .
       " AND TC.catid=CAT.id" .
          " AND TP.id=" . $_SESSION['testPlanId'];$result = do_mysql_query($sql);
    $bRights = has_rights("tp_execute") && !$xls;while ($myrow = mysql_fetch_assoc($result))
    { //Cycle through all of the test cases
    $container = null;
    $container[] = htmlspecialchars($myrow['mgttcid'] . ' / ' . $myrow['mgttcid']);
    $container[] = "<b>" . $myrow['url'] . "</b>:"; 

    ///SCHLUNDUS
    $arrData[] = $container;
    }// for excel send header
    if ($xls)
    sendXlsHeader();$smarty = new TLSmarty;
    $smarty->assign('title', lang_get('title_test_report_all_builds'));
    $smarty->assign('arrData', $arrData);
    $smarty->assign('arrBuilds', $arrBuilds);
    if ($xls) {
    $smarty->assign('printDate', strftime($g_date_format, time()) );
    $smarty->assign('user', $_SESSION['user']);
    }
    $smarty->display('urlrun.tpl');urlrun.tpl的代码
    {include file="inc_head.tpl"}<body>{if $printDate == ''}
    <h1>{$title|escape}</h1>{else}{* print data to excel *}{/if}<div class="workBack">
    <table class="simple" style="width: 100%; text-align: center; margin-left: 0px;">
    <tr>
    <th>ID</th>
    <th>url</th>
    </tr>
    {section name=Row loop=$arrData}
    <tr>
    {section name=Item loop=$arrData[Row]}
    <td>{$arrData[Row][Item]}</td>
    {/section}
    </tr>
    {/section}
    </table>
    </div></body>
    </html>
      

  5.   

    将url以get方式传递给一个xxx.php,记得传之前要编码一下.
    在xxx.php里获取,然后file_get_contents这个网址就行了.
      

  6.   


    $sql = " SELECT url" .
           " FROM project TP, component COMP, category CAT, testcase TC, mgtcomponent MGTCOMP, mgtcategory MGTCAT " .
           " WHERE MGTCOMP.id = COMP.mgtcompid " .
           " AND MGTCAT.id = CAT.mgtcatid " .
               " AND COMP.projid=TP.id " .
               " AND CAT.compid=COMP.id " .
               " AND TC.catid=CAT.id" .
             " AND TP.id=" . $_SESSION['testPlanId'];$result = do_mysql_query($sql);
    $bRights = has_rights("tp_execute") && !$xls;while ($myrow = mysql_fetch_assoc($result))
    { //Cycle through all of the test cases
        $container = null;
        $container[] = "<b>" . $myrow['url'] . "</b>:"; 
        $echo $myrow['url'];
    }
    上面代码中 $myrow['url'] 已经是表中所有url的集合,怎么能依次执行集合中的url呢?
      

  7.   

    依次执行是个什么概念?啥叫执行url链接?
      

  8.   

    我这个数据库中的链接是对应的测试用例,也就是个ie链接,打开后,就会执行,我现在想做的就是把表中的每个url都打开一遍,就ok了。
      

  9.   

    明白了。直接<script>window.open("http://www.baidu.com")</script>就可以了~~~
    你可以写在js的for循环里面。
      

  10.   

    试试改改:$container[] = "<script>window.open('" . $myrow['url'] . "')</script>:"; 
      

  11.   

    为什么运行后会提示缺少对象,高手指点下,帮我找找哪里错了,谢谢。$sql = " SELECT url" .
           " FROM project TP, component COMP, category CAT, testcase TC, mgtcomponent MGTCOMP, mgtcategory MGTCAT " .
           " WHERE MGTCOMP.id = COMP.mgtcompid " .
           " AND MGTCAT.id = CAT.mgtcatid " .
       " AND COMP.projid=TP.id " .
       " AND CAT.compid=COMP.id " .
       " AND TC.catid=CAT.id" .
          " AND TP.id=" . $_SESSION['testPlanId'];$result = do_mysql_query($sql);
    $bRights = has_rights("tp_execute") && !$xls;
    $urls = array();while ($myrow = mysql_fetch_assoc($result))
    { //Cycle through all of the test cases
    $container = null;
    $container[] = "<b>" . $myrow['url'] . "</b>:"; ///SCHLUNDUS $urls[] = $myrow['url'];}echo '<script type="text/javascript">';
    echo 'function openURL(){';foreach($urls as $key=>$value)
    {
        echo 'window.open("'.$value.'")';
    }echo '}';
    echo '</script>';echo '<input type="button" value="ttt" name="ttt" onclick="openUrl()"/>';