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

by 13 replies
16
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
#main internet marketing discussion forum #code #experts #kompozer #page #removing #stop #top
  • can't she just put the code Right after the html tag?

    :confused:
  • 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
  • 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
    • [1] reply
    • 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
    • [DELETED]
  • Thanks a shame, I was thinking that might be the only way out - thanks guys, I'll pass it on

    cheers
    Sam
  • 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.
    • [1] reply
    • 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
  • 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
    • [1] reply
    • 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
  • right click html file, open with notepad, paste php code, save, upload.

    Pretty simple.
    • [1] reply
    • 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
  • 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
    • [1] reply
    • Dang too bad it's not Mac friendly (I don't run emulators). I've run into the same issues with NVU and now Kompozer so I just edit right from my FTP client by opening it with text editor.

Next Topics on Trending Feed