I just wanna ask if any Mobile especially Hybrid App developer here know how to see error logs from a loaded php file.
I have a hybrid app that will post data to a php file from my website and that php file will load in the screen of my hybrid app, everything is fine, data were received by php and mysql but I wasn't able to see the image file in the location where I designated it. I have no idea what kind of error it could be so I realised that I'm not using anything to see any error logs from a php file that loaded in my hybrid app, all I can do is to see error logs from the hybrid app itself by using Safari Develop Features(for iOS). Can anyone suggest a solution for this? Thank you!
Related
I'm trying to learn React by replicating a simple CRUD page I created earlier.
The old CRUD page was a Javascript/jQuery front-end with a form. It sent data via AJAX to a PHP backend page, and the PHP page interacted with a mySQL/mariaDB database.
Everything was locally hosted on my PC on XAMPP Apache, and everything worked fine.
I have now managed to replicate the front end using React, via Create React App and it's running on localhost:3000
I am now stuck. I don't know how to make my front-end (on localhost:3000) send data via AJAX to my back-end PHP page (on localhost:80 running on XAMPP Apache)
There are a lot of us PHP / mariaDB types out there who want to continue using that sub-stack as our back-end. The answers to this question will be enormously helpful in encouraging our crowd to try Create React App and React (I'm loving React btw!). (I was surprised that when I searched [create-react-app] [php] in StackOverflow, I got only 2 hits.)
Update: if this is off-topic for SO, then I'd appreciate suggestions on which SE I should post this on... thanks!
Answering my own question.
The basic problem is one of CORS (cross-origin resource sharing). The error one gets is (in the Chrome console):
No 'Access-Control-Allow-Origin' header is present on the requested resource.
During development only, this issue is easily resolved by adding this line of code to the top of the PHP file:
<?php
header("Access-Control-Allow-Origin: *");
This code should never be left there in production unless you're okay with anyone in the world accessing the PHP file API.
In actual production of this React app, one would expect that the JavaScript and the PHP files would share the same domain, so there won't be a CORS issue.
I am trying to make an android app with php in a backend. In this login page I am trying to send login credentials to php file so I can echo that and store that value in variables. And also My php file is stored on server of www.myurl.com/myfolder/login.php. I know a lot more about web development but this is my first experiment with android app. I even referred several online tutorials for this. All I see is using JSON and json_encode in php but that is not solving my problem. I think I am making some other mistake or is not able to locate an error.
I'm trying to use a HTML/PHP form on my website. The problem is submit just opens a new page displaying my php as text, this is when I open the html file on my computer using Google Chrome. When I uploaded to my hosting service, TK dot com, I get a 405 error when using the form. I've tested on working/downloadable php forms and the same thing happens.
From my understanding, I can't just use php on my site without setting up an environment. I've read I need to use some sort of program to do this (apache). Which kind of confuses me further, how would I enable this type of service, which installs to my computer, to run on my website when my computer is off?
Any tips or guides on how to do use apache for PHP forms on my website or similar that I can be redirected to would be really helpful. Please let me know if any extra information is needed.
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.
I'm having a little problem with the whole Facebook app development.
I created an facebook application and gave it an IP for my server.
I set my .php script file on the server and set the secret key and appId.
When I click on the app on my Facebook account to reach it, I get an "Uploading (0%)" text on the bottom of the browser and eventually I get a message:
"This webpage is not available".
When I used the "Heroku" hosting service, I got an app.
I think the problem is the communication between Facebook and my server but I don't know what.
I tried almost everything.
Can somebody help me?
If you issue a request to your application from the linter tool?
http://developers.facebook.com/tools/debug
If you run your own application url through there and don't see any activity then Facebook just cant access your server and you need to do some work with your firewall.