回答編集履歴
2
muriyari
test
CHANGED
@@ -16,3 +16,26 @@
|
|
16
16
|
<a href="?q=%E3%83%AB%E3%83%91%E3%83%B3%E4%B8%89%E4%B8%96(%233)">ルパン三世(#3)</a>
|
17
17
|
```
|
18
18
|
上記クリックすると「Array ( [q] => ルパン三世(#3) )」が確認できます
|
19
|
+
|
20
|
+
# むりやりpostする
|
21
|
+
```javascript
|
22
|
+
<?PHP
|
23
|
+
print_r($_POST);
|
24
|
+
?>
|
25
|
+
<script>
|
26
|
+
document.addEventListener('click',e=>{
|
27
|
+
if(e.target.matches('a')){
|
28
|
+
e.preventDefault();
|
29
|
+
const h=e.target.getAttribute('href').split(/\/(?=[^\/]+$)/);
|
30
|
+
const f=`<form method="post" action="${h[0]}" id="f" style="position:absolute;top:-999">
|
31
|
+
<input name="q" value="${h[1]}">
|
32
|
+
<input type="submit" value="send">
|
33
|
+
</form>`;
|
34
|
+
document.body.insertAdjacentHTML('beforeend',f);
|
35
|
+
document.querySelector('#f').submit();
|
36
|
+
}
|
37
|
+
});
|
38
|
+
</script>
|
39
|
+
|
40
|
+
<a href="http://example.com/episode/ルパン三世(#3)">ルパン三世(#3)</a>
|
41
|
+
```
|
1
追記
test
CHANGED
@@ -6,3 +6,13 @@
|
|
6
6
|
var_dump( $parse );
|
7
7
|
print urldecode($parse["path"]);
|
8
8
|
```
|
9
|
+
|
10
|
+
# 追記
|
11
|
+
パラメータで「ルパン三世(#3)」を渡す
|
12
|
+
```PHP
|
13
|
+
<?PHP
|
14
|
+
print_r($_GET);
|
15
|
+
?>
|
16
|
+
<a href="?q=%E3%83%AB%E3%83%91%E3%83%B3%E4%B8%89%E4%B8%96(%233)">ルパン三世(#3)</a>
|
17
|
+
```
|
18
|
+
上記クリックすると「Array ( [q] => ルパン三世(#3) )」が確認できます
|