用户登录后,我一直试图将数据从一个php文件传递到另一个php文件。
目标是当用户注册要重定向到显示其统计信息的另一个页面时(用户名,金钱,红宝石,钻石)。
index.php
<?php include('server.php') ?>
<?php include('errors.php'); ?>
<div class="form-popupRegister" id="myRegForm">
<form method="post" action="server.php" class="form-containerReg">
<h1>Регистрирация</h1>
<label for="username"><b>Име</b></label>
<input type="text" name="username" placeholder="Въведете името на лейдито" value="<?php echo $username; ?>">
<label for="email"><b>Е-майл</b></label>
<input type="text" name="email" placeholder="Въведете e-mail" value="<?php echo $email; ?>">
<label for="password_1"><b>Парола</b></label>
<input type="password" placeholder="Въведете парола" name="password_1">
<label for="password_2"><b>Повторете Парола</b></label>
<input type="password" placeholder="Въведете парола повторно" name="password_2">
<button type="submit" class="btnReg" name="reg_user">Register</button>
<button type="button" class="btn-cancelReg" onclick="closeRegForm()">Close</button>
</form>
</div>
index2.php
<?php require('server.php') ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>PwettyKittyPincesa</title>
<link href="./style.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div class="navWrapper">
<div class="statistics">
<div class="profilePicture" name="profilePicture">
<label class="profilePictureLabel" for="profilePicture"><b><?php echo $username; ?></b></label>
</div>
<div class="money" name="money">
<output name="money" for="money"><?php echo $money; ?></output>
</div>
请检查我的代码并为我提供帮助。我已经尝试了很长时间,以至于我感觉自己将失去理智。我认为php中存在错误。
慕哥9229398