#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Posts
    131
    Rep Power
    15

    Including php files


    Hi im new to php and i was making a email script so site viewers could email me on the site, the main php file worked fine but when i used the include tag it messed up the text fields in the php file included, it wouldnt let u select the fields or type in them.

    the code i used for the include was just

    PHP Code:
    <?php 
    include ("email.php"); 
    ?>
    can anyone tell me whats wrong please
  2. #2
  3. Master PIMP
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2004
    Location
    Santa Monica, CA
    Posts
    753
    Rep Power
    51
    Well the include tags look fine to me. Make sure the file calling email.php and email.php reside in the same folder. You havn't posted any other code and I dont really understand what the problems are but you might try using require() and see what that does. The main difference between require and include is that include will throw a warning when it cannot load a file whereas require will throw a fatal error (which stops the script) and then tell you what the problem is. (Require also incorporates the file into the script before execution even if it wont be used whereas include dynamically includes the files on-the-fly).
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Posts
    131
    Rep Power
    15
    nope that tag didnt work either heres the page if it helps,
    Site here
    (ps dont comment on the design its rubbish just threw it up while
    im working on the real site )
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2005
    Posts
    180
    Rep Power
    14
    Could You Be using the same variable name (possibly for different purposes) on both php pages ?
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2005
    Posts
    180
    Rep Power
    14
    Just took a look at your page and i think im on the wrong track. i cant get a cursor into the textbox ?? weird lol
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Posts
    131
    Rep Power
    15
    yeah it is strange it has never happened to me before
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Nov 2001
    Posts
    1,879
    Rep Power
    24
    I would say it was a design problem with the CSS. Remove it and then check your page.
  14. #8
  15. Master PIMP
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2004
    Location
    Santa Monica, CA
    Posts
    753
    Rep Power
    51
    Ahh yes, your problem has nothing to do with php. Rather, it has to do with improper CSS like degsy said.

    On the line that says:
    Code:
    <div id="Layer2" style="position: absolute; left: 30%; top: 107px; width: 531px; height: 490px; z-index: 1;"></div>
    the z-index is placing an invisible layer over the form rendering it inaccessible.

    Change the above line to:
    Code:
    <div id="Layer2" style="position: absolute; left: 30%; top: 107px; width: 531px; height: 490px;"></div>
    After that it works great, although I'm not even sure what you need that div for anyways...

IMN logo majestic logo threadwatch logo seochat tools logo