質問は次のとおりです。リンクの一部として$ conf_url変数を行16に挿入するにはどうすればよいですか?header( 'Location:' $ conf_url.'index_back.php ');変数をヘッダ位置に挿入するPHP 1
<?php
session_start();
include("conexao.php");
$email = $_POST['email'];
$senha = $_POST['senha'];
$query1 = mysqli_query($con, "SELECT * FROM usuario WHERE email = '$email' AND senha = '$senha'");
$row = $query1->fetch_row();
$_SESSION["iduser"] = $row[0];
$_SESSION["nome"] = $row[2];
$_SESSION["sobrenome"] = $row[3];
$_SESSION["img"] = $row[8];
if($query1->num_rows == 1){
header('Location:' $conf_url.'index_back.php');
//echo "<meta http-equiv='refresh' content='0, url= $conf_url/index_back.php'>";
}else{
$_SESSION['error'] = 'Email e/ou senha invalido(s).';
header('Location: '$conf_url'.'/login.php);
//echo "<meta http-equiv='refresh' content='0, url= $conf_url/login.php'>";
}
?>
config.php
<?php
$conf_url = "http://localhost/production/";
?>
一重引用符で囲まないでください。または引用符をまったく使用しないでください。 –
あなたはちょうど '.'連結マークがありません – RiggsFolly
[Little Bobby](http://bobby-tables.com/)は*** [あなたのスクリプトはSQLインジェクション攻撃の危険にさらされています。](http:// stackoverflow (MySQLのための)準備された(http://en.wikipedia.org/wiki/Prepared_statement)ステートメントについて学んでください。 ](http://php.net/manual/en/mysqli.quickstart.prepared-statements.php)。 [文字列をエスケープする](http://stackoverflow.com/questions/5741187/sql-injection-that-gets-around-mysql-real-escape-string)でも安全ではありません! [それを信じていない?](http://stackoverflow.com/q/38297105/1011527) –