10 Replies Latest reply on Apr 11, 2013 10:01 AM by Nancy O.

    php form shows php


      Hi Guys,


      I am new to the forums, and recently new to DWCS6.


      I previously wrote a simple website in DW4 many moons ago, and have come back to the latest and greatest in order to throw together a website.


      I am producing a contact us page, and used an online resource that has generated for me the php pages etc with all the required fields.(courtesy of http://phpfmg.sourceforge.net/).


      I have then tried to iframe this php form in my webpage (html pages), and the outcome is disappointing. I see several elements of PHP visible in the form, and things like the security / antispam validation do not appear at all.


      below is a snippet of what I see....




      Has anybody any suggestions for a newbie on how to fix this? This is my first real venture beyond HTML, so I am new to most of it.

        • 1. Re: php form shows php
          polar_bare Champion

          It has to have a php extension to work. It can't be html unless your server is set to process html as php.



          • 2. Re: php form shows php
            sudarshan.t Ninja

            Why are you using an iFrame? Why cant you directly make a .php file and put in your form in it?


            Make a .php file to parse PHP content. Period.

            • 3. Re: php form shows php
              jeeb.fr Newcomer

              Thank you both for taking the time to reply. The form has a .php extension which is why I believed that it should be ok.


              With regards to Sudarshan, forgive me, I am very much an amateur, so not sure how is best to approach this method. I downloaded a template online which I have been using, I am just unsure as to how to make it PHP (if thats even possible?) The template I have been using is http://www.freecsstemplates.org/preview/throughout/

              • 4. Re: php form shows php
                bregent Ninja

                >The form has a .php extension which is why I believed that it should be ok.


                Correct. If the embedded form page has a php extension then it should work. The parent page can be html. Are you sure that php is enabled on your server?

                • 5. Re: php form shows php
                  jeeb.fr Newcomer

                  Many thanks for taking the time to reply.


                  I'm currently working on a virtual machine xp pro sp3 with dw installed and previewing through Firefox as well as seeing the graphical design on dw.


                  I believe the host does permit php when it gets that far however is there an option needed in dw to advise itself php is in use? And is a trading a case of just <I frame = form></I frame > as that shows the form in situ where wanted but do I need any thing else to tell it to accept the php code?


                  Thanks again to all for the replies so far.

                  • 6. Re: php form shows php
                    bregent Ninja

                    >I believe the host does permit php when it gets that far

                    >however is there an option needed in dw to advise itself php is in use?


                    You need to install a test server that is running php if you want to preview php pages.

                    • 7. Re: php form shows php
                      Nancy O. Legend

                      #1 Install a Local Testing Server on your machine.

                           Win - get Wamp or Xampp

                           Mac - get Xampp or Mamp


                      #2 Move your local site files to the designated folder in your Testing Server.  Either www for Wamp or htdocs if using the others.


                      #3 In DW, go to Site > Manage Sites and edit your site definition to add a Testing Server.  See screenshots below.







                      For more details, see Setting up a PHP environment in Dreamweaver




                      Nancy O.

                      • 8. Re: php form shows php
                        mhollis55 Rockstar

                        Or, just simply mount it on a web server that offers php (GoDaddy's cheap servers don't). Put what you are working on and aren't ready to show to the public in a /test/ folder on that server (php doesn't care where your page is, the server simply interprets the code.


                        And the page with the php has to end with the .php extension, which will tell your server to interpret the code.


                        You can work with php in two ways: Dreamweaver kind of encourages putting php stuff in-line with HTML on a page. People who write a lot of php code like the HTML page to call an external php file. That way everything is separate.


                        But if your HTML pages have php code in them, you must give it the extension .php and not .html or .htm

                        • 9. Re: php form shows php
                          jeeb.fr Newcomer

                          Again, thanks for your replies.


                          Nancy, I have just started the download of wamp, thanks for the hint!


                          Out of curiosity, is there a basic php tutorial anyone could recomend? I currently work with HTML and its no big problem, however as far as I understand it, using php amongst other things is the reason for a tidy address bar? for example, here the thread is http://forums.adobe.com/thread/1188692 where I know should it have been html, the address would be http://forums.adobe.com/thread/1188692.html


                          is that just my poor knowledge, or is that correct and the reason for the "cleaner" URL's.


                          Ideally I would like to be able to improve the site where I can, and if that means taking a little bit of time to learn the bog basics of PHP I want to do so!

                          • 10. Re: php form shows php
                            Nancy O. Legend

                            .html pages are static.  They do not parse data or execute scripts.


                            PHP is a server-side programming language for creating dynamic sites.  The .php file extension tells the server to execute PHP scripts & parse data (usually from a MySql database) into web pages.   PHP does not create clean URLs. 


                            This web forum uses ColdFusion as its programming language. In other words, all the pages on this site have .cfm file extensions.



                            Nancy O.