美文网首页
获取当前url脚本

获取当前url脚本

作者: LauEl | 来源:发表于2018-05-08 08:31 被阅读10次
    function GetCurUrl()
        {
            if(!empty($_SERVER["REQUEST_URI"]))
            {
                $scriptName = $_SERVER["REQUEST_URI"];
                $nowurl = $scriptName;
            }
            else
            {
                $scriptName = $_SERVER["PHP_SELF"];
                if(empty($_SERVER["QUERY_STRING"])) {
                    $nowurl = $scriptName;
                }
                else {
                    $nowurl = $scriptName."?".$_SERVER["QUERY_STRING"];
                }
            }
            return $nowurl;
        }
        ```
    
     <!--php显示数据-->
                        <?php $i=1; ?>
                        <?php $thisPage=($pageNow-1)*$pageSize+$i;?>
                    <?php foreach ($list as $k) { ?>
                    <td style="width:5%; text-align:center;"><?php echo $thisPage++?></td>
                    <td style="width:15%;  text-align:center;"><?php echo $k['tradeID'] ?></td>
                    <td style="width:65%; position:relative; left:10px;"><?php echo $k['tradetitle'] ?></td>
                    <td style="width:15%; text-align:center;"><a href='./update.php?id=<?php echo $k['id'] ?>'>修改</a>
                        <a href='./delete.php? id=<?php echo $k['id'] ?>' id="delete">删除</a>
                        <a data-toggle="collapse"  href="#ya<?php echo $k['id']; ?>" href='javascript:;' onclick='message(this,<?php echo$k['id']?>)'>详细</a></td>
                    </tr>
    
    $str =str_replace(' ','',$str);
                $str = strip_tags($str);
                $str = preg_replace('/\s+/', ";", $str);//preg_replace ( "/\s(?=\s)/","\\1",$str);
    
    

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    <system.webServer>
    <rewrite>
    <rules>
    <remove name="ttt" />
    <rule name="aa">
    <match url="^pro/(.\d+)(.*).html$" />
    <action type="Rewrite" url="index.php?c=search&job1_son={R:1}" />
    </rule>
    <rule name="搜索规则1">
    <match url="^(.\d+)$" />
    <action type="Rewrite" url="index.php?c=search&provinceid={R:1}" />
    </rule>
    <rule name="搜索规则2">
    <match url="^([0-9]+)/([0-9]+)$" ignoreCase="false" />
    <action type="Rewrite" url="index.php?c=search&job_post={R:1}&job1_son={R:2}" appendQueryString="false" />
    </rule>
    <rule name="搜索规则3">
    <match url="^([0-9]+)/([0-9]+)/([0-9]+)$" ignoreCase="false" />
    <action type="Rewrite" url="index.php?c=search&provinceid={R:1}&job_post={R:2}&job1_son={R:3}" appendQueryString="false" />
    </rule>
    <rule name="搜索规则4">
    <match url="^([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)$" ignoreCase="false" />
    <action type="Rewrite" url="index.php?c=search&cityid={R:1}&provinceid={R:2}&job_post={R:3}&job_post={R:4}" appendQueryString="false" />
    </rule>
    <rule name="搜索规则5">
    <match url="^([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)/([0-9]+)$" ignoreCase="false" />
    <action type="Rewrite" url="index.php?c=search&three_cityid={R:1}&cityid={R:2}&provinceid={R:3}&job_post={R:4}&job1_son={R:5}" appendQueryString="false" />
    </rule>
    </rules>
    </rewrite>
    </system.webServer>
    </configuration>

    相关文章

      网友评论

          本文标题:获取当前url脚本

          本文链接:https://www.haomeiwen.com/subject/lnqirftx.html