当前位置: 首页>>代码示例>>PHP>>正文


PHP redirection函数代码示例

本文整理汇总了PHP中redirection函数的典型用法代码示例。如果您正苦于以下问题:PHP redirection函数的具体用法?PHP redirection怎么用?PHP redirection使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了redirection函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: connexionFB

 public function connexionFB($fid, $m = NULL)
 {
     sleep(1);
     $fid = safe($fid, 'SQL');
     $this->_db->query('SELECT * FROM habbophp_users_facebook WHERE fid=' . safe($fid, 'SQL'));
     if ($this->_db->NumRowsC() == 1) {
         $data = $this->_db->getQuery(true);
         $dataUser = $this->_db->query('SELECT username,id,rank FROM users WHERE id="' . safe($data['uid'], 'SQL') . '"', true, false);
         if ($m == true && $dataUser['rank'] < 6) {
             $this->logout();
             redirection($config->url_site . '/maintenance.php');
         }
         $this->isBan($dataUser['username']);
         //$this->checkIPStaff($dataUser['username'],$dataUser['rank']);
         $this->setSaltUsers($data['uid']);
         @setcookie('Auth', $this->getSaltUsers($dataUser['id']), time() + 12 * 3600);
         $_SESSION['uid'] = $data['uid'];
         $_SESSION['Rank'] = $dataUser['rank'];
         $_SESSION['FB'] = true;
         $_SESSION['Auth'] = true;
         $_SESSION['Timeout'] = time() + 3 * 3600;
         $d = date('Y-m-d');
         $this->_db->query('UPDATE habbophp_stats SET connexions=connexions+1 WHERE date="' . $d . '"');
         $this->setLast_online($data['uid']);
         $this->setIP_last($data['uid']);
         return true;
     } else {
         return false;
     }
 }
开发者ID:habb0,项目名称:HabboPHP,代码行数:30,代码来源:class.auth.php

示例2: microshell

function microshell()
{
    $fd = fopen('php://stdin', 'r');
    if ($fd !== false) {
        echo "\$> ";
        $params[0] = "";
        while ($params[0] != "exit" && ($line = fgets($fd))) {
            $params = commande_to_tab($line);
            if (isset($params[0])) {
                $ptr = 'func_' . $params[0];
                if (is_redirection($params) == 1) {
                    redirection($params);
                } else {
                    if (function_exists($ptr)) {
                        $ptr($params);
                    } else {
                        if ($params[0] == "exit") {
                        } else {
                            echo "{$params[0]}: Command not found\nUse \"help\"";
                            echo " for a list of commands\n";
                        }
                    }
                }
                if ($params[0] != "exit") {
                    echo "\$> ";
                }
            }
        }
        fclose($fd);
    }
}
开发者ID:TristanMarion,项目名称:MicroShell,代码行数:31,代码来源:MicroShell.php

示例3: checkMaintenance

 public function checkMaintenance()
 {
     if (isset($this->maintenance)) {
         $m = $this->maintenance;
         if ($m == 'true' && $_SESSION['Rank'] < 5) {
             session_destroy();
             redirection($this->url_site . '/maintenance.php');
         } else {
             return false;
         }
     }
 }
开发者ID:habb0,项目名称:HabboPHP,代码行数:12,代码来源:class.config.php

示例4: func_redir

function func_redir($line)
{
    $tabtest = array();
    preg_match("/([^>]*) >+ (.*)/", $line, $tabtest);
    if (count($tabtest) != 3) {
        echo "Syntax is wrong\n";
    } else {
        if (is_dir($tabtest[2]) || $tabtest[2][len($tabtest[2]) - 1] == '/') {
            echo "content.php: {$tabtest[2]}: Is a directory\n";
        } else {
            if (file_exists($tabtest[2]) && !is_writable($tabtest[2])) {
                echo "content.php: {$tabtest[2]}: Permission denied\n";
            } else {
                redirection($tabtest);
            }
        }
    }
}
开发者ID:amira-s,项目名称:etna-projects,代码行数:18,代码来源:func_redir.php

示例5: checkVIP

 public function checkVIP()
 {
     if ($this->_parent->vip == 1 && $this->_parent->rank == 2 && !empty($this->_parent->id)) {
         $query = $this->_db->query("SELECT * FROM habbophp_users_vip WHERE uid=" . $this->_parent->id . "", true);
         if ($query) {
             foreach ($query as $row) {
                 $expire = $row['expire'];
                 if (time() > $row['expire']) {
                     $this->_parent->updateUser('rank', 1);
                     $this->_parent->updateUser('vip', 0);
                 }
             }
         }
         if (!isset($expire)) {
             $vipDB = new Db('habbophp_users_vip');
             $data = array('uid' => $this->_parent->id, 'expire' => time() + 3600 * 24 * 1 * 7);
             $vipDB->save($data);
             redirection('me.php');
         }
     }
 }
开发者ID:habb0,项目名称:HabboPHP,代码行数:21,代码来源:class.usersphoenix.php

示例6: traiter_form_rssconf

function traiter_form_rssconf()
{
    $msg_param_to_trim = isset($_GET['msg']) ? '&msg=' . $_GET['msg'] : '';
    $query_string = str_replace($msg_param_to_trim, '', $_SERVER['QUERY_STRING']);
    // traitement
    $GLOBALS['db_handle']->beginTransaction();
    foreach ($GLOBALS['liste_flux'] as $i => $feed) {
        if (isset($_POST['i_' . $feed['checksum']])) {
            // feed marked to be removed
            if ($_POST['k_' . $feed['checksum']] == 0) {
                unset($GLOBALS['liste_flux'][$i]);
                try {
                    $req = $GLOBALS['db_handle']->prepare('DELETE FROM rss WHERE bt_feed=?');
                    $req->execute(array($feed['link']));
                } catch (Exception $e) {
                    die('Error : Rss?conf RM-from db: ' . $e->getMessage());
                }
            } else {
                // title has change
                $GLOBALS['liste_flux'][$i]['title'] = $_POST['i_' . $feed['checksum']];
                // folder has changed : update & change folder where it must be changed
                if ($GLOBALS['liste_flux'][$i]['folder'] != $_POST['l_' . $feed['checksum']]) {
                    $GLOBALS['liste_flux'][$i]['folder'] = $_POST['l_' . $feed['checksum']];
                    try {
                        $req = $GLOBALS['db_handle']->prepare('UPDATE rss SET bt_folder=? WHERE bt_feed=?');
                        $req->execute(array($_POST['l_' . $feed['checksum']], $feed['link']));
                    } catch (Exception $e) {
                        die('Error : Rss?conf Update-feed db: ' . $e->getMessage());
                    }
                }
                // URL has change
                if ($_POST['j_' . $feed['checksum']] != $GLOBALS['liste_flux'][$i]['link']) {
                    $a = $GLOBALS['liste_flux'][$i];
                    $a['link'] = $_POST['j_' . $feed['checksum']];
                    unset($GLOBALS['liste_flux'][$i]);
                    $GLOBALS['liste_flux'][$a['link']] = $a;
                    try {
                        $req = $GLOBALS['db_handle']->prepare('UPDATE rss SET bt_feed=? WHERE bt_feed=?');
                        $req->execute(array($_POST['j_' . $feed['checksum']], $feed['link']));
                    } catch (Exception $e) {
                        die('Error : Rss?conf Update-feed db: ' . $e->getMessage());
                    }
                }
            }
        }
    }
    $GLOBALS['db_handle']->commit();
    // sort list with title
    $GLOBALS['liste_flux'] = array_reverse(tri_selon_sous_cle($GLOBALS['liste_flux'], 'title'));
    file_put_contents($GLOBALS['fichier_liste_fluxrss'], '<?php /* ' . chunk_split(base64_encode(serialize($GLOBALS['liste_flux']))) . ' */');
    $redir = basename($_SERVER['PHP_SELF']) . '?' . $query_string . '&msg=confirm_feeds_edit';
    redirection($redir);
}
开发者ID:CamTosh,项目名称:blogotext,代码行数:53,代码来源:sqli.php

示例7: get_string

	        	<li>
	        		<a class="regular_btn" href="#" onclick="javascript:top.location='<?php 
    echo $cancelUrl;
    ?>
';">
	        			<span style="width: 110px;"><?php 
    echo get_string('validationElement_cancel', 'voiceboard');
    ?>
</span>
	        		</a>
	        	</li>
		        <li>
		        	<input type="submit" class="regular_btn-submit" onclick="javascript:submitGradeForm('manageAction.php','submitGrade','<?php 
    echo $urlParams;
    ?>
')" value="<?php 
    echo get_string('validationElement_saveAll', 'voiceboard');
    ?>
"/>
		        </li>
        	</ul>
        </div>
        
        	</form>  
</div>     
<?php 
} else {
    redirection($redirectionUrl . '&error=session');
}
?>
     
开发者ID:nagyistoce,项目名称:moodle-Teach-Pilot,代码行数:30,代码来源:grades.php

示例8: mysql_query

</div>



</div>
		<div class="clear"></div>
		</div>
	</div>
</div>
</div>
<!--end of friends-->';
    $i++;
    $tpl->assign('widgets', $widgets);
    $tpl->assign('homeid', $roww['id']);
}
if (isset($_GET['username']) == $user->username) {
    $req = mysql_query('SELECT id FROM habbophp_home_widget WHERE userid="' . safe($user->id, 'SQL') . '"');
    $num = mysql_num_rows($req);
    if ($num == 0 && $i == 0) {
        mysql_query("INSERT INTO habbophp_home_widget VALUES (''," . $idhome . ",'','w_skin_goldenskin',10,10,1,1,'w_skin_goldenskin',350,100,1,1,'','w_skin_goldenskin',10,500,1,1,'w_skin_goldenskin',350,420,1,1,'w_skin_goldenskin',10,600,1,1,'w_skin_goldenskin',400,600,1,1,'w_skin_goldenskin',400,800,1)");
        $tpl->assign('widgets', "");
        redirection('home.php?username=' . safe($_GET['username'], 'HTML'));
    }
    if ($i == 0 and isset($_GET['username']) or isset($_GET['id'])) {
        $tpl->assign('widgets', "");
    }
}
$tpl->display('header.tpl');
$tpl->display('home.tpl');
$tpl->display('footer.tpl');
开发者ID:habb0,项目名称:HabboPHP,代码行数:30,代码来源:home.php

示例9: session_start

<?php

session_start();
define('CORE', 'CORE');
$admin = true;
include "../../includes/core.php";
if (!$Auth->isConnected()) {
    redirection('/logout.php');
}
if ($user->rank < 7) {
    exit;
}
$ii = 0;
$query = $db->quert("SELECT * FROM habbophp_shop_stats ORDER BY id DESC LIMIT 15", true);
foreach ($query as $row) {
    echo '' . date("Y, m, d", strtotime($row['date'])) . ';' . $row['value'] . '\\n';
}
开发者ID:habb0,项目名称:HabboPHP,代码行数:17,代码来源:generate_stats_shop.php

示例10: fputs

    $txn_id = $_POST['txn_id'];
    $receiver_email = $_POST['receiver_email'];
    $payer_email = $_POST['payer_email'];
    if ($receiver_email == $config->paypalemail && $config->paypalprice == $payment_amount) {
        if (!$fp) {
            // HTTP ERROR
        } else {
            fputs($fp, $header . $req);
            while (!feof($fp)) {
                $res = fgets($fp, 1024);
                if (strcmp($res, "VERIFIED") == 0) {
                    if ($payment_status == "Completed") {
                        $Jetons_authorized = array($config->starpassamount, $config->allopassamount, $config->paypalamount);
                        $user->addJetons('paypal');
                        addLogsPaiement($user->username, 'paypal');
                        redirection($config->url_site . '/shop.php?success');
                    }
                } else {
                    if (strcmp($res, "INVALID") == 0) {
                        redirection($config->url_site . '/shop.php?error');
                    }
                }
            }
            fclose($fp);
        }
    } else {
        redirection($config->url_site . '/shop.php?error');
    }
} else {
    redirection($config->url_site . '/shop.php?error');
}
开发者ID:habb0,项目名称:HabboPHP,代码行数:31,代码来源:Paypal_paiementValide.php

示例11: redirection

<?php

#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|
#|                                                                        #|
#|         HABBOPHP - http://habbophp.com                                 #|
#|         Copyright © 2012 Valentin & Robin. All rights reserved.        #|
#|																		  #|
#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|
require 'init.php';
if (!isset($_GET['amoutMethod'])) {
    redirection($config->url_site . '/shop.php?errorPaiement');
}
$amoutMethod = array('starpass', 'paypal', 'allopass');
if (!in_array($_GET['amoutMethod'], $amoutMethod)) {
    redirection($config->url_site . '/shop.php?errorPaiement');
}
//La méthode de paiement n'exsite pas
$am = $_GET['amoutMethod'];
switch ($am) {
    case "paypal":
        $tpl->assign('MethodPrice', array('amout' => $config->paypalamount, 'price' => $config->paypalprice, 'type' => $am));
        break;
    case "starpass":
        $tpl->assign('MethodPrice', array('amout' => $config->starpassamount, 'price' => '1 Code', 'type' => $am));
        break;
    case "allopass":
        $tpl->assign('MethodPrice', array('amout' => $config->allopassamount, 'price' => '1 Code', 'type' => $am));
        $allopassData = explode("/", $config->allopassauth);
        $tpl->assign('allopass', $allopassData);
        break;
}
开发者ID:habb0,项目名称:HabboPHP,代码行数:31,代码来源:paiement.php

示例12: session_start

#|																		  #|
#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|
session_start();
define('CORE', 'CORE');
require 'includes/core.php';
$Error = new Error();
if (isset($_POST['username'])) {
    if (isset($_POST['username']) && empty($_POST['username'])) {
        $Error->set('pseudo', $tpl->assign('error_login_pseudo', 'true'));
    }
    if (isset($_POST['password']) && empty($_POST['password'])) {
        $Error->set('password', $tpl->assign('error_login_password', 'true'));
    }
    if (!$Error->ErrorPresent()) {
        if ($Auth->connexion($_POST, true)) {
            redirection($config->url_site . '/me.php');
        } else {
            $Error->set('AuthFalse', 'Connexion impossible');
        }
    }
}
?>
<!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" xml:lang="fr" lang="fr" xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<title><?php 
echo $config->name;
?>
 - Maintenance Break</title>
开发者ID:habb0,项目名称:HabboPHP,代码行数:31,代码来源:maintenance.php

示例13: ludo_exemplaires

            }
            // On va chercher en BD les infos sur un éventuel exemplaire qui porterait déjà ce code barre
            $bypassVerifCB = false;
            if ($postCodeBarre) {
                $sql = 'SELECT * FROM ludo_exemplaires WHERE code_barre = :cb AND code_barre IS NOT NULL;';
                $requete = $bd->prepare($sql);
                $requete->execute(array(':cb' => $postCodeBarre));
                $infosEx = $requete->fetchAll(PDO::FETCH_ASSOC);
            } else {
                $bypassVerifCB = true;
            }
            if ($bypassVerifCB || count($infosEx) == 0) {
                // Ok, pas d'exemplaire qui porte ce code barre en BD ! On ajoute ...
                $sql = 'INSERT INTO  ludo_exemplaires (idJeu, code_barre, commentaire)  VALUES (:jeu, :cb, :comment);';
                $requete = $bd->prepare($sql);
                $requete->execute(array(':jeu' => $jeuDemande, ':cb' => $postCodeBarre, ':comment' => $postComment));
                $codeMessage = "formCreerExOK";
                redirection("exemplaires-{$infosJeu['id']}");
            } else {
                // Eeeh ... zut. Exemplaire déjà existant.
                $codeMessage = "formCreerExCBDejaPris";
            }
        }
    } else {
        $infosJeu = null;
        $codeMessage = "jeuInvalide";
    }
} else {
    $jeuDemande = -1;
    $codeMessage = "pasDeParametre";
}
开发者ID:KenAlin,项目名称:piscineig3,代码行数:31,代码来源:creerExemplaire_pre.php

示例14: bdd_renommer

    if (!in_array($nouveau, $liste)) {
        bdd_renommer($db, $page, $nouveau);
    } else {
        echo message('Impossible de renommer : ce nom est déjà utilisé');
    }
} else {
    if (isset($_POST['deplacer']) and !empty($_POST['deplacer'])) {
        # Déplacer
        if (!strcmp($_POST['deplacer'], JOCKER_NVPERE)) {
            $nvpere = "";
        } else {
            $nvpere = urldecode($_POST['deplacer']);
        }
        $ordre = $_POST['ordre'];
        $ret = bdd_deplacer($db, $page, $nvpere, $ordre);
        redirection($page);
    } else {
        if (isset($_POST['supprimer']) and !empty($_POST['supprimer'])) {
            # Supprimer
            $ret = bdd_supprimer($db, urldecode($_POST['supprimer']));
        } else {
            if (isset($_POST['archiver']) and isset($_POST['annee']) and !empty($_POST['archiver'])) {
                # Archiver
                $nom = urldecode($_POST['archiver']);
                $annee = intval($_POST['annee']);
                if ($annee < 2000 || $annee > 2100) {
                    $_SESSION['maintenance'] = 'Année "' . $annee . '" non valide';
                } else {
                    $ret = bdd_archiver($db, $nom, $annee);
                }
            }
开发者ID:romainhk,项目名称:ABULE,代码行数:31,代码来源:maintenance.php

示例15: DOMDocument

    $texte_title = $element_title->appendChild($texte_title);
    $element_link = $fichier->createElement("link");
    $element_link = $element_item->appendChild($element_link);
    $texte_link = $fichier->createTextNode('index.php?page=' . $cible);
    $texte_link = $element_link->appendChild($texte_link);
    $element_date = $fichier->createElement("pubDate");
    $element_date = $element_item->appendChild($element_date);
    $texte_date = $fichier->createTextNode(date("d/m"));
    $texte_date = $element_date->appendChild($texte_date);
}
if (isset($_POST['titre']) and isset($_POST['cible']) and !empty($_POST['cible'])) {
    $rss = new DOMDocument();
    $rss->load(FICHIER_RSS);
    ajouter_news($rss, $_POST['titre'], $_POST['cible']);
    $rss->save(FICHIER_RSS);
    redirection('', 1);
}
?>
<h1>Publier une news</h1>
<form id="news" method="post" action="">
<fieldset><legend>Flux RSS</legend>
<table class="form_table"><tr>
    <td><label for="titre">Titre de la news : </label></td>
    <td><input type="text" id="titre" name="titre" size="45" /></td>
</tr><tr>
    <td><label for="cible">Page ciblée : </label></td>
    <td><?php 
#PHP
echo '<select name="cible" size="1">';
echo '<option selected="selected" value="">...</option>' . "\n";
option_parente('', '', array(1, 2, 3));
开发者ID:romainhk,项目名称:ABULE,代码行数:31,代码来源:news.php


注:本文中的redirection函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。