我有一个php网站,可以执行两次。当我在config.php文件中说echo hello;
时,它显示“hello”两次我检查了所有循环,但我不明白为什么会发生这种情况,任何人请帮助我解决这个问题。
我真的非常感谢他/她......
这是screenshot
我的Website
提前谢谢
答案 0 :(得分:-1)
<?
session_start();
//include "config.php";
require("config.php");
global $c,$loggedin;
include "data.php";
global $config;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><? echo $config["site_name"]; ?></title>
<link href="templates/ModernBlue/css/global.css" rel="stylesheet" type="text/css" />
<link href="templates/ModernBlue/css/site.css" rel="stylesheet" type="text/css" />
<!--33brushes-styles--><link href="templates/ModernBlue/33brushes-styles/css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="templates/ModernBlue/33brushes-styles/css/33brushes-custom.css" rel="stylesheet" type="text/css" />
<link href="templates/ModernBlue/33brushes-styles/css/jquery.onebyone.css" rel="stylesheet" type="text/css">
<link href="templates/ModernBlue/33brushes-styles/css/example1.css" rel="stylesheet" type="text/css">
<link href="templates/ModernBlue/33brushes-styles/css/animate.css" rel="stylesheet" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Cuprum:400,700' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Raleway:400,600' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,900' rel='stylesheet' type='text/css'>
<link rel="icon" href="favicon.png" type="image/png"/><!--33brushes-styles-->
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.9.1.custom.min.js"></script>
<link href="templates/ModernBlue/css/evolutionscript/jquery-ui-1.9.2.custom.css" rel="stylesheet">
<script type="text/javascript" src="js/evolutionscript.js"></script>
<script type="text/javascript" src="js/l2blockit.js"></script>
<script type="text/javascript" src="templates/ModernBlue/33brushes-styles/js/bootstrap.min.js"></script>
<script type="text/javascript" src="templates/ModernBlue/33brushes-styles/js/bootstrap_custom.js"></script>
<script type="text/javascript" src="templates/ModernBlue/33brushes-styles/js/jquery.onebyone.min.js"></script>
<script type="text/javascript" src="templates/ModernBlue/33brushes-styles/js/jquery.touchwipe.min.js"></script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { $('#slider').oneByOne({ className: 'oneByOne1', easeType: 'random', slideShow: true, slideShowDelay: 5000 }); }); </script>
<? if($_GET['r']){
header('location:cmrf/register.php?r='.$_GET['r']) ;
} ?>
</head><body>
<div class="wrapper"><div class="header-top"> <div class="container">
<a href="index.php"> <div class="logo fl-l"></div> </a>
<div class="header-right"> <div class="top-navi">
<ul class="nav nav-pills fl-l">
<li><a href="login.php" class="login">Member Login</a></li>
<li><a href="register.php" class="register">New Participant List</a></li>
</ul>
</div>
<div class="navigation">
<ul class="nav nav-pills" style="margin-left: 2px;">
<li><a href="index.php" style="border-left: 0px;">Home</a></li>
<li> <a href="login.php">LOGIN </a></li>
<li><a href="register.php">REGISTER </a></li>
<li><a href="sistem.php"> SYSTEM</a></li>
<li><a href="ideologi.php">IDEOLOGY</a></li>
<li><a href="bonus.php">BONUS</a></li>
<li><a href="news.php">NEWS</a></li>
<li><a href="kontak.php">CONTACT</a></li> </ul>
<div class="clear"></div> </div> </div> <!--end header-right--> </div> <!--end container--></div> <!--end header-top-->
<div class="slider-container"> <div class="container"> <div class="slider-content">
<div id="slider">
<div class="oneByOne_item">
<div class="slider-fl1">
<h2>Help To Earn</h2>
<p>The first way to get financial help from PHP Community is by providing help. Currently you will be making 35% in 30 days, calculated daily from the day you pledged to help Someone </p>
</div>
<!--end slider-fl1--> <img src="templates/ModernBlue/33brushes-styles/img/slide1-1.png" class="slide1-1" alt=""></img>
</div> <div class="oneByOne_item">
<div class="slider-fl1">
<h2>OUR GREAT PLAN</h2>
<p>The goal of PHP is today you provide help, tomorrow you may request help when you require for whatever amount. The calculation is just as preventive measure for the parasites of the community from abusing our system.
</p>
</div><!--end slider-fl1--> <img src="templates/ModernBlue/33brushes-styles/img/slide2-1.png" class="slide2-1" alt=""></img>
</div> <div class="oneByOne_item">
<div class="slider-fl1">
<h2>Introduce to Earn !</h2>
<p>Any member can be an introducer, each time your introduced member provide any amount of help, as a normal member you will earn 10% of the amount.
</p>
</div><!--end slider-fl1--> <img src="templates/ModernBlue/33brushes-styles/img/slide3-1.png" class="slide3-1" alt=""></img>
</div> </div>
<div class="clear"></div>
<div class="more-ways">Achieve Success with EASY!!</div> </div> <!--end slider-content-->
</div> <!--end container--> </div> <!--end slider-container-->
<!-- End Content -->
</div><!--end main-content--> <div class="footer-top"> <div class="container">
<div class="span6">
<a href="index.php">Home</a> •
<a href="login.php">Login</a> •
<a href="register.php">Register</a> •
<a href="sistem.php"> System</a> •
<a href="ideologi.php">Ideology</a> •
<a href="bonus.php">Bonus</a> •
<a href="kontak.php">Contact</a> </div>
<div class="social-logos"><br>Copyright © 2016/17 <? echo $config["site_name"]; ?> All rights reserved. </div> </div> <!--end container--></div>
</div> <!--end wrapper--></body>
</html>
config.php
<?php
$dhost = "localhost"; // Isi dengan localhost
$dusername = ""; // database user
$dpassword = ""; // database pass
$ddatabase = ""; // database name
date_default_timezone_set("Africa/Johannesburg");
$con = mysql_connect($dhost, $dusername, $dpassword) or die("Cannot Connect");
mysql_select_db($ddatabase, $con);
if($_COOKIE["usNick"] and $_COOKIE["usPass"])
{
$q = mysql_query("SELECT * FROM tb_users WHERE username='{$_COOKIE['usNick']}' AND password='{$_COOKIE['usPass']}'") or die(mysql_error());
if(mysql_num_rows($q) == 0)
{
$_COOKIE['usNick'] = false;
$_COOKIE['usPass'] = false;
} else {
$loggedin = 1;
$r = mysql_fetch_array($q);
}
}
$da = date("j");
$user=$_COOKIE['usNick'];
mysql_query("UPDATE tb_jual SET status='Success' WHERE saldo='0'") or die(mysql_error());
mysql_query("UPDATE tb_beli SET status='Success' WHERE verify!=''") or die(mysql_error());
$skrg=time();
$query="select * from tb_beli where dpro < '$skrg' and status='Success' and spro=''";
$result=mysql_query($query);
while ($row=mysql_fetch_array($result)) {
$namauser=$row["username"];
$duitc=$row["jpro"];
$idlo=$row["id"];
mysql_query("UPDATE tb_users SET money=money+'$duitc' WHERE username='$namauser'") or die(mysql_error());
mysql_query("UPDATE tb_beli SET spro='berhasil' where id='$idlo'") or die(mysql_error());
}
/*****************GH match with balance*********************/
echo 'hellooooooooooooo';
include_once("function.php");
$pak = $_GET['pak'];
$saldo_arr = array(1,2,3,4,5,6,7,8,9,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,150,200,250,300,350,400,450,500,600,700,800,900,1000);
for($i=0;$i<count($saldo_arr);$i++)
{
$saldooo = $saldo_arr[$i];
$tablaa = mysql_query("SELECT * FROM tb_jual where status='pending' and saldo!='0' and saldo='$saldooo' and username!='$kurirz' ORDER BY id ASC limit 0,1");
$registroo = mysql_fetch_array($tablaa);
$saldo_match = 0;
$kurir=$registroo["username"];
$biaya=$registroo["saldo"];
$idnya=$registroo["id"];
$pakt=$registroo["paket"];
$skrg=time();
$exp=$skrg+245600;
$sms = mysql_query("SELECT * FROM tb_beli where status='pending' and referer='' and saldo='$biaya' ORDER BY id ASC limit 0,1");
while($registroo1 = mysql_fetch_array($sms)){
$saldo_match = 1;
$kurirz=$registroo1["username"];
$idnyaz=$registroo1["id"];
$pake=$registroo1["paket"];
mysql_query("UPDATE tb_beli SET referer='$kurir', iddb='$idnya', exp='$exp' where status='pending' and id='$idnyaz' ") or die(mysql_error());
mysql_query("UPDATE tb_jual SET status='Waiting for transfer' where id='$idnya'") or die(mysql_error());
}
}
$pak1 = $pak/100;
/* for($n=0;$n<count($saldo_arr);$n++)
{
$saldoe = $saldo_arr[$n];
$tablae = mysql_query("SELECT * FROM tb_jual where status='pending' and saldo!='0' and saldo='$saldoe' and username!='$kurirz' ORDER BY id ASC limit 0,1");
$registroe = mysql_fetch_array($tablae);
//echo $biaya; */
if($saldo_match == 0){
$number = $pak1;
//echo $number.'hii';
if($number>1 && $number<10)
{
$n = 2;
}
elseif($number>10 && $number<100)
{
$n=5;
}
elseif($number>100 && $number<1000)
{
$n=5;
}
$multiple = 1;
$values = get($number, $n, $multiple);
print_r($values);
for($v=0;$v<count($values);$v++){
}
/* $sal = $values[$v];
$query_notmatch = mysql_query("SELECT * FROM tb_beli where status='pending' and referer='' and saldo='$sal' and existed='0' order by id ASC");
$registroo2 = mysql_fetch_row($query_notmatch);
$kurirz=$registroo2[1];
$idnyaz=$registroo2[0];
$pake=$registroo2[5];
$saldoz=$registroo2[6];
if(!$saldoz)
{
$saldoz=0;
echo $saldoz.'hii';
}
$skrg=time();
$exp=$skrg+245600;
if($saldoz!=$sal){
echo "hello123";
$pakett= $sal*100;
$user=$_COOKIE["usNick"];
$nama=$registroo["nama"];
$email=$registroo["email"];
$bank=$registroo["bank"];
$norek=$registroo["norek"];
$phone=$registroo["phone"];
$paket=$sal*100;
$laip = $_SERVER['REMOTE_ADDR'];
$eltiempo=time();
$query = "INSERT INTO tb_jual (username, bank, norek, nama, paket, saldo, phone, email, status, date, ip) VALUES('$user','$bank','$norek','$nama','$paket', '$sal', '$phone', '$email', 'pending','$eltiempo','$laip')";
mysql_query($query) or die(mysql_error());
echo $paket;
mysql_query("UPDATE tb_jual SET status='pending', paket='$pakett', saldo='$sal' where id='$idnya'") or die(mysql_error());
}
else{
mysql_query("UPDATE tb_beli SET referer='$kurir', iddb='$idnya', exp='$exp' , existed='1' where status='pending' and id='$idnyaz'") or die(mysql_error());
mysql_query("UPDATE tb_jual SET status='Waiting for transfer', saldo='$sal' where id='$idnya'") or die(mysql_error());
} */
}
/* } */
/*********************************/
$skrg=time();
$queryf="select * from tb_beli where exp < '$skrg' and exp != '' and status='pending'";
$result=mysql_query($queryf);
while ($rowf=mysql_fetch_array($result)) {
$namaibu=$rowf["username"];
$idbu=$rowf["id"];
$idkol=$rowf["iddb"];
$paket=$rowf["paket"];
mysql_query("DELETE from tb_beli WHERE id='$idbu'") or die(mysql_error());
mysql_query("UPDATE tb_users SET suspend='1' WHERE username='$namaibu'") or die(mysql_error());
mysql_query("UPDATE tb_jual SET status='pending', date='$skrg' WHERE id='$idkol'") or die(mysql_error());
/**************sms send match******************/
/* $sms = mysql_query("SELECT * FROM tb_beli where status='pending' and referer='' and paket='$paket' order by id ASC limit 0,1");
while($sms_values = mysql_fetch_array($sms))
{
$phone=$sms_values['phone'];
$namew= $sms_values['username'];
$username_sms = urlencode("Bluejack");
$password_sms= urlencode("YUS@7860");
$api_id = urlencode("3610145");
$to = urlencode($phone);
$message = urlencode("Dear $namew,
Your order on PHP Community Stokvel is out, Please log in your system for further instructions
,Thank you
");
?>
<div class="sms">
<?php echo file_get_contents("http://www.mymobileapi.com/api5/http5.aspx?Type=sendparam&username=$username_sms&password=$password_sms&numto=$to&data1=$message");
?>
</div>
<? } *//******************End sms********************************/
}
$tablaqa = mysql_query("SELECT * FROM tb_config where item='bintanga'");
while ($registroqa = mysql_fetch_array($tablaqa)) {
$duitq=$registroqa["price"];
$tabla = mysql_query("SELECT * FROM tb_users where referals >=$reffq and jdb >=$duitq and ba=''");
while ($registro = mysql_fetch_array($tabla)) {
$kurire=$registro["referer"];
$idnya=$registro["id"];
mysql_query("UPDATE tb_users SET bintang='1', ba='ok' where id='$idnya'") or die(mysql_error());
mysql_query("UPDATE tb_users SET b1=b1+1 where username='$kurire'") or die(mysql_error());
}}
$tablaq = mysql_query("SELECT * FROM tb_config where item='bintang2'");
while ($registroq = mysql_fetch_array($tablaq)) {
$reffq=$registroq["price"];
$tabla = mysql_query("SELECT * FROM tb_users where b1 >=$reffq and bi=''");
while ($registro = mysql_fetch_array($tabla)) {
$kurire=$registro["referer"];
$idnya=$registro["id"];
mysql_query("UPDATE tb_users SET bintang='2', bi='ok' where id='$idnya'") or die(mysql_error());
mysql_query("UPDATE tb_users SET b2=b2+1 where username='$kurire'") or die(mysql_error());
}
}
$tablaq = mysql_query("SELECT * FROM tb_config where item='bintang3'");
while ($registroq = mysql_fetch_array($tablaq)) {
$reffq=$registroq["price"];
$tabla = mysql_query("SELECT * FROM tb_users where b2 >=$reffq and bu=''");
while ($registro = mysql_fetch_array($tabla)) {
$kurire=$registro["referer"];
$idnya=$registro["id"];
mysql_query("UPDATE tb_users SET bintang='3', bu='ok' where id='$idnya'") or die(mysql_error());
mysql_query("UPDATE tb_users SET b3=b3+1 where username='$kurire'") or die(mysql_error());
}
}
$tablaq = mysql_query("SELECT * FROM tb_config where item='bintang4'");
while ($registroq = mysql_fetch_array($tablaq)) {
$reffq=$registroq["price"];
$tabla = mysql_query("SELECT * FROM tb_users where b3 >=$reffq and be=''");
while ($registro = mysql_fetch_array($tabla)) {
$kurire=$registro["referer"];
$idnya=$registro["id"];
mysql_query("UPDATE tb_users SET bintang='4', be='ok' where id='$idnya'") or die(mysql_error());
mysql_query("UPDATE tb_users SET b4=b4+1 where username='$kurire'") or die(mysql_error());
}
}
$tablaq = mysql_query("SELECT * FROM tb_config where item='bintang5'");
while ($registroq = mysql_fetch_array($tablaq)) {
$reffq=$registroq["price"];
$tabla = mysql_query("SELECT * FROM tb_users where b4 >=$reffq and bo=''");
while ($registro = mysql_fetch_array($tabla)) {
$kurire=$registro["referer"];
$idnya=$registro["id"];
mysql_query("UPDATE tb_users SET bintang='5', bo='ok' where id='$idnya'") or die(mysql_error());
mysql_query("UPDATE tb_users SET b5=b5+1 where username='$kurire'") or die(mysql_error());
}
}
$tablaq = mysql_query("SELECT * FROM tb_config where item='bintang6'");
while ($registroq = mysql_fetch_array($tablaq)) {
$reffq=$registroq["price"];
$tabla = mysql_query("SELECT * FROM tb_users where b5 >=$reffq and bz=''");
while ($registro = mysql_fetch_array($tabla)) {
$kurire=$registro["referer"];
$idnya=$registro["id"];
mysql_query("UPDATE tb_users SET bintang='6', bz='ok' where id='$idnya'") or die(mysql_error());
mysql_query("UPDATE tb_users SET b6=b6+1 where username='$kurire'") or die(mysql_error());
}
}
$tablaq = mysql_query("SELECT * FROM tb_config where item='bintang7'");
while ($registroq = mysql_fetch_array($tablaq)) {
$reffq=$registroq["price"];
$tabla = mysql_query("SELECT * FROM tb_users where b6 >=$reffq and bx=''");
while ($registro = mysql_fetch_array($tabla)) {
$kurire=$registro["referer"];
$idnya=$registro["id"];
mysql_query("UPDATE tb_users SET bintang='7', bx='ok' where id='$idnya'") or die(mysql_error());
}
}
?>