Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10

Thread: JS on php page

  1. #1
    New to the CF scene
    Join Date
    Aug 2007
    Location
    Ontario
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    JS on php page

    have successfully placed JS on html page and it works well

    HTML page

    I have tried unsuccessfully to place the same script on a php page with the following results.

    Code included on the php page

    479 $html=file_get_contents('user_register.html');
    480 include(PMDROOT.'/includes/template_setup.php');
    481 echo($html);
    482
    483 </body>
    484 </html>
    485 ?>

    I would believe it is just a matter of where to call the html

    I would appreciate any thoughts or suggestions

    Dale D.

  • #2
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Did you end line 478 with a semicolon?

    HTH
    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #3
    New Coder
    Join Date
    Apr 2007
    Posts
    33
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Additionally, after fixing that error, you need to move the ?> up to line 482 or put the </body></html> into an echo.

  • #4
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Technically, they should already be in the user_register.html file, so you don't even need them

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    You should probably post all of your code for user_registest.php
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #6
    New to the CF scene
    Join Date
    Aug 2007
    Location
    Ontario
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Edit to the file

    378 $template_content->set('config',$config);
    379 $html=file_get_contents('user_register.html');
    380 include(PMDROOT.'/includes/template_setup.php');
    381 echo($html);
    382 ?>

    now produces the following warnings:
    Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at ./.../user_registest.php:3) in /homepages/29/d197051712/../class_sessions.php on line 16
    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /./.././members/user_registest.php:3) in /..././includes/class_sessions.php on line 16
    Warning: Cannot modify header information - headers already sent by (output started at /homepages/29/d197051712/.../user_registest.php:3) in /homepages/29/d197051712/../members/user_registest.php on line 30

    the code for user_registest.php is fairly lengthy, 380 lines and is composed of sytems.

    I had thought it would be as simple as figuring out where to place the html
    Last edited by dbl07dee; 08-11-2007 at 07:51 PM. Reason: Reason

  • #7
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    You're sending output to the user before trying to use session functions(which need to set the headers before they're sent). According to the error line 3 of user_registest.php is outputting something.

  • #8
    New to the CF scene
    Join Date
    Aug 2007
    Location
    Ontario
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the line that seems to be the cause of some problems

    line 8 in html:
    <script language="JavaScript1.2">
    how/why could this line be sending headers?

    http://www.eConsumersearch.com/membe..._registest.php

  • #9
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Quote Originally Posted by dbl07dee View Post
    the line that seems to be the cause of some problems

    line 8 in html:
    <script language="JavaScript1.2">
    how/why could this line be sending headers?

    http://www.eConsumersearch.com/membe..._registest.php

    Quote Originally Posted by _Aerospace_Eng_ View Post
    You should probably post all of your code for user_registest.php
    Winner! ^

  • #10
    New to the CF scene
    Join Date
    Aug 2007
    Location
    Ontario
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    As mentioned before the file 380 + lines long and is composed of library related files.

    I had thought that this would be as simple as figuring out where to call the html.

    the zip is attached
    thanks
    Attached Files Attached Files


  •  

    Posting Permissions

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