我真的对我正在做的事情一无所知.抱歉.
这就是我重写这些URL的方法:
http://example.com/foo/bar/news/1-category-name/2-item-name
http://example.com/foo/bar/news/1-category-name
Run Code Online (Sandbox Code Playgroud)
进入这些:
http://example.com/foo/bar/news.php?newsID=2
http://example.com/foo/bar/news-categories.php?categID=1
Run Code Online (Sandbox Code Playgroud)
分别
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /foo/bar
RewriteRule ^news\/([^\/]+)/([0-9]+)-([^\/]+)$ news.php?newsID=$3
RewriteRule ^news\/([0-9]+)-([^\/]+)$ news-categories.php?categID=$1
</IfModule>
Run Code Online (Sandbox Code Playgroud)
但每当我尝试这个URL:
http://example.com/foo/bar/news/16-news-category-1/11-title
Run Code Online (Sandbox Code Playgroud)
它总是返回一个404错误:
在此服务器上找不到请求的URL /foo/bar/news.html/16-news-category-1/11-title
为什么要找news.html?我究竟做错了什么?
我不知道这是否相关但是example.com是虚拟的(我真的不知道这个术语).实际文件也可以通过访问http://real-domain.com/qux/.所以,你会怎么做http://real-domain.com/qux/foo/bar/news/1-category-name/2-item-name去2-item-name.
说这个脚本实际上是在我的开发机器上运行也有帮助吗?
Development:
PHP v5.3.5
Apache v2.2
Live:
PHP v5.3.6
Apache v2.2
Run Code Online (Sandbox Code Playgroud) 我正在尝试获取标签内的信息。
<script type="text/javascript"> INFO </script>
Run Code Online (Sandbox Code Playgroud)
进一步来说:
<!DOCTYPE html>
<html lang="en" class="js logged-in client-root">
<head>...</head>
<body class style ="position: fixed; top: -265px; width: 100%;">
<span id="react-root" aria-hidden="true">...</span>
<script type="text/javascript> This is the tag i want. </script>
<script type="text/javascript>
window.__initialDataLoaded(window._sharedData); </script>
...
Run Code Online (Sandbox Code Playgroud)
我正在尝试这个,但没有运气:
browser = webdriver.Chrome()
info = browser.find_element_by_xpath("//script[@type='text/javascript']")
print(info.text) //prints nothing
Run Code Online (Sandbox Code Playgroud) javascript python selenium selenium-chromedriver selenium-webdriver
我正在做一个自定义CMS,我已经构建了我的基本内容类,如下所示:
class Content
{
public $title;
public $description;
public $id;
static function save()
{
$q = "[INSERT THE DATA TO BASE CONTENT TABLE]";
}
}
class Image extends Content
{
public $location;
public $thumbnail;
public function save()
{
// I wanted to do a Content::save() here if I
// declare Contents::save() as static
$q = "[INSERT THE DATA TO THE IMAGE TABLE]";
}
}
Run Code Online (Sandbox Code Playgroud)
我的问题是我知道静态函数不能使用,$this但我知道Content::save()需要使用它.
我想Image::save()打电话,Content::save()但我希望他们既被命名save()又被宣布,public而不是static因为我需要 …
我在这个块上有一个非常奇怪的错误:
<script type="text/javascript">
var captions = new Array();
captions[0] = "";
captions[1] = '<div class="cap-desc"><h3>No Win - No Fee</h3><span class="captionSubhead">Performance Guarantee</span><br /><span style="color:#636363; font-size:13px;">Ask Today. We are very confident<br />you'll be impressed with our results! </span></div><br /><a href="http://#" class="rmore" target="_blank">read more</a>';
</script>
Run Code Online (Sandbox Code Playgroud)
错误告诉我,我错过了';' 在标题之前[1]但我很确定标题[0]有一个分号!
整个网站在这里:http://katron.sourcefit.com/cms02/a&a/
它现在有5个字幕,但仍然有相同的错误.我尝试更改相关标题的内容.在这种情况下,它的标题[1],它的工作原理.标题有什么问题?我确信我正在关闭所有标签和引号并转发\n到
javascript ×2
.htaccess ×1
extend ×1
methods ×1
mod-rewrite ×1
object ×1
php ×1
python ×1
selenium ×1