如果有人可以帮助我,我在修复了很多其他错误后遇到了这个错误。
700号线
<input id="refer" placeholder="<?php echo $txt['not_oblige']; ?>" type="text" name="referer" value="<?php echo $_GET['referer']; ?>" class="form-control" />
错误
未定义的索引:第700行的C:\ wamp \ www \ PTT \ login.php中的referer调用堆栈#TimeMemoryFunctionLocation 10.0010416272 {main}().. \ login.php:0&#34;类=&#34;形状控制&#34; /&GT;
片段编码。
</div>
<div class="form-group">
<label for="region"><?php echo $txt['beginworld'] ?></label>
<select name="wereld" class="form-control">
//option field error was here
<option <?php if(isset($_POST['wereld']) && $_POST['wereld'] == "Kanto") { echo 'checked'; } ?>>Kanto</option>
<option> <?php if(isset($_POST['wereld']) && $_POST['wereld'] == "Jhoto") { echo 'checked'; } ?>Johto</option>
<option <?php if(isset($_POST['wereld']) && $_POST['wereld'] == "Hoenn") { echo 'checked'; } ?>>Hoenn</option>
<option <?php if(isset($_POST['wereld']) && $_POST['wereld'] == "Sinnoh") { echo 'checked'; } ?>>Sinnoh</option>
<option <?php if(isset($_POST['wereld']) && $_POST['wereld'] == "Unova") { echo 'checked'; } ?>>Unova</option>
<option <?php if(isset($_POST['wereld']) && $_POST['wereld'] == "Kalos") { echo 'checked'; } ?>>Kalos</option>
</select>
</div>
<div class="form-group">
<input id="agreech" name="agreecheck" id="agreecheck" value="yes" type="checkbox" <?php if(isset($_POST['agreecheck']) && $_POST['agreecheck'] == "yes") { echo 'checked'; } ?>> <label for="agreech"><?php echo $txt['1account_rule']; ?></label>
</div><div class="form-group">
<label for="refer">
<?php echo $txt['referer']; ?></label>
<input id="refer" placeholder="<?php echo $txt['not_oblige']; ?>" type="text" name="referer" value="<?php echo $_GET['referer']; ?>" class="form-control" />
</div>
<div class="form-group">
<input type="submit" value="<?php echo $txt['button']; ?>" name="registreer" class="btn bg-olive btn-block">
</div>
<center>
<table width="100%" border="0">
<tbody><tr>
<td align="Center" valign="Middle" width="102">
<img src="https://static.pkmnstar.com/images/trainers/N.png" border="0">
</td>
<td align="left" valign="Middle"><b>
<font name="verdana" size="1">Bring It On, <br>Show us what you made up of. Fill all the details and informations and agree to the terms and conditions to Begin your Journey...</font></b>
</td>
</tr>
</tbody></table>
</form></div>
<div class="margin text-center">
答案 0 :(得分:0)
PHP无法在变量$ _GET中找到索引引用程序,您应首先测试索引是否存在,试试这个:
<强> PHP 强>
<input id="refer" placeholder="<?php echo $txt['not_oblige']; ?>" type="text" name="referer" value="<?php echo (isset($_GET['referer'])) ? $_GET['referer'] : '' ; ?>" class="form-control" />