PDA

View Full Version : JS on php page



dbl07dee
08-11-2007, 03:20 PM
have successfully placed JS on html page and it works well

HTML page (http://www.eConsumersearch.com/members/user register.html)

I have tried unsuccessfully to place the same script on a php page with the following results. (http://www.eConsumersearch.com/memnbers/user_registest.php)

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:confused:

I would appreciate any thoughts or suggestions

Dale D.

whizard
08-11-2007, 04:10 PM
Did you end line 478 with a semicolon?

HTH
Dan

argothian
08-11-2007, 05:43 PM
Additionally, after fixing that error, you need to move the ?> up to line 482 or put the </body></html> into an echo.

whizard
08-11-2007, 06:13 PM
Technically, they should already be in the user_register.html file, so you don't even need them

Dan

_Aerospace_Eng_
08-11-2007, 06:31 PM
You should probably post all of your code for user_registest.php

dbl07dee
08-11-2007, 06:47 PM
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

Inigoesdr
08-12-2007, 01:36 AM
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.

dbl07dee
08-13-2007, 07:50 PM
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/members/user_registest.php

Inigoesdr
08-14-2007, 12:38 AM
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/members/user_registest.php



You should probably post all of your code for user_registest.php

Winner! ^ :thumbsup:

dbl07dee
08-14-2007, 01:59 AM
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