SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2008
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can't call PHP code from within HTML

    Hey all.

    I have the following code and for some reason that I can't figure out, it won't execute the PHP code.

    HTML Code:
    <form action="/phptest/create_table.php" method="POST">
              <label for="zone" style="padding-top: 3px;">ZONE:</label>
                <input type="text" id="zone"     id="zone"   class="ac_input contacttext" style="width: 75px;"><br />
              <label for="method">METHOD:</label>
    
                <input type="text" id="method"   id="method" class="ac_input contacttext" style="width: 75px;"><br />
              <label for="weight">WEIGHT:</label>
                <input type="text" id="weight"   id="weight" class="ac_input contacttext" style="width: 75px;"><br />
              <label for="cost">COST:</label>
                <input type="text" id="cost"     id="cost"   class="ac_input contacttext" style="width: 75px;"><br />
          </form>
          <input type="submit" name="btnUpdZone" id="btnUpdZone" value="Add Zone Data123">
    The PHP code in question is doing a simple echo statement. I can run the PHP code from the browser manually, but not from within this program. I went as far as to put the php/html code in the same directory and it still won't run. It's as though the php program can't be found, but I don't know why. The PHP is 777.

    Any ideas? Is there something basic I'm missing? I'm running it on a Mac off the default root directory.
    Last edited by AutisticCuckoo; Feb 11, 2009 at 01:27. Reason: Added code tags for readability

  2. #2
    SitePoint Evangelist ferrari_chris's Avatar
    Join Date
    Mar 2008
    Location
    NP, New Zealand
    Posts
    576
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There's no PHP code in that code sample you posted...

  3. #3
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,705
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    This thread belongs in the PHP forum
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  4. #4
    SitePoint Zealot
    Join Date
    Mar 2008
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have different links to this site's forums, didn't pay attention to what forum I was posting into. I'd like re-post this message in PHP and use better example code. How do I delete this thread?

  5. #5
    SitePoint Zealot zealus's Avatar
    Join Date
    Jan 2004
    Location
    NY
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Put the last < input type="submit" > statement within form, i.e. BEFORE < /form >

  6. #6
    SitePoint Zealot
    Join Date
    Mar 2008
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That did it. Thanks.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •