質問編集履歴

3

再編集

2024/03/26 08:23

投稿

eisaku123
eisaku123

スコア75

test CHANGED
File without changes
test CHANGED
@@ -20,9 +20,9 @@
20
20
  // myHeaders.append("Cookie", "PHPSESSID=itjgsbmsjf5sk87oh25rijhsn6");
21
21
 
22
22
  const formdata = new FormData();
23
- formdata.append("user_name", "menjou");
23
+ formdata.append("user_nane", "dummy");
24
- formdata.append("company_code", "Z100");
24
+ formdata.append("compay_code", "Z100");
25
- formdata.append("employee_code", "7878787888");
25
+ formdata.append("employe_code", "7878787888");
26
26
  formdata.append("user_type", "0");
27
27
 
28
28
  const requestOptions = {
@@ -32,7 +32,7 @@
32
32
  redirect: "follow"
33
33
  };
34
34
 
35
- fetch("http://192.168.124.198/connect.php", requestOptions)
35
+ fetch("http://*.*.*.*/conect.php", requestOptions)
36
36
  .then((response) => response.text())
37
37
  .then((result) => console.log(result))
38
38
  .catch((error) => console.error(error));
@@ -52,12 +52,12 @@
52
52
  $method = $_SERVER['REQUEST_METHOD'];
53
53
  session_start();
54
54
  if ($method == "POST") {
55
- $_SESSION['user_name'] = $_POST['user_name'];
55
+ $_SESSION['usr_name'] = $_POST['user_name'];
56
56
  $_SESSION['company_code'] = $_POST['company_code'];
57
- $_SESSION['employee_code'] = $_POST['employee_code'];
57
+ $_SESSION['employe_code'] = $_POST['employee_code'];
58
58
  $_SESSION['user_type'] = $_POST['user_type'];
59
59
 
60
- // header('Location: connect.php');
60
+ // header('Location: conect.php');
61
61
  // exit;
62
62
  }
63
63
 

2

タイトル編集

2024/03/26 03:19

投稿

eisaku123
eisaku123

スコア75

test CHANGED
@@ -1 +1 @@
1
- POST(fetch)で送った同時に次のページに遷移させたい
1
+ fetch(POST)で送った同時に次のページに遷移させたい
test CHANGED
File without changes

1

補足追記

2024/03/26 03:03

投稿

eisaku123
eisaku123

スコア75

test CHANGED
File without changes
test CHANGED
@@ -95,4 +95,5 @@
95
95
  window.location.href = 'http://localhost/connect.php';
96
96
 
97
97
  ### 補足
98
+ まずは同ホストないですが
98
-
99
+ 最終的は別ホストで実現たい