检查是否“php”在文件中定义/确定 [英] Check if "php" is defined/ok in file

查看:85
本文介绍了检查是否“php”在文件中定义/确定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个php文件,我认为该文档中没有定义该语言,但我不确定。有没有办法在文件中定义php?自从我使用php以来已经有一段时间了,但文件中的所有内容都有效,除了php部分。



当我按下提交按钮时,网址会从表单的获取中正确显示变量名称和值。然而,当它进入PHP部分时,它打印0而不是这里和类似的值应该。这就是为什么我认为有一个PHP语言识别问题。 w3验证器与php open delimeter有问题。



这就是BigTable.php的样子。



作为旁注,为什么这个网站总是将我的< s转换为$ lt;?看起来真的很难。周围有什么方法吗?



I'm writing a php file and I think that the language isn't defined in the document, but I'm not sure. Is there a way to define php in a file? It's been a while since I used php, but everything in the file works except the php part.

When I press the submit button, the url shows the variable names and values correctly from the get of the form. However, when it goes to the php part, it's printing "0" and not "here" and the values like it should. That's why I think there's a php language recognition problem. The w3 validator is having issues with the php open delimeter.

This is what BigTable.php looks like.

As a side note, why does this website always convert my <'s to $lt;? It's really tough to look at. Is there any way around it?

<!DOCTYPE html>
<html lang="en" >
<head>
    
<meta charset="utf-8" /> 
    <title>Big Table</title>
   
            
    <script type="text/javascript" src="js/jquery-1.11.0.js"></script>
    
   //there's some javascript that I'm not sure if I'm going to use yet here    
</head>
<body>  
    <h1> Visual Evaluation Entry Table </h1>
    <form method="get" action="BigTable.php">
<table id="bigTable" border="1">
    <thead>
     <tr>
       <th id="bandY" class="col3">Bands @263mm Y</th><th id="bandM" class="col3">Bands @263mm M</th><th id="bandC" class="col3">Bands @263mm C</th><th id="bandK" class="col3">Bands @263mm K</th><th id="Comments" class="col3">Comments</th>
     </tr>
    </thead>
    <tbody>
        <tr >
            <td><input name="bandY" ></td> <!-- //Row 0 Column 1-->
            <td><input name="bandM" ></td>  <!--//Row 0 Column 2-->
            <td><input name="bandC" ></td>  <!--//Row 0 Column 3-->
            <td><input name="bandK" ></td>  <!--//Row 0 Column 4-->
            <td><input name="comment" ></td>  <!--//Row 0 Column 4-->
        </tr>
    </tbody>
 
</table>
  <input id="submit" type="submit" class="list" name="submit" value="Submit To Database" >  
   
   <?php
//this part doesn't seem to be working. Document isn't validating on w3 site, and echo shows "0" on screen and not "here" and doesn't show variables. Get in url shows names and correct values
    if (isset($_GET['submit'])){
        $bandY= $_GET['bandY'];
        $bandM= $_GET['bandM'];
        $bandC= $_GET['bandC'];
        $bandK= $_GET['bandK'];
        $comment=$_GET['comment'];
        
        echo "here:"+$bandY+$bandM+$bandC+$bandK+$comment;
    }
   ?>
   </form>
</body>

</html>







我一直关注这个例子互联网,但找不到任何有关如何定义或检查PHP定义的内容:





http:// tangledindesign .com / how-to-create-a-contact-form-using-html5-css3-and-php /#comment-1428428110 [ ^ ]

推荐答案

lt;?看起来真的很难。周围有什么方法吗?



lt;? It's really tough to look at. Is there any way around it?

<!DOCTYPE html>
<html lang="en" >
<head>
    
<meta charset="utf-8" /> 
    <title>Big Table</title>
   
            
    <script type="text/javascript" src="js/jquery-1.11.0.js"></script>
    
   //there's some javascript that I'm not sure if I'm going to use yet here    
</head>
<body>  
    <h1> Visual Evaluation Entry Table </h1>
    <form method="get" action="BigTable.php">
<table id="bigTable" border="1">
    <thead>
     <tr>
       <th id="bandY" class="col3">Bands @263mm Y</th><th id="bandM" class="col3">Bands @263mm M</th><th id="bandC" class="col3">Bands @263mm C</th><th id="bandK" class="col3">Bands @263mm K</th><th id="Comments" class="col3">Comments</th>
     </tr>
    </thead>
    <tbody>
        <tr >
            <td><input name="bandY" ></td> <!-- //Row 0 Column 1-->
            <td><input name="bandM" ></td>  <!--//Row 0 Column 2-->
            <td><input name="bandC" ></td>  <!--//Row 0 Column 3-->
            <td><input name="bandK" ></td>  <!--//Row 0 Column 4-->
            <td><input name="comment" ></td>  <!--//Row 0 Column 4-->
        </tr>
    </tbody>
 
</table>
  <input id="submit" type="submit" class="list" name="submit" value="Submit To Database" >  
   
   <?php
//this part doesn't seem to be working. Document isn't validating on w3 site, and echo shows "0" on screen and not "here" and doesn't show variables. Get in url shows names and correct values
    if (isset(


_GET [' submit'])){
_GET['submit'])){


bandY =


这篇关于检查是否“php”在文件中定义/确定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆