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.
4 Answers
-
This page may help http://developer.appcelerator.com/doc/desktop/php
-
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
-
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'); -
The php "echo" works, but you don't have to load/include php in html-files !
You have to load the php files itself !