PHP echo string not showing up in my HTML form page nor is PHP page working?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • justsaying
    New Member
    • Nov 2013
    • 1

    PHP echo string not showing up in my HTML form page nor is PHP page working?

    Code:
    <!DOCTYPE HTML> <html> <head> </head> <body> <form action=somefile.php method="post"> <?php echo="Hi" ?> <H2>Pizza</h2> <br> <h3>Toppings</h3> <br> <input type="checkbox" name="toppings[]" value="Pepperoni">Pepperoni<br> <input type="checkbox" name="toppings[]" value="Mushrooms">Mushrooms<br> <input type="checkbox" name="toppings[]" value="Anchovies">Anchovies<br> <input type="checkbox" name="toppings[]" value="Chicken">Chicken<br> <input type="checkbox" name="toppings[]" value="Green Peppers">Green Peppers<br> <input type="checkbox" name="toppings[]" value="Tomatoes">Tomatoes
    <br></br> <h3>Sizes</h2> <input type="radio" name="sizes" value="12" >12
    <input type="radio" name="sizes" value="14">14
    <input type="radio" name="sizes" value="16">16
    <br><br> <input type="submit" name="continue" value="continue"> </form> </body> </html>
    Hello, I just starting learning PHP about a week ago along with other languages and I can't seem to get it to show up in a browser. I put this html form page, along with another form and the php file that'll be grabbing the variables on my server. When I open my Form page, the php echo'd message doesn't show, nor does any of the content on the PHP page that it calls?


    I set the chmod for the PHP page to 644 and my html is 755. Should it also be 644? Or some other permission? Thanks.
    Last edited by Rabbit; Nov 12 '13, 05:04 PM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data.
  • Exequiel
    Contributor
    • Jul 2012
    • 288

    #2
    Is the file extension of this page is .html? because if it is .html you must change it into .php file extension, for example myhtmlpage.php instead of myhtmlpage.html,only in php file extension the <?php ?> - php tag works. so change your page into .php . . . .

    Comment

    • itsraghz
      New Member
      • Mar 2007
      • 124

      #3
      Just to add with what Exequiel had said, you should ensure you have a Web Server (example Apache) running on your computer that helps the PHP scripts to be processed.

      Comment

      • johny10151981
        Top Contributor
        • Jan 2010
        • 1059

        #4
        Have to remove my last comment, cause i didnt see the entire code

        Comment

        Working...