Notice: Undefined index: wjs_cookie

w执行顺序。

ok

 1 <!doctype html>
 2 <html>
 3 <head>
 4     <meta charset="UTF-8">
 5 </head>
 6
 7 <body>
 8
 9 <form action="" method="post" id="amz_reviews" style="display: inline;">
10     <button type="submit" name="type"
11             value="amz_reviews" <?php if (!isset($_COOKIE[‘wjs_cookie‘]) || (isset($_COOKIE[‘wjs_cookie‘]) && $_COOKIE[‘wjs_cookie‘] == ‘amz_reviews‘)) echo ‘style=" background-color:red;" ‘; ?>
12             onclick="w(‘amz_reviews‘)">差评
13     </button>
14 </form>
15
16 <form action="" method="post" id="amz_similar_sellers" style="display: inline;">
17     <button type="submit"
18             name="type"   <?php if (isset($_COOKIE[‘wjs_cookie‘]) && $_COOKIE[‘wjs_cookie‘] == ‘amz_similar_sellers‘) echo ‘style=" background-color:red;" ‘; ?>
19             value="amz_similar_sellers"
20             onclick="w(‘amz_similar_sellers‘)">跟卖
21     </button>
22 </form>
23
24 <form action="" method="post" id="amz_listing" style="display: inline;">
25     <button type="submit"
26             name="type"  <?php if (isset($_COOKIE[‘wjs_cookie‘]) && $_COOKIE[‘wjs_cookie‘] == ‘amz_listing‘) echo ‘style=" background-color:red;" ‘; ?>
27             value="amz_listing"
28             onclick="w(‘amz_listing‘)">评分、类目变化
29     </button>
30 </form>
31 </body>
32 </html>
33 <script>
34     document.cookie = ‘wjs_cookie=‘ + ‘amz_reviews‘;
35
36     function w(id) {
37         document.cookie = ‘wjs_cookie=‘ + id;
38         document.getElementById(id).submit();
39     }
40
41     console.log(document.cookie);
42 </script>

ok

 1 <script>
 2     document.cookie = ‘wjs_cookie=‘ + ‘amz_reviews‘;
 3
 4     function w(id) {
 5         document.cookie = ‘wjs_cookie=‘ + id;
 6         document.getElementById(id).submit();
 7     }
 8
 9     console.log(document.cookie);
10 </script>
11 <!doctype html>
12 <html>
13 <head>
14     <meta charset="UTF-8">
15 </head>
16
17 <body>
18
19 <form action="" method="post" id="amz_reviews" style="display: inline;">
20     <button type="submit" name="type"
21             value="amz_reviews" <?php if (!isset($_COOKIE[‘wjs_cookie‘]) || (isset($_COOKIE[‘wjs_cookie‘]) && $_COOKIE[‘wjs_cookie‘] == ‘amz_reviews‘)) echo ‘style=" background-color:red;" ‘; ?>
22             onclick="w(‘amz_reviews‘)">差评
23     </button>
24 </form>
25
26 <form action="" method="post" id="amz_similar_sellers" style="display: inline;">
27     <button type="submit"
28             name="type"   <?php if (isset($_COOKIE[‘wjs_cookie‘]) && $_COOKIE[‘wjs_cookie‘] == ‘amz_similar_sellers‘) echo ‘style=" background-color:red;" ‘; ?>
29             value="amz_similar_sellers"
30             onclick="w(‘amz_similar_sellers‘)">跟卖
31     </button>
32 </form>
33
34 <form action="" method="post" id="amz_listing" style="display: inline;">
35     <button type="submit"
36             name="type"  <?php if (isset($_COOKIE[‘wjs_cookie‘]) && $_COOKIE[‘wjs_cookie‘] == ‘amz_listing‘) echo ‘style=" background-color:red;" ‘; ?>
37             value="amz_listing"
38             onclick="w(‘amz_listing‘)">评分、类目变化
39     </button>
40 </form>
41 </body>
42 </html>

Notice:  Undefined index: wjs_cookie

 1 <script>
 2     document.cookie = ‘wjs_cookie=‘ + ‘amz_reviews‘;
 3
 4     function w(id) {
 5         document.cookie = ‘wjs_cookie=‘ + id;
 6         document.getElementById(id).submit();
 7     }
 8
 9     console.log(document.cookie);
10 </script>
11 <!doctype html>
12 <html>
13 <head>
14     <meta charset="UTF-8">
15 </head>
16
17 <body>
18
19 <form action="" method="post" id="amz_reviews" style="display: inline;">
20     <button type="submit" name="type"
21             value="amz_reviews" <?php if ($_COOKIE[‘wjs_cookie‘] == ‘amz_reviews‘) echo ‘style=" background-color:red;" ‘; ?>
22             onclick="w(‘amz_reviews‘)">差评
23     </button>
24 </form>
25
26 <form action="" method="post" id="amz_similar_sellers" style="display: inline;">
27     <button type="submit"
28             name="type"   <?php if ($_COOKIE[‘wjs_cookie‘] == ‘amz_similar_sellers‘) echo ‘style=" background-color:red;" ‘; ?>
29             value="amz_similar_sellers"
30             onclick="w(‘amz_similar_sellers‘)">跟卖
31     </button>
32 </form>
33
34 <form action="" method="post" id="amz_listing" style="display: inline;">
35     <button type="submit"
36             name="type"  <?php if ($_COOKIE[‘wjs_cookie‘] == ‘amz_listing‘) echo ‘style=" background-color:red;" ‘; ?>
37             value="amz_listing"
38             onclick="w(‘amz_listing‘)">评分、类目变化
39     </button>
40 </form>
41 </body>
42 </html>

Notice:  Undefined index: wjs_cookie

 1 <!doctype html>
 2 <html>
 3 <head>
 4     <meta charset="UTF-8">
 5 </head>
 6 <script>
 7     document.cookie = ‘wjs_cookie=‘ + ‘amz_reviews‘;
 8
 9     function w(id) {
10         document.cookie = ‘wjs_cookie=‘ + id;
11         document.getElementById(id).submit();
12     }
13
14     console.log(document.cookie);
15 </script>
16 <body>
17
18 <form action="" method="post" id="amz_reviews" style="display: inline;">
19     <button type="submit" name="type"
20             value="amz_reviews" <?php if ($_COOKIE[‘wjs_cookie‘] == ‘amz_reviews‘) echo ‘style=" background-color:red;" ‘; ?>
21             onclick="w(‘amz_reviews‘)">差评
22     </button>
23 </form>
24
25 <form action="" method="post" id="amz_similar_sellers" style="display: inline;">
26     <button type="submit"
27             name="type"   <?php if ($_COOKIE[‘wjs_cookie‘] == ‘amz_similar_sellers‘) echo ‘style=" background-color:red;" ‘; ?>
28             value="amz_similar_sellers"
29             onclick="w(‘amz_similar_sellers‘)">跟卖
30     </button>
31 </form>
32
33 <form action="" method="post" id="amz_listing" style="display: inline;">
34     <button type="submit"
35             name="type"  <?php if ($_COOKIE[‘wjs_cookie‘] == ‘amz_listing‘) echo ‘style=" background-color:red;" ‘; ?>
36             value="amz_listing"
37             onclick="w(‘amz_listing‘)">评分、类目变化
38     </button>
39 </form>
40 </body>
41 </html>

Notice:  Undefined index: wjs_cookie

 1 <!doctype html>
 2 <html>
 3 <head>
 4     <meta charset="UTF-8">
 5 </head>
 6 <body>
 7 <script>
 8     document.cookie = ‘wjs_cookie=‘ + ‘amz_reviews‘;
 9
10     function w(id) {
11         document.cookie = ‘wjs_cookie=‘ + id;
12         document.getElementById(id).submit();
13     }
14
15     console.log(document.cookie);
16 </script>
17 <form action="" method="post" id="amz_reviews" style="display: inline;">
18     <button type="submit" name="type"
19             value="amz_reviews" <?php if ($_COOKIE[‘wjs_cookie‘] == ‘amz_reviews‘) echo ‘style=" background-color:red;" ‘; ?>
20             onclick="w(‘amz_reviews‘)">差评
21     </button>
22 </form>
23
24 <form action="" method="post" id="amz_similar_sellers" style="display: inline;">
25     <button type="submit"
26             name="type"   <?php if ($_COOKIE[‘wjs_cookie‘] == ‘amz_similar_sellers‘) echo ‘style=" background-color:red;" ‘; ?>
27             value="amz_similar_sellers"
28             onclick="w(‘amz_similar_sellers‘)">跟卖
29     </button>
30 </form>
31
32 <form action="" method="post" id="amz_listing" style="display: inline;">
33     <button type="submit"
34             name="type"  <?php if ($_COOKIE[‘wjs_cookie‘] == ‘amz_listing‘) echo ‘style=" background-color:red;" ‘; ?>
35             value="amz_listing"
36             onclick="w(‘amz_listing‘)">评分、类目变化
37     </button>
38 </form>
39 </body>
40 </html>
时间: 2024-11-07 12:18:47

Notice: Undefined index: wjs_cookie的相关文章

关于 Notice: Undefined index: 2 in C:\wamp\www\...报错 的解决办法

首先,这个不是错误,是warning. 方法1:服务器配置修改 (Apache服务器中的php.ini配置文件)       修改php.ini配置文件,error_reporting = E_ALL & ~E_NOTICE 方法2:对变量进行初始化,规范书写(比较烦琐,因为有大量的变量). 方法3:每个文件头部加上:error_reporting(0); 如果不行,只有打开php.ini,找到display_errors,设置为display_errors = Off.以后任何错误都不会提示.

PHP问题 —— Notice: Undefined index:

1.1  Notice: Undefined index: login in 1.1.1  现象 访问网页,出现如下错误信息: ( ! ) Notice: Undefined index: login in D:\ProjectWork\SourceCode\Server\osFileManager\index.php on line 59 Call Stack # Time   Memory Function   Location 1 1.0141 919464 {main}( )  ..\i

PHP中出现Notice: Undefined index的三种解决办法

前一段做的一个PHP程序在服务器运行正常,被别人拿到本机测试的时候总是出现“Notice: Undefined index:”这样的警告,这只是一个因为PHP版本不同而产生的警告(NOTICE或者WARNING),而非错误(ERROR).PHP中的变量在不声明的情况下使用的时候,PHP4运行正常,但是到了PHP5环境下就会出现上述的警告或者提示.经过搜索查询,总结出来以下三种解决Notice: Undefined index的方法. 第一种方法:修改PHP配置文件,屏蔽掉此类警告和提示 修改ph

wordpress5.0+中 Notice: Undefined index: HTTP_REFERER 问题解决

都说现在搭网站很简单了,但真遇到问题了还真不一定能解决. 这次搭建的网站是用的wordpress版本5.0.4,以为操作和以前的低版本一样,结果做出来还是遇到问题了. 网站搭好后,首页总在顶端出现一行 Notice: Undefined index: HTTP_REFERER in index.php line 14 点击了其他页面后Notice消失 网上有关于这种情况的解决办法 http://www.manongjc.com/article/1114.html 但是1. 用方法1.3(即关闭报

PHP Notice: Undefined index: ... 问题的解决方法:

首先,这个不是错误,是warning.所以如果服务器不能改,每个变量使用前应当先定义. 方法1:服务器配置修改     修改php.ini配置文件,error_reporting = E_ALL & ~E_NOTICE 方法2:对变量进行初始化,规范书写(比较烦琐,因为有大量的变量).但还没有找到好定义方法,望大家指教 方法3:每个文件头部加上:error_reporting(0); 如果不行,只有打开php.ini,找到display_errors,设置为display_errors = Of

***PHP Notice: Undefined index: ..问题的解决方法

首先,这个不是错误,是warning.所以如果服务器不能改,每个变量使用前应当先定义. 方法1:服务器配置修改     修改php.ini配置文件,error_reporting = E_ALL & ~E_NOTICE 方法2:对变量进行初始化,规范书写(比较烦琐,因为有大量的变量).但还没有找到好定义方法,望大家指教 方法3:每个文件头部加上:error_reporting(0); 如果不行,只有打开php.ini,找到display_errors,设置为display_errors = Of

PHP中Notice: Undefined index: sku in 问题解决方案

这个不是bug,而且warning,当用$_GET[]或$_POST[]时不加isset之类判断的话,就会提示这个错误,Jones建议的解决方案完美解决这个问题: /* * 取代$_GET[]获取值 */ function _get($str) { $val = !empty($_GET[$str]) ? $_GET[$str] : null; return $val; } /* * 取代$_POST[]获取值 */ function _post($str) { $val = !empty($_

Testlink安装:Notice:Undefined index: type in C:\inetpub\wwwroot\testlink-1.9.3\install\installCheck.php on line 41

问题现象: 问题原因:php配置参数中错误提示显示: 问题解决:修改php.ini配置文件,修改为如下: error_reporting = E_ALL & ~E_NOTICE display_errors = Off

php提示undefined index的几种解决方法

平时用$_post[''],$_get['']获取表单中参数时会出现Notice: Undefined index: --------: 我们经常接收表单POST过来的数据时报Undefined index错误,如下: $act=$_POST['action']; 用以上代码总是提示 Notice: Undefined index: act in D:\test\post.php on line 20 另外,有时还会出现 Notice: Undefined variable: Submit ..