-1

So whenever I try to make a basic PHP page, it doesn't work. The echo is glitching out, instead of outputting the text I put in, it outputs the text, then anything after it.

So if I were to put

<?php

echo "<p>Hello World!</>";

?>

It would output Hello World!"; ?>

Here's my HTML:

<html>
<body>
<form action="create.php" method="post">

<table border="0">

<tr>
    <td>Title</td>
    <td align="center"><input type="text" name="title" size="30" /></td>
</tr>
<tr>
    <td>Script</td>
    <td align="center"><input type="text" name="script" size="100" /></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Submit"/></td>
</tr>

</table>
</form>
</body>
</html>

and here's my entire PHP file.

<html>
<head>
  <title>Creating Script</title>
</head>

<body>

  <?php
    echo "<p>Hello World!</>";
?>

</body>
</html>
Ivar
  • 6,138
  • 12
  • 49
  • 61
  • 2
    Side note: Ending tag to `

    ` is `

    ` and not `>`
    – vicbyte Jan 27 '18 at 21:18
  • Hey - what's the name of the file? (eg index.php, for example). Has your web server been setup to handle PHP files? – Emily Shepherd Jan 27 '18 at 21:19
  • 1
    Possible duplicate of [PHP code is not being executed, instead code shows on the page](https://stackoverflow.com/questions/5121495/php-code-is-not-being-executed-instead-code-shows-on-the-page) – Ivar Jan 27 '18 at 21:20

1 Answers1

1

If you correctly close your HTML tags things will work more reliably

EG

echo "<p>Hello World!</>";

should be

echo "<p>Hello World!</p>";
                       ^
RiggsFolly
  • 93,638
  • 21
  • 103
  • 149