using PHP in iphone - php

Hey friend as you know I am new in iphone I didn't know any think about can anyone help me.
Can I use PHP in iPhone for storing music file And get get this file again when ever I need this any one who can help out this condition or give some hint to solve this
Previously I also put one question about this.But it is with the cloud server using in iphone
please help me friends .

If you mean to natively run on the iPhone, no. PHP is a server side script for web development, you can have a website developed with it and access that website using the iPhone just fine. As far as uploading from the iPhone you cannot do that either as Safari does not have access to the file system. If needed you could develop a custom application that would allow uploads to your website.

PHP is a server side scripting language, iPhone uses Objective-c, it means the answer to your question is Plain "NO", well you can always go with other way round, you can create a iphone optimized web application using PHP and Javascript, and access it in your iPhone using the web browser like safari.

Related

Can PHP be accessible offline?

My Employer would like me to take a web application written entirely in PHP to be accessible while offline. (it has to be accessible by an ipad without internet connection.)
I have tried the following things:
http://solesignal.com/draftcode/
http://blog.smartbear.com/codereviewer/15-code-editors-for-the-ipad-for-free-or-very-cheap/
https://itunes.apple.com/us/app/offline-pages-save-complete/id364859644?mt=8
Before I'm going to spend any money i have to be 100% positive it works.
Does anyone know how i can achieve this?
What do you mean by offline?
If you're looking to embed the server within your app, you're out of luck, it's not possible nor allowed. However if you want to run a local environment in your computer, take a look at MAMP
Knowing more about Mike's question, He's trying to run a website/webapp made in PHP offline/stand-alone on iOS devices.
As PHP is a pre-processor, this is not possible without a seperate server doing the magic. Depending on what this application has to do, I suggest you try to re-make the webapp so it does not use PHP. A lot of the things done with PHP can also be done client-side with JavaScript.
If you require more sophisticated things, try looking into the Meteor Framework. It supports PhoneGap exportation natively so the applications can run stand-alone on mobile devices as apps.
EDIT: If you can use an android device, you CAN run a PHP server on the same device as the pages are displayed because android is simply more open then iOS. If you're not willing to re-write the PHP code to JS, grab an android tab and use a PHP server package for android like this or another one that does include a MySQL server like this one

Packaging files for iOs development in adobe air application

I'm working on a simple iOs APP in adobe Flash CS6 AIR application. the app would have a registration and Login form which communicate with MYSQL database on my server using PHP and Flash (well flash wont be flash once its packaged as iOs).
now the question that i have its confusing me alot is that do i need to include the PHP files when i package the APP in flash?
its all a bit confusing because on the normal server/domain all you do is place the Flash file and PHP in the same directory or folder on the same server and it would work but on an iPhone APP, there is no server and I'm not sure how the MYSQL connection in php would work!
could someone please shed a light on this?
Thanks in advance
When you create your iOS application. You only need to include the files are that going to be directly running on the device (ie. additional SWC's and images). The PHP file since it is going to be accessed elsewhere will not be required to be added. Also just a word of device, make sure to compile the iOS application with the most recent Version of AIR, or Apple will reject it.

Database record wont show on my mobile application

I use html5 + css3 + jquery mobile to built my mobile application. Actually I've already desktop version, and i want to make mobile application.
Is that true php wont work on html5 for mobile application?
If that true, i use ajax for call my JSON (that place create on jsontext.php).
I tried HTML5 on desktop browser and it worked.
I built it to apk using build.phonegap.com and install the apk to my device.
After that, my database record not showing. Maybe it didn't execute.
Other user in stackoverflow said we can use backbone.js. how-to-access-a-remote-database-from-jquery-mobile-application
are my steps right? or I have to use backbone.js. THX.
Here's some answers:
Yes, php won't work in a mobile native/hibrid mobile application,
because php needs to be interpreted by a php server before
generating output.
Its easy and simple to both generate and parse JSON, it's widely
used in apps.
That is good. If you want an 'online-only' kind of app, you can use
a webview and point it the url of your app - its basically a browser
without navigation buttons and user interface - but something's
don't work that well, you should test before. It may also display
your app as sluggish and unpolished.
No problem with that, Cordova/Phonegap is actually becoming a very
good mobile framework. You should also install ADB
(http://developer.android.com/tools/help/adb.html), ADT
(http://developer.android.com/tools/help/adt.html) and the Android
device emulator
(http://developer.android.com/tools/help/emulator.html).
You must be sure on how to insert and retrieve dabatase records.
This depends on how you programmed it. Be sure to have the database
available publicly (accessible only from the apps, though).
Hope I've answered your questions, and that it helped.

where I can find demo to combine SQL / PHP in Blackberry app?

I need help to programming an App that need a data from SQL Server and somehow I have to update the data too. The app will be a client side and the server will have all the database. did BB allow us to connect to PHP directly or I need to make a HTML so that page will run the JS?.
Can anyone help me, where I can find the demo? or sample about Sql and app?
I have already install eclipse and Blackberry SDK 7.1.
Lets assume you are building a horoscope app:
You input a date and zodiac sing and you get your horoscope from the server.
In this case, your client can be build from few HTML pages styled with CSS.
If you need something more fancy you can use JavaScript.
On the server side, you will need running DataBase, and support for PHP (running Apache).
In the simple variant your client will send requests (from a Form or Ajax) to
www.myServer.com/my_php_back_end.php and will display the response.
This is just a simple scenario so you can form your question better.
PHP_MySQL-Creating-Form

PHP for iPad, or other solutions

Here's a tricky one.
I'm developing a web app for iPads that will be installed as kiosks. The app is essentially a quiz. Wont need to store data in a database, but will need to process data from 1 page to another page (from questions page to results page).
Original solution was simple PHP. I have now been informed that wi-fi/3g will be unavailable to the kiosks, so they wont have access to the webserver w/ php that has been working like a charm. App needs to be browser-based.
Looked around for solutions for installing PHP on iPad, like PHPPOD from Cydia, but unsure if that is even an option for iPad...and we wont be jailbreaking them. Can this even be done w/o php?
If you won't be jailbreaking them, trying to get a working PHP interpreter on them might not be impossible, but it'll probably be at the very least annoyingly difficult (and it's unlikely Apple would approve random PHP interpreters in their app store).
I'd suggest trying to port the app to Javascript instead. If it's just a simple questions -> results flow, writing a basic Javascript web app with jQuery to help out if need be shouldn't be too painful.
If you're not jailbreaking them, then you will NOT be able to get any un-approved apps onto them. Apple does NOT want you to bypass the app store, because they want their 30% cut. Installing a PHP interpreter on an iphone/ipad would allow you to build apps outside of Apple's control - this is THE main reason why Flash will never been on an iphone - it's not just for playing movies, it's actually a pretty full runtime environment.
You could try using HTML5 local storage, or use the native SQLlite database in iOS.
Without wifi/3G you would need local storage won't you? For this you need not jailbreak your iPad & force it to work through PHP. You could do that following -
Jailbreak the app & maybe try to get your PHP solution working on iPad.
Build a native app with local storage (using sqlite or core data) & handle the display through UIWebView.
Build a HTML5 app with local storage is easy to do nowadays, again UIWebView would be used.
As Amber suggests, you could build all your quizzing logic in javascript, but I am concerned here as to where you'll store data. You need to refer to point 3.
Hope this helps...

Categories