douren9077 2016-05-22 01:10
浏览 25
已采纳

网络口袋妖怪游戏[重复]

I am encountering this error after fixing a lot of other bugs if anyone can help me.

Line 700

<input id="refer" placeholder="<?php echo $txt['not_oblige']; ?>" type="text" name="referer" value="<?php echo $_GET['referer']; ?>" class="form-control" /> 

Error

Undefined index: referer in C:\wamp\www\PTT\login.php on line 700 Call Stack #TimeMemoryFunctionLocation 10.0010416272{main}( )..\login.php:0 " class="form-control" />

Slice of coding.

    </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">
</div>
  • 写回答

1条回答 默认 最新

  • dsjj15012 2016-05-22 01:20
    关注

    PHP cannot find the index referer in the variable $_GET, you should first test if the index exist, Try this:

    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" /> 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Ubuntu 在sudo reboot之后的报错
  • ¥15 有偿求抢运动场地的插件
  • ¥15 jscolor 赋值input 没能引起前边色框的颜色变化
  • ¥100 驱动程序在\device\raidport1 上检测到控制器错误
  • ¥15 JS报错变量未定义,如何解决?
  • ¥20 找辅导 初学者 想实现一个项目 没有方向
  • ¥15 研究方向遥感场景识别分类。求深度学习基础课程
  • ¥15 关于渗漏场的电场分布模拟
  • ¥24 matlab怎么修改仿真初始时间
  • ¥15 两分段线性回归模型分析阈值效应