Some questions

Discussion in 'Developers' Forum' started by shoevring, Jul 13, 2010.

  1. shoevring

    shoevring New Member

    Hi, i got some questions about the code..

    Iam just begin to write one Module to my company, and so far it works..

    My question is: How do i create a link in the content?

    I mean if i have "orders" in list and the customer trying to click on the order i want to send the customer to example: test/web/into.php

    Normally i do this: <a href='link'>text</a> but how do i do it so the DESIGN contains in the window?

    I have found out with buttons.. :)

    Thanks for great software!
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The interface is ajax based, this maens you do not use any links to content files. Instaed you load these content into a specific regions of the page with javascript and ajax. If you look at the existing files, you can see how it works. Example:

    <a href="#" onClick="loadContent('test/web/into.php');">Link</a>
     
  3. shoevring

    shoevring New Member

    Allright, thanks alot - it works perfectly...

    I have some issues about charset, i have saved my files as utf-8 but i get this error:

    "
    Warning: Cannot modify header information - headers already sent by (output started at /usr/local/ispconfig/interface/web/neohost/userinfo.php:1) in /usr/local/ispconfig/interface/lib/config.inc.php on line 34

    Warning: Cannot modify header information - headers already sent by (output started at /usr/local/ispconfig/interface/web/neohost/userinfo.php:1) in /usr/local/ispconfig/interface/lib/config.inc.php on line 35

    Warning: Cannot modify header information - headers already sent by (output started at /usr/local/ispconfig/interface/web/neohost/userinfo.php:1) in /usr/local/ispconfig/interface/lib/config.inc.php on line 36

    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /usr/local/ispconfig/interface/web/neohost/userinfo.php:1) in /usr/local/ispconfig/interface/lib/app.inc.php on line 60
    "

    Can you help me with this?

    Thanks
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Most likely there is a whitespace or empty line at the beginning of file /usr/local/ispconfig/interface/web/neohost/userinfo.php. The file has to start with:

    <?php

    without any whitespace or other lines before that line.
     
  5. shoevring

    shoevring New Member

    <?php is the first line in the userinfo.php
     
  6. dcy

    dcy New Member

    Check in another editor, since there's a few text editors that quite silently add a char or two at the start of the file. (If using Windows check with PSPad or Notepad++).

    If that is not the case then there is a possibility that you're trying to add Headers, ie:

    <?php
    header('Location: http://www.example.com/');
    ?>

    This will not work, since the headers have already been generated by the time your script is inserted into the interface :)

    D.
     
  7. shoevring

    shoevring New Member

    I have tried in Notepad++ and there is nothing to see...

    The first line is <?php

    I have maked the file as UTF-8, its was after that the file doing this...

    But if i choose another charset, my language with special signs(æøå) not viewing correctly...

    Whats the next? I choose ANSI as filecharset and what?
     
  8. dcy

    dcy New Member

    Well, I would try to temporarily replace the .php with a very simple one (say a "hello world" style one) - just to check that I'm not doing anything the code that would cause the error you're seeing. If that temporary script should work okay - then that would mean I'm doing something in the "normal" .php that introduces these errors. (and for starters you can just comment out all the code (ie: from just after &lt;?php to just before ?&gt;), to see that it is read and included correctly.

    D.
     
  9. shoevring

    shoevring New Member

    Hello again, i just converted the script to charset ANSA and now there is no errors..

    Its okay if the file is in charset ANSA but i want my signs(æøå) to work, and its only working with UTF-8....

    But is it possible to turn the standard UTF-8 Header off on some files?
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    UTF-8 should work fine. Just use a coding editor like notepad++ to save the file in utf-8 format as this does not add any additional headers like e.g. microsoft wordpad.
     
  11. shoevring

    shoevring New Member

    I have saved the file in notepad++ as UTF-8 (Going in Format => UTF-8 ) and saved the file..

    I get the same errors like before.
     
  12. shoevring

    shoevring New Member

    Code: http://pastebin.com/u19RRgEe
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    Please open the file on the shell of your server with the "vi" editor to check if there are no chars in front of <?php. It might be that the software that you use to upload the file modifies it.
     
  14. shoevring

    shoevring New Member

    With VI in ssh:

    http://pastebin.com/Yb3q0b0r
     
  15. falko

    falko Super Moderator Howtoforge Staff

    The ^M at the end of the lines means you use Windows line breaks, but you must use Linux line breaks instead. Open the file in a text editor that allows you to save with Linux/Unix line breaks, and save it there.
     
  16. shoevring

    shoevring New Member

    So' i have converted the files, and there is still the problem with the headers..
    Notice then i have the file as charset: UTF-8 there is these errors.. But then i have the file charset: ANSA there is NO ERRORS, just my signs there not cant be displayed correctly...
     
  17. shoevring

    shoevring New Member

    Hello again,

    i found out how to use æøå with ansi, so its working now, thanks for the help..

    I have a question more.. HOW do i use the "create user" api, i cant find dokumentation about it.. Can you give me an example?
     
  18. shoevring

    shoevring New Member

    I just create a new thread about the user creation..
     
  19. BorderAmigos

    BorderAmigos New Member

    Side note: A way around this is to use a meta tag...

    <?php
    print '<meta http-equiv="refresh" content="0;url=http://www.example.com/">';
    ?>
     

Share This Page