小编use*_*251的帖子

通过单击更改php会话值

我想通过点击为会话赋值

我试图这样做,但它不起作用:

<?php session_start(); 
$_SESSION['role']="";?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
<title></title>
<link href="auth-buttons.css" rel="stylesheet" />
<link href="StyleSheet.css" rel="stylesheet" />
   </head>
<body>

<div id="wrap">
<div id="wrapHome">
<p><a class="btn-auth btn-facebook large" href="redirect.php" onclick="<?php $_SESSION['role']="facebook" ?>" > Sign in with <b>Facebook</b> </a></p>

<p><a class="btn-auth btn-twitter large" href="redirect.php" onclick="<?php $_SESSION['role']="twitter" ?>" > Sign in with <b>Twitter</b> </a></p>

<p><a class="btn-auth btn-google large" href="redirect.php" onclick="<?php $_SESSION['role']="google" ?>" > Sign in with <b>Google</b> </a></p>
</div>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

php session redirect session-variables

4
推荐指数
1
解决办法
3万
查看次数

node js error - 发送后无法发送标头

我正在使用ebay-api用于node-js,当我因某种原因刷新页面时出现错误.在控制台日志中,我收到"无法在发送后发送标头"的错误.这是我的代码,你可以弄清楚为什么我在刷新时"在发送后发送标题"?

// example simple request to FindingService:findItemsByKeywords

var ebay = require('../index.js');
var http = require('http');

var express = require('express');
var app = express();
var io = require('socket.io');


app.set('port', process.env.PORT || 5000);

app.get('/getEbay', function (req, res) {
    console.log('inside get');
    //  for avoiding crossbrowser-error
    res.header('Access-Control-Allow-Origin', '*');
    res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
    res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization');
    res.header('Content-Type', 'application/json');
    var params = {};

    params.keywords = ["cat"];
    params['paginationInput.entriesPerPage'] = 10;
    ebay.ebayApiGetRequest({
        serviceName: 'FindingService',
        opType: 'findItemsByKeywords',
        appId: 'MYAPPID',      // FILL IN YOUR OWN APP KEY, GET ONE HERE: https://publisher.ebaypartnernetwork.com/PublisherToolsAPI
        params: …
Run Code Online (Sandbox Code Playgroud)

javascript node.js ebay-api

1
推荐指数
1
解决办法
913
查看次数