We have a nice looking dynamic website developed in php. server is IIS7.
Also I have a asp.net user control[ascx], which is a special utility calendar with a nice UI and lot of DB interactions.
Can I put this asp.net user control inside one of the php file?
No you cannot do this in a normal way. You can do this if you use an Iframe and call an asp.net page where your user control exists in your php website.
Related
I am trying to make a single page web app that runs over a websocket for all server request. After the user logs in, I want the page to change the html to display a dashboard (first page).
I have a template for the dashboard already build from a previous version. I need to find a way to input database info into template and send the page over the websocket as a string for the javascript to display.
I don't know how to fill the template using php classes without hard coding it into the class, then turning it into a string so I can send it. The dashboard is very complex and has dynamically built menus for each users per their settings and permissions.
Am I looking at this whole problem wrong? I have some experience with MVC from ruby on rails/node.js, but unfortunately this app is stuck using php. Can I use a framework with the socket? Should I have the JS load the template through https and send the data over the socket? (The JS guy would not like that).
I am running Ubuntu, apache2, php7, Ratchet WebSocket(wss), composer, and MySQL all on AWS.
I would definitely let the frontend get the required data. You could use php as a backend to test the authentication, parse the request, get the data from the database and send it to the frontend. The frontend then would need to update the application using dom manipulation (think jQuery).
Or, php could send a generated view that would be shown in a div in the frontend.
In this setup, I would not recommend websockets, but just plain AJAX.
From what I gather from your question, you might be better of using a real SPA framework like AngularJS. It it just better in using the data you will get from the backend. You could then choose to use a PHP backend using AJAX or a Websocket backend like nodejs.
I need to daily update a Wordpress backed website pages based on a text input I get via email. So I wrote an iOS app that parses the input text, based on some rules generates HTML page and with some googling I prepared a php code that inserts my updated pages directly into the Wordpress MySQL database and also updates other table so the site menus reflects the newest changes. So far so good.
I am now looking into ways how to automate this workflow further so that I don't have to copy the input text into my iOS app and run the website update every single day. I am seeking a way how to expose the Swift code I have written directly to the Wordpress admin panel, so the website administrator can update the site on his leveraging the Swift code I have already done.
I think you're going to want to write this in PHP or some other language that can run on the Web server and directly access the MySQL database. I suppose you could make a Cocoa Application to run on a Mac to do this and repurpose your Swift code, but I'm gonna bet your Web server isn't running on a Mac.
Take a look at these:
Handling Forms in PHP
Connecting to MySQL from PHP
PHP Basics
I am taking over a community website that was built using Kentico (an ASP.NET-based CMS).
I have PHP/CodeIgniter code that could add interesting functionality to this Kentico website. For example, my PHP code allows for uploading and posting of user-generated material such as images, which the community can then comment on.
Since I'm unfamiliar with how Kentico works, I wonder if anyone knows if this functionality exists in it (as a module). If not, either this
would have to be coded in ASP.NET or
I could have a hybrid website using my PHP code, however authentication from the Kentico side would have to be passed the PHP side of the website.
Any suggestions on how to handle this situation?
You can store the authenticated session in the DB where both ASP and PHP have access
Look into the "User contributions module" - if you've got access to a new enough version of Kentico and the appropriate license then it will probably do exactly what you need it to.
Otherwise if you needed to do authentication from a seperate PHP app, I suppose you could write a simple web service in .Net and add it into the Kentico site. In the past I've used a .ashx generic handler to do this.
Maybe you could include a hidden iframe to the other site on each page and use postMessage in JavaScript to send a session ID between the sites.
I would probably try to keep everything all in one code base unless there was reason to break it out into a seperate module though - otherwise it just seems like a lot of extra work.
I have created web application where I used CodeIgniter for secure form, also I have connect with remote MySQL database.
Now I want create mobile app in PhoneGap. I never used it before so I need to ask about a few things.
Can I create in PhoneGap php folder and there make PHP file to connect with my database?
How to secure form in my mobile app? Can I use CodeIgniter? If yes: how? Just paste CodeIgniter files to phonegap www folder?
I hear something about AngularJS. Can I use it for secure form? maybe CodeIgniter is not necessary?
Sorry for noob questions ;)
What you have created is called a Web App.
What you you would like to create with PhoneGap is a Hybrid App.?
PhoneGap/Cordova framework contains a Browser and has plugins that can be added to access Native features which can be accessed through JavaScript.
Native features of the phone like Contacts, Calendar, GeoLocation, Accelormeter etc. Which is not possible when you use a Mobile Browser. Hence the name Hybrid App
(Using the term Browser for simplicity sake. A more appropriate term is Webview container.)
So any web application that uses HTML5, CSS3 and JavaScript will work with PhoneGap/Cordova.
PhoneGap allows you to create Hybrid Apps for all the platforms Android/IOS (Iphone)/Windows/BlackBerry.
Now comming to your questions.
Q1)
You do not need to create any folder.
You just need to point the startup (index.html) file to your Webserver address.
Q2)
As informed earlier your Hybrid app is a like a Browser(with additional features) so the same codeigniter code for securing the form will work.
I hear something about AngularJS. Can I use it for secure form? maybe Codeigniter is not necessary?
Codeigniter is a Serverside scripting tool which is used for processing server side request.
AngularJS is a client side JavaScript framework which is used mostly to create a SPA ( Singe Page Application) web application.
SPA web application relies heavily on AJAX
EDIT 1:
In the index.html file which will be located in the assets\www directory you need to add the following code in the head tag.
<script>
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
// Now safe to use the Codova API
window.location="http://your.website"; }
</script>
You also need to tell Cordova that it is safe to load your website in the config.xml properties (you can remove the subdomains part if you don't have any)
<access origin="http://your.website" subdomains="true"/>
I'm using php & MySQL to develop my web based HRM system. Iam genarating leave report then i need to get printout automatically after loading full report (without opening print dialog box .)
this is possible or not?
thanks;
I am sorry to say that this is not possible within the context of a web page. If you design a (browser) plugin, then you can use the plugin to do so, but all users would need to install this plugin for it to work.