문제

I'm trying to use PHP to print out values for my select statements but I can't get it to work. I've even tried just to print something out in my html with php, but i can't even seem to do that. Can anyone tell me what's wrong with this

<html>
<head></head>
<body>
<ul> 
    <?php echo "register Student:"; ?>
</ul> 
</body>
</html>
도움이 되었습니까?

해결책

Make sure you save your file as .php not .html.

myfile.php:

<html>
<head></head>
<body>
<ul> 
    <?php echo "register Student:"; ?>
</ul> 
</body>
</html>

You will also need to run this file on a server that has php installed. It won't run directly in the browser like an .html file will.

다른 팁

Keep these things in mind.

  1. Your file name should always end with .php extension not .htm or .html
  2. You should always run file on localhost/ where you set up your environment
  3. Please follow the standard of W3C Use a "li" in you "ul"

Hope it works.

Name your file whatever.php Make sure it is NOT whatever.html

If that doesn't work, be sure to check whether or not you installed php. I suggest a local testing ground such as XAMPP. If you don't want to do that, upload it to a free or paid hosting service.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top