using dreamweaver templates with session_start

Please support our PHP advertiser: 50% off 6 Months Dedicated Server Hosting from 1&1!
Thread Solved

Join Date: Oct 2006
Posts: 215
Reputation: MaxMumford is an unknown quantity at this point 
Solved Threads: 2
MaxMumford's Avatar
MaxMumford MaxMumford is offline Offline
Posting Whiz in Training

using dreamweaver templates with session_start

 
0
  #1
Oct 18th, 2008
hi all,

I'm using dreamweaver templates to make my site, however when I want to use the session_start(); function in php, the headers have already been sent because dreamweaver writes the following into the page:

  1. <!-- InstanceBegin template="/Templates/index.dwt.php" codeOutsideHTMLIsLocked="false" -->

and so I am having to put in the session_start function manually at the top of every page before the above code. Is there any way to get around this?

Thanks in advance!

Max.
| IPCopy |
The only google chrome extension that lets you copy your IP to the clipboard with one click.
https://chrome.google.com/extensions...ogchjmmgjjfola
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 1,617
Reputation: scru has a spectacular aura about scru has a spectacular aura about 
Solved Threads: 136
Featured Poster
scru's Avatar
scru scru is offline Offline
Posting Virtuoso

Re: using dreamweaver templates with session_start

 
0
  #2
Oct 18th, 2008
No. Session start must always come before headers are sent, and that means before that code there.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 215
Reputation: MaxMumford is an unknown quantity at this point 
Solved Threads: 2
MaxMumford's Avatar
MaxMumford MaxMumford is offline Offline
Posting Whiz in Training

Re: using dreamweaver templates with session_start

 
0
  #3
Oct 19th, 2008
damn. okay thanks anyway
| IPCopy |
The only google chrome extension that lets you copy your IP to the clipboard with one click.
https://chrome.google.com/extensions...ogchjmmgjjfola
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 1,617
Reputation: scru has a spectacular aura about scru has a spectacular aura about 
Solved Threads: 136
Featured Poster
scru's Avatar
scru scru is offline Offline
Posting Virtuoso

Re: using dreamweaver templates with session_start

 
0
  #4
Oct 19th, 2008
Originally Posted by MaxMumford View Post
damn. okay thanks anyway
Forgot to add, you could have written it like:
  1. <?php session_start(); ?>
  2. <!-- InstanceBegin template="/Templates/index.dwt.php" codeOutsideHTMLIsLocked="false" -->
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the PHP Forum


Views: 1654 | Replies: 3
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC