View Full Version : How do I place this script on PHP page

07-22-2007, 04:07 PM
1) Script Title: Drop in box

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/dropinbox.htm

3) Describe problem: How can this script be placed on PHP page?

07-22-2007, 04:16 PM
since the script tells ya to add this code at the very end of your page,
i suggest u search for the php ending tag..


just add the code after this line.. should work...

07-22-2007, 04:27 PM
The placement has nothing to do with the PHP itself, but the output html. Just figure out how to put it into the output html (in the browser, view the source code).
Then, once you know what part of the html must be edited, find the part of the PHP that generates that. Hopefully, it's just plain html outside PHP tags. If not, it's still possible.

Again, PHP isn't the issue. The difference is just that PHP generates the final html, rather than typing it by hand.

07-22-2007, 09:09 PM
placed the script at the beginning of the page and

the body containing the <div at the end of the php code.

some warning errors:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at ....user_register.php:1) in ....../class_sessions.php on line 16

Warning: Cannot modify header information - headers already sent by (output started at /.....user_register.php:1) in ......user_register.php on line 104

Difficulty in trying to decipher.


07-22-2007, 11:06 PM
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at ....user_register.php:1) in ....../class_sessions.php on line 16

This is in the PHP FAQ (http://uk.php.net/manual/en/faq.using.php#faq.using.headers-sent). Please read it and the manual entries linked from it.

07-23-2007, 12:37 AM
Header information, such as with sending a cookie, starting a session, or anything like that, must be sent before any text output, so that explains your error. The script will need to be placed after those lines in the PHP, then.

Remember, having a script floating after or before <html> or </html> is invalid anyay, so you'll need to, as I said, find where it should go in the output, then find the line(s) that generate that portion, and add the code that way.

07-25-2007, 01:22 PM
Code has been placed but error message indicating unexpected opening tag

the page (http://www.eConsumersearch.com/user_registest.php)

the line 450 is the opening div and cannot be removed.:confused:

Assistance very much appreciated.

the html page works fine (http://www.econsumersearch.com/members/user_register.html)

07-26-2007, 05:28 PM
I have tried to add

$html=file_get_contents('user register.html');
with the Java Script being included in the html file.

link (http://www.eConsumersearch.com/members/user_registest.php).

it appears that the syantax may still be incorrect.

Assistance appreciated

371 $html=file_get_contents('user register.html');';
372 include(PMDROOT.'/includes/template_setup.php');
373 ?>

08-13-2007, 05:10 PM
the script now loads on the page but with some warnings


line no 8 of the html
<script language="JavaScript1.2">

How/why would this line be sending headers, if the html is sent before sessions start?