Php if(isset())语句导致屏幕为空

Php if(isset())语句导致屏幕为空,php,Php,嘿,我创建了一个单词表,并删除了与表中单词相关的值。我需要这样,当我点击一个单词时,它会打印出该单词的剪切信息,这最终是与该单词相关的信息。问题是,当我添加我的isset语句并刷新页面时,它只会生成一个空白屏幕 这是我的全部代码 <html> <body> <script> function wordCheck(chosenOne) { window.location="http://granite.sru.edu/~jaw1005/w

嘿,我创建了一个单词表,并删除了与表中单词相关的值。我需要这样,当我点击一个单词时,它会打印出该单词的剪切信息,这最终是与该单词相关的信息。问题是,当我添加我的isset语句并刷新页面时,它只会生成一个空白屏幕

这是我的全部代码

    <html>
<body>
<script>

  function wordCheck(chosenOne) {
     window.location="http://granite.sru.edu/~jaw1005/word.php?chosenOne=\"" + chosenOne + "\""

  }
</script>
<center>
<table id="test" border="1">
<?

$f="/homes/ddailey/public_html/threefull";
$o=file($f);
$rn=count($o);


for ($i=0;$i<3;$i++){
 print "<tr>";

    for ($g=0;$g<6;$g++){

      $lol=rand(1, $rn);
      $word= explode(" ", ltrim( $o[$lol], ' 0123456789'));
      $fullword = str_replace("\n", "&nbsp;", $o[$lol]);
      print "<td onClick='wordCheck(\"".$fullword."\")'>".ucfirst($word[0])."</td>";

   }
 print "</tr>";

}

if(isset($chosenOne)){
  $realWord=str_replace('"', "", $chosenOne);
  $wordSplit = explode(" ", $realWord);
  print ucfirst($wordSplit[2])."'s part of speech is: ".$wordSplit[3].", while its               frequency is:".$wordSplit[0];

?>
</table>
</center>
</body>
</html>

这里有一个指向页面的链接

您没有关闭大括号
}

if(isset($chosenOne)){
  $realWord=str_replace('"', "", $chosenOne);
  $wordSplit = explode(" ", $realWord);
  print ucfirst($wordSplit[2])."'s part of speech is: ".$wordSplit[3].", while its               frequency is:".$wordSplit[0];
}//<--- here
?>
if(isset($chosenOne)){
$realWord=str_replace(“,”,$chosenOne);
$wordSplit=explode(“,$realWord”);
打印ucfirst($wordSplit[2])。的词性为:“..$wordSplit[3]”,频率为:“..$wordSplit[0];
}//

您需要将该单词存储在COOKIE中,然后您可以在创建的COOKIE上使用isset。if条件的结束括号在哪里?是的,因此
$chosenOne
未在代码中的任何位置设置。设置它我认为您应该使用
(if(isset($\u GET[“chosenOne”])
进行检查
if(isset($chosenOne)){
  $realWord=str_replace('"', "", $chosenOne);
  $wordSplit = explode(" ", $realWord);
  print ucfirst($wordSplit[2])."'s part of speech is: ".$wordSplit[3].", while its               frequency is:".$wordSplit[0];
}//<--- here
?>