10 Replies Latest reply on Sep 8, 2008 2:00 PM by Newsgroup_User

    dwt.php  help

    cdoyle Level 1
      Hi,
      I've been desiging a new layout in PHP, and have it about ready. So now I need to create a template for others can put content into pages using this new layout.

      The .php page I first created, I can F12 and it opens the browser and looks fine.

      but now I'm trying to create this template, if I F12 I get this error in the template, and any pages that use the template.
      Fatal error: Call to undefined function virtual() in D:\wwwroot\testsite\TMPwyy956vucx.php on line 443

      The error goes away if I don't include any files in the template?
      I'm trying to include another .php file (which are my menus) These files only contain the menu lists, nothing else.

      What would cause this?
      Not sure what the difference is between the .php I created for the layout, and the .dwt.php I'm trying to develop?
        • 1. Re: dwt.php  help
          cdoyle Level 1
          OK,
          Trying another test,

          I created a blank .dwt.php template, included a .php file and try and view it. I get the error.

          on both previewing and after I upload the page and try and view it there.
          What would cause that?
          • 2. Re: dwt.php  help
            Level 7
            > I created a blank .dwt.php template, included a .php file and try and
            > view
            > it. I get the error.

            Let's see your code.

            Do you have a testing server installed and correctly configured? Have you
            uploaded your include files to the testing server?

            --
            Murray --- ICQ 71997575
            Adobe Community Expert
            (If you *MUST* email me, don't LAUGH when you do so!)
            ==================
            http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
            http://www.dwfaq.com - DW FAQs, Tutorials & Resources
            ==================


            "cdoyle" <webforumsuser@macromedia.com> wrote in message
            news:ga3hei$4hg$1@forums.macromedia.com...
            > OK,
            > Trying another test,
            >
            > I created a blank .dwt.php template, included a .php file and try and
            > view
            > it. I get the error.
            >
            > on both previewing and after I upload the page and try and view it there.
            > What would cause that?
            >

            • 3. Re: dwt.php  help
              cdoyle Level 1
              and if I have a standard .dwt (that has my php includes) and when I create a page off of it, and save it as .php.

              It works fine?

              So why does a .dwt.php cause errors, but not a .dwt?

              I would really like to use the .dwt.php because it defaults the pages based off of it as a .php. I don't want authors creating pages, and saving them by mistake as .html. Which I see happening if we just use a .dwt

              • 4. Re: dwt.php  help
                Level 7
                > So why does a .dwt.php cause errors, but not a .dwt?

                Shouldn't, and frankly, I don't think it has anything to do with templates,
                having already used them many times with PHP includes.

                --
                Murray --- ICQ 71997575
                Adobe Community Expert
                (If you *MUST* email me, don't LAUGH when you do so!)
                ==================
                http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                ==================


                "cdoyle" <webforumsuser@macromedia.com> wrote in message
                news:ga3jt9$79p$1@forums.macromedia.com...
                > and if I have a standard .dwt (that has my php includes) and when I create
                > a
                > page off of it, and save it as .php.
                >
                > It works fine?
                >
                > So why does a .dwt.php cause errors, but not a .dwt?
                >
                > I would really like to use the .dwt.php because it defaults the pages
                > based
                > off of it as a .php. I don't want authors creating pages, and saving
                > them
                > by mistake as .html. Which I see happening if we just use a .dwt
                >
                >
                >

                • 5. Re: dwt.php  help
                  cdoyle Level 1
                  Here is the code to a test dwt.php I made, all it has is the include.
                  As soon as the include is put on the page, it comes back with that error.

                  Yes I'm pretty sure that the testing server is setup right, I was able to use it when I created the first .php page from scratch. I was able to preview (F12) and everything looks fine, and that page also had the includes.

                  • 6. Re: dwt.php  help
                    Level 7
                    I think that this include type is the problem.

                    <?php virtual('/includes/test_include.php'); ?>

                    Change it to this -

                    <?php include('../includes/test_include.php'); ?>

                    and see what happens. You really wouldn't need to use a virtual link to
                    these include files. DW knows how to manage them.

                    --
                    Murray --- ICQ 71997575
                    Adobe Community Expert
                    (If you *MUST* email me, don't LAUGH when you do so!)
                    ==================
                    http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                    http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                    ==================


                    "cdoyle" <webforumsuser@macromedia.com> wrote in message
                    news:ga3kr4$8dq$1@forums.macromedia.com...
                    > Here is the code to a test dwt.php I made, all it has is the include.
                    > As soon as the include is put on the page, it comes back with that error.
                    >
                    > Yes I'm pretty sure that the testing server is setup right, I was able to
                    > use
                    > it when I created the first .php page from scratch. I was able to preview
                    > (F12) and everything looks fine, and that page also had the includes.
                    >
                    >
                    >
                    > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                    > " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                    > <html xmlns=" http://www.w3.org/1999/xhtml">
                    > <head>
                    > <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                    > <!-- TemplateBeginEditable name="doctitle" -->
                    > <title>Untitled Document</title>
                    > <!-- TemplateEndEditable -->
                    > <!-- TemplateBeginEditable name="head" -->
                    > <!-- TemplateEndEditable -->
                    > </head>
                    >
                    > <body>
                    > <?php virtual('/includes/test_include.php'); ?>
                    >
                    > </body>
                    > </html>
                    >

                    • 7. Re: dwt.php  help
                      cdoyle Level 1
                      that fixed it,

                      When I did the include, I just did the insert> include and DW used the virtual path. I didn't notice it,

                      Thanks for your help.
                      • 8. Re: dwt.php  help
                        Level 7
                        You're welcome. I've never seen DW do a virtual include when in a PHP site.

                        --
                        Murray --- ICQ 71997575
                        Adobe Community Expert
                        (If you *MUST* email me, don't LAUGH when you do so!)
                        ==================
                        http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                        http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                        ==================


                        "cdoyle" <webforumsuser@macromedia.com> wrote in message
                        news:ga3u37$je8$1@forums.macromedia.com...
                        > that fixed it,
                        >
                        > When I did the include, I just did the insert> include and DW used the
                        > virtual path. I didn't notice it,
                        >
                        > Thanks for your help.

                        • 9. Re: dwt.php  help
                          Level 7

                          "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
                          news:ga3umv$k2q$1@forums.macromedia.com...
                          > You're welcome. I've never seen DW do a virtual include when in a PHP
                          > site.

                          yeah, it's happened to me now and then, too, Murray.


                          • 10. Re: dwt.php  help
                            Level 7
                            Hunter Elliott posted in macromedia.dreamweaver:
                            >
                            > "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
                            > news:ga3umv$k2q$1@forums.macromedia.com...
                            >> You're welcome. I've never seen DW do a virtual include when in
                            >> a PHP site.
                            >
                            > yeah, it's happened to me now and then, too, Murray.

                            Apparently it does so with the DW database behaviors under certain
                            conditions. Here's a post where David Powers explained it to me in the
                            m.d.a newsgroup:

                            Subject: Re: redirect after insert
                            Date: Mon, 01 Sep 2008 22:31:35 +0100
                            news:g9hn3c$af9$1@forums.macromedia.com



                            --
                            Mark A. Boyd
                            Keep-On-Learnin' :)