- This topic has 12 replies, 6 voices, and was last updated 10 years, 6 months ago by mini.singh.
-
AuthorPosts
-
support-michaelKeymasterMobiOne PHP Demo
I created this simpleton MobiOne php demo. It consists of a single page UI design with a Text component who’s content is replaced with a php scriptlet that fetches and prints the current Unix time in seconds. The source for this example can be found at the bottom of this article.
Here’s the URL to online demo: PhpTextDemo
Here is the process I used to create this demo:
1) Use the Visual Designer to layout my UI.
a) Set the page File Extension property: “PHP”
b) add a Panel component and resize to fill the UI form
c) add a Text component centered on the panel
– size the Text component width to always be full screen. See next screenshot
See attachment phpdemotext-layout-70.png2) Generate PHP code that will be manually modified
In the Visual Designer for you page, click the Run in Test Center button. This will generate PHP code for the UI layout3) Manually modify the generated PHP file by adding a custom text message and scriptlet.
You can use any text editor. I used the Test Center’s embedded editor (see View Source action)
See attachment phpdemotext-src.png4) Upload all of the generated code to server and set access permissions
5) Enter URL in Test Center emulator to verify proper operation
See attachment phpdemotext.pngSource Code
See attachment phpdemotext.zipAttachments:
You must be logged in to view attached files.
kaza007MemberNice work Wayne.
Keep the demos coming.I had to modify the php to make it work in my server. Why? Apache/2.2.14 (Win32) PHP/5.2.12
Time = <xxxx print date("H:i:s", time())?>
Replace the xxxx in the code with ?PHP.
NOTE: you cannot post PHP code, even if it is within the
display. Thanks for the tip Wayne.
kaza007MemberLeaving the PHP off at the start of your code is recognised by the PHP preprocessor but is not generic across all platforms.
The ‘=’ in your code is the shorthand for the ‘echo’ command.
LansiranaMemberWayne,
this is incredible, I’ve tried it with my PHP code and it works great. This is exactly what I need. I would only like to know if this works great also when it is in native .ipa form? I cannot check that, because I still heaven’t get required Apple certificates, so please if you could help me and tell me if it works?
Thank you very much,
Lansirana
coskevinMemberI downloaded your php example and replace with a simple echo command. Nothing shows up. Here is the URL:
Any idea?
support-michaelKeymasterWill investigate and follow up later today.
coskevinMemberAny update?
support-octavioMemberHi coskevin,
AppCenter only permits static pages, that’s why your echo function doesn’t work. You should test your webapp in your own server (this can be a localserver) with php capabilities.
coskevinMemberIf it becomes a native app. Will the echo show?
support-octavioMemberHi coskevin,
The php echo function won’t work in native apps. Why do you need this function? maybe if you give us more details we could give you a work around.
mini.singhMemberHello,
When I am running this demo it doesn’t work for me. Nothing shows in screen. Please help me to run this demo.
Thanks & Regards
Surbhi Singh
support-octavioMemberHi Surbhi,
Are you testing the demo in the Web Simulator? If yes please be aware that you need to upload the generated code to your server with PHP:
4) Upload all of the generated code to server and set access permissions
mini.singhMemberHello,
Thanks for answering me, but I don’t know the procedure of how to upload code to server with PHP.
Can you tell me step by step how to upload code to server in mobione?Please help me in this.
Thanks & Regards
Surbhi Singh -
AuthorPosts