2 Replies Latest reply: May 22, 2012 10:41 AM by msycpu2 RSS

    Php session Code and Dreamweaver Template

    msycpu2 Community Member

      I have a page that I created in dreamweaver.  It's a php page that has sessions, the file is from a Dreamweaver template that I created and am using.  However, when I update the master template file, the items before the Doctype keeps erasing.

       

      I have some php includes that are useful for post variables.  How can I tell dw not to delete those sections.  I can't create an editable region before the head? Is there a way?

       

      Thanks for you help.

       

      Sample Code:

      <?php

                include ("./includes/file1.inc");

                session_start();

                if(isset($_SESSION['code'])){

                          header("location:rsvp_file2.php");

                }

      ?>

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

        • 1. Re: Php session Code and Dreamweaver Template
          osgood_ MVP

          I'm not clear in what you are saying?

           

          Are you saying you want to insert this block of php code on all the pages made from the master template file but when you insert it into the master template file and save the file the block of php code does not appear on any of the page made from the template?

           

          If that is the case then  do a 'find and replace' Find>Find and Replace. Find the doctype:

           

          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

           

          and replace it in all the pages with:

           

          <?php

                    include ("./includes/file1.inc");

                    session_start();

                    if(isset($_SESSION['code'])){

                              header("location:rsvp_file2.php");

                    }

          ?>

           

          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

          • 2. Re: Php session Code and Dreamweaver Template
            msycpu2 Community Member

            thanks osgood for replying.

             

            the above code is on one file, however, I have different lines of code that appear before a few of my php files.  I have setup

             

            <!-- InstanceBegin template="/Templates/wedding_temp.dwt" codeOutsideHTMLIsLocked="false" -->

             

            but it still erases the code abouve the doctype.  The template keeps making all the files the same except for the editable region, however you are not able to make the section before the html an editable region.  I need that part of the php file to be editable, since it'll be different on each page.  Any suggestions.