文件路径为:wordpress/wp含量/主题/内夫/指数php
"E;指数php“;内容为:
<?php
global $wpdb;
$result = $wpdb->get_results ( "SELECT * FROM users WHERE username = \'Peter\'");
foreach ( $result as $results )
{
echo $results->id.\'<br/>\';
echo $results->username.\'<br/>\';
echo $results->password.\'<br/>\';
}
?>
它起作用了!但是,当我更改索引的内容时。php,请参见以下内容:新建;指数php“;内容为:
<?php
header("Location: http://34.92.209.11/wp-content/themes/neve/Test_PHP.php");
?>
然后是;Test\\u PHP。php“;是:
<?php
global $wpdb;
$result = $wpdb->get_results ( "SELECT * FROM users WHERE username = \'Peter\'");
foreach ( $result as $results )
{
echo $results->id.\'<br/>\';
echo $results->username.\'<br/>\';
echo $results->password.\'<br/>\';
}
?>
它不起作用,并显示;HTTP错误500“;,为什么?只有名为“的文件名”;指数php“;是否可以访问数据库?我一直在寻找答案。我真的希望有人能回答我。非常感谢!