服务器更改后,脚本无法识别登录用户

时间:2016-02-15 06:22:58

标签: php mediawiki

我有一个自定义脚本,一直运行良好,直到我更改了服务器。脚本正在连接到数据库,但由于某种原因无法识别用户是否已登录到维基媒体。

认为这将是一个快速修复,但在阅读了本页中的每一行后,问题是什么并不明显。

用户仍然可以正常登录维基媒体,但此自定义脚本的反应就像用户未登录一样。

任何指针都会很棒。谢谢你花时间看。

页面输出

  

“请登录说明.xxxxx.com然后您可以提交您的广告   代码“

<?php
$uid=$_COOKIE['zencuben_ovinstr_instr_UserID'];
$uname=$_COOKIE['zencuben_ovinstr_instr_UserName'];

$con = mysqli_connect("localhost","my_user","my_pass","my_db) or die("Some error occurred");

if(isset($_REQUEST['submit']))
{
if($_REQUEST['zid']){
        $code=$_REQUEST['zid'];
        $_script="<script src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
        <link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css'>
        <script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js'></script>
        <link href='http://advertising.oxxmo.com/style/video-js.min.css' rel='stylesheet' type='text/css'>
        <script type='text/javascript' src='http://advertising.xxxxo.com/js/videojs-ie8.min.js'></script><!-- Exclude this if you do not need ie8 support -->
        <script type='text/javascript' src='http://advertising.oxxo.com/js/video.min.js'></script>
        <script>
        videojs.options.flash.swf = 'http://advertising.oxxx.com/images/video-js.swf';
        </script>
        <script language='JavaScript' src='http://advertising.xxxx.com/show-ad.php?zid=".$code."'></script>";
    }else{
        $_script=$_REQUEST['ccode'];
    }

if($uid!='')
{
$check="select * from `videos_ins` where `user_id`='".$uid."'";
$chk_query=mysqli_num_rows(mysqli_query($con, $check));
if($chk_query>0)
{
$strSQL = "update `videos_ins`  SET `video_code`='".addslashes($_script)."' where `user_id`='".$uid."'";
$ins_code=mysqli_query($con, $strSQL);
if($ins_code)
{
echo "<font color='green'><b>Your code for video is updated</b></font>";
}
else
{
echo "<font color='red'><b>Your code for video is not updated</b></font>";
}
}
else
{
$value = "user_id='".$uid."',
          user_name='".$uname."',
          video_code = '".addslashes($_script)."'";

$strSQL = "INSERT INTO `videos_ins`  SET ".$value."";
//echo "INSERT INTO `videos`  SET ".$value."";
$ins_code=mysqli_query($con, $strSQL);
if($ins_code)
{
echo "<font color='green'><b>Your code for video is added</b></font>";
}
else
{
echo "<font color='red'><b>Your code for video is not added</b></font>";
}
}
}
else
{
echo "<font color='green'><b>Please login to <a href='http://instructions.xxxx.com' target='_blank'>instructions.xxxx.com</a> then you can submit your AD code</b></font>";
}
}                   
?>
<?php
$check="select * from `videos_ins` where `user_id`='".$uid."'";
$chk_query=mysqli_fetch_array(mysqli_query($con, $check));
?>
<script type="text/javascript" src="http://xxxx.com/jq.js"></script>
<br>
<b>Enter Video code here</b><br /><br />
<!--<input type="radio" name="text_control" id="show_text" checked="checked">ZID<br>
<input type="radio" name="text_control" id="show_textarea">COMPLETE CODE<br><br>-->


<script>
$( "#show_text" ).click(function() {
    $( "#ccode" ).hide( 1000 );
    $( "#ccode" ).removeAttr('required','required');
    $( "#zid" ).attr('required','required');
    $( "#zid" ).show( "slow" );
});
$( "#show_textarea" ).click(function() {
    $( "#zid" ).hide( 1000 );
    $( "#zid" ).removeAttr('required','required');
    $( "#ccode" ).attr('required','required');
    $( "#ccode" ).show( "slow" );
});
 </script>
<form method="post" action="" enctype="multipart/form-data">

<input type="text" id="zid" name="zid" required="required" maxlength="10" placeholder="MAX 10 CHAR">
    <textarea id="ccode" name="ccode" style="display:none;" rows="9" cols="40"></textarea><br><br>
<input  type="submit" name="submit" value="Submit AD Code"/><br /><br /><br />

<font color="#00CC66"><b>Submitted AD code</b></font><br />
<textarea name="sv" rows="9" cols="40" spellcheck="false"><?=$chk_query['video_code']?></textarea>

</form>

0 个答案:

没有答案