Kompozer experts - how to stop it removing code at top of the page?

13 replies
Hi Kompozer experts,

I've got a client using Kompozer who is trying to paste some PHP code at the very top of her webpage.

Kompozer removes anything above the <HTML> tag when you save it, though - does anyone know how to stop it?

Thanks!
Sam
#code #experts #kompozer #page #removing #stop #top
  • Profile picture of the author Jose Delgado
    can't she just put the code Right after the html tag?

    :confused:
    {{ DiscussionBoard.errors[197416].message }}
  • Profile picture of the author samstephens
    Unfortunately not - the code creates a cookie session, which needs to be the very first thing on the page.

    The HTML tag creates a browser output, which starts the session, and so by the time too cookie is set you get a "session already started" error.

    I actually thought Kompozer was a little more PHP friendly than this?

    cheers
    Sam
    Signature
    DLGuard v5 - The Warrior Edition
    Full integration with JVZoo, DigiResults, and WSO Pro for secure WSO's and WSO memberships.

    www.dlguard.com
    Serving the Warrior Forum since 2004
    {{ DiscussionBoard.errors[197438].message }}
  • Profile picture of the author Michael Oksa
    Hi Sam,

    This may not be the best solution, but it should work. I had a similar issue with NVU.

    What she may have to do is upload the file to her server, and then go into to the file by logging into her hosting account and editing the file there.

    After I did that, the PHP code stayed. It may be a bit of a hassle, but it works.

    All the best,
    Michael Oksa
    Signature

    "Ich bin en fuego!"
    {{ DiscussionBoard.errors[197448].message }}
    • Profile picture of the author thecableguy
      I used to have to add it by hand with notepad after the page was completed, and then don't open it in Kompozer, or if you do add the code back with notepad again. No matter what I tried it used to unencrypt some code.

      Alan
      {{ DiscussionBoard.errors[197461].message }}
  • Profile picture of the author samstephens
    Thanks a shame, I was thinking that might be the only way out - thanks guys, I'll pass it on

    cheers
    Sam
    Signature
    DLGuard v5 - The Warrior Edition
    Full integration with JVZoo, DigiResults, and WSO Pro for secure WSO's and WSO memberships.

    www.dlguard.com
    Serving the Warrior Forum since 2004
    {{ DiscussionBoard.errors[197465].message }}
  • Profile picture of the author cypherslock
    Well, kompozer is a straight HTML editor. It doesn't do php. I've found the best thing for me is this: If I'm doing anything with PHP I use a free editor called aptana. If it is something quick I use kompozer.
    {{ DiscussionBoard.errors[198193].message }}
    • Profile picture of the author Chri5123
      Hi

      I think there is an option in Kompozer where you can tell it not to modify the code when you upload the page.

      Ask her to look in the oprions and it should be something like "Do not reformat HTML code"

      I know you are talking about php but this may be the problem.

      At least I had a simalar issue with NVU.

      All the best

      Chris
      {{ DiscussionBoard.errors[198249].message }}
  • Profile picture of the author samstephens
    Well, kompozer is a straight HTML editor. It doesn't do php. I've found the best thing for me is this: If I'm doing anything with PHP I use a free editor called aptana. If it is something quick I use kompozer
    I agree, Kompozer is just a straight HTML editor, though they do allow PHP code to be added.

    The problem is they seem to stick to a "we know best" model, where they block anything that isn't basic HTML.

    For example, it seems you also can't save a file that doesn't have any HTML tags in the top.

    Why would you want a file with no HTML tags in the top?

    This is very common for "include" files, were you're using various HTML files as a template.

    But Kompozer blocks this as well.

    When software tries to get too smart for it's own good, it dramatically decreases it's usefullness.

    This was one of the downfalls of Frontpage, back in the day. I think it still trys to "clean" your code up, but there is an option to turn it off.

    Dreamweaver's biggest strength is it doesn't force the user to play by it's own rules. It assumes the user knows what they're doing. It's refreshing.

    A shame, because Kompozer is a great free solution, apart from this.



    Hi Chris,

    I tried those settings, but they didn't seem to make any difference. I'm not sure what they do, actually?

    Either these both On and Off, Kompozer still removes tags at the top of the page.

    Thanks for the help, though! It looks like my client may go for a different solution.

    cheers
    Sam
    Signature
    DLGuard v5 - The Warrior Edition
    Full integration with JVZoo, DigiResults, and WSO Pro for secure WSO's and WSO memberships.

    www.dlguard.com
    Serving the Warrior Forum since 2004
    {{ DiscussionBoard.errors[201836].message }}
    • Profile picture of the author AndrewCavanagh
      I've had exactly the same problem.

      I just create the page, edit it etc in Kompozer then after I'm finished add in the PHP by opening the page in Notepad.

      It is annoying that if you have to edit the page with Kompozer again you also have to use Notepad after you're finished to add the PHP back in.

      It does work though.

      If anyone has a better solution I'd love to hear it.

      Kindest regards,
      Andrew Cavanagh
      {{ DiscussionBoard.errors[201838].message }}
  • Profile picture of the author GarrieWilson
    right click html file, open with notepad, paste php code, save, upload.

    Pretty simple.
    Signature
    Screw You, NameCheap!
    $1 Off NameSilo Domain Coupons:

    SAVEABUCKDOMAINS & DOLLARDOMAINSAVINGS
    {{ DiscussionBoard.errors[201849].message }}
    • Profile picture of the author samstephens
      Originally Posted by GarrieWilson View Post

      right click html file, open with notepad, paste php code, save, upload.

      Pretty simple.
      It is simple, but after having to do that ever time you want to change something on your page will get a little tiresome.

      The best solution is for Kompozer to give an option to NOT modify source code automatically.

      Some philosophy for the morning:

      "A masterful programmer is not he who can offer the best features, but he that can offer the best user exerpience." -- Sam Stephens, 2008



      cheers
      Sam
      Signature
      DLGuard v5 - The Warrior Edition
      Full integration with JVZoo, DigiResults, and WSO Pro for secure WSO's and WSO memberships.

      www.dlguard.com
      Serving the Warrior Forum since 2004
      {{ DiscussionBoard.errors[203576].message }}
  • Profile picture of the author samstephens
    I just found an alternative - better than Kompozer, and doesn't mess with your code:

    http://www.warriorforum.com/main-int...-kompozer.html

    cheers
    Sam
    Signature
    DLGuard v5 - The Warrior Edition
    Full integration with JVZoo, DigiResults, and WSO Pro for secure WSO's and WSO memberships.

    www.dlguard.com
    Serving the Warrior Forum since 2004
    {{ DiscussionBoard.errors[203626].message }}

Trending Topics