duangan6133 2012-04-19 10:26
浏览 41
已采纳

将标识变量中的文本,但不会显示

i have some strange phenomenon. i have a variable in that is some text:

rename something;
mkdir a folder;
$msg = "this text should be displayed";
$mail to...

in the html i have:

<?php if (!isset($msg)):?>
some inputfileds
<?php endif; ?>

the phenomenon is that everything works fine except $msg that wont be displayed. the curious about that is, that it has worked before on another page. the variable will be identified as it because the inputfields will be hidden after pressing submit and $errors == 0. there is also working the rename function, mkdir, and the mail. if i change $msg = into echo it will echo out the message how it should do. so i really have no clue whats might be wrong to this?

if there is someone who could tell what to do to solve this i really would appreciate. thanks a lot.

  • 写回答

2条回答 默认 最新

  • dousu8767 2012-04-19 10:33
    关注

    I dont know if I understood your query correctly but if you want to display the value of $msg in the html then you will have to put it in your html something like

    <?php if (isset($msg)):?>
      <p><?php echo $msg; ?></p>
      <!-- some inputfileds -->
    <?php endif; ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据