Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

PHP include

I'm clearly new to it, yet stuck already. Probably a very very simple solution/answer…

Can someone give me a simple example on how to include a simple php file (e.g. echo..) in the index.html (as stored in the projects 'resources' file.

I can't seem to include anything. The PHP file is surely loaded for buggy PHP scripts return an error on launch. Yet even the simplest echo does not do anything.

I tried to launch a mac desktop app.

— asked October 23rd 2010 by dirk dorme
  • desktop
  • mac
  • php
0 Comments

4 Answers

  • This page may help http://developer.appcelerator.com/doc/desktop/php

    — answered October 23rd 2010 by John McKnight
    permalink
    0 Comments
  • I used that page to indeed embed PHP. I tried with js, which worked. Same script different language (PHP) did not work. So the page you referred to does not really answer the question.

    Following error:

    [08:07:55:948] [Titanium.PHP] [Debug] preprocessing php => app://kkdfjdk.dfd.d/test.php
    [08:07:55:958] [Titanium.Proxy] [Debug] Checking whether https://api.appcelerator.net/p/v1/app-track should be bypassed.
    [08:07:55:958] [Titanium.Proxy] [Debug] No bypass
    [08:07:55:959] [Titanium.Proxy] [Debug] Using direct connection.
    test 5(10249,0xa069a500) malloc: *** error for object 0x1875ba4: incorrect checksum for freed object - object was probably modified after being freed.
    *** set a breakpoint in malloc_error_break to debug
    
    — answered October 24th 2010 by dirk dorme
    permalink
    0 Comments
  • include like this:

    <script type="text/php" src="index.php"/></script>

    echo will not work, because it outputs in console.

    You need to insert the content into doom.

    like this:

    global $jQuery;
    $jQuery('#container')->append('whatever you want to echo');

    — answered December 11th 2010 by Tinu Coman
    permalink
    0 Comments
  • The php "echo" works, but you don't have to load/include php in html-files !

    You have to load the php files itself !

    — answered July 11th 2011 by M. S.
    permalink
    1 Comment
    • Thanks a lot !! You comment helped me a lot !!

      — commented June 7th 2012 by Kusum Saini
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.