Skip to main content

Posts

Showing posts with the label server

How does header() work?

A little context: I needed to run PHP scripts in a browser, but I didn't want to go to all the trouble of installing a server and suffer the overhead of running a server on my computer and all the stuff that goes with it, including firewalls, blah blah blah.

Making a webserver using jsp and java

Using Google App Engine SDK: webpage: http://hwsejk.appspot.com/ I'm trying to make a web server using java and jsp (it is a web server for an iPhone application). I don't know a lot about java so I'm having a lot of troubles trying to construct a server by myself. For now, I have tried implementing cookie, database, and some other methods. Now that I've given you basic information about my web server, I have a few questions to ask. Is it the right approach to use java and jsp to make a web server like this? the java servlets get and send user inputs to different jsp pages, which contain some HTML and java code. But I've found some posts here that it's a bad practice to use jsp like this. I don't know how else I can make webpages. Could anyone please recommend the right approach to make a web server (like the one linked above)? I would love to know if there is some kind of a template that I can take a look at.

Writing data from my app to csv & upload it?

I wondered if it's possible to write some data to csv file in the documents path, or other convenient readable file. For example - i have a few text fields that i want the user to fill & then i want him to click "send" & after that the information will be written on a file that i could easily read & upload to my server. In my case i have an app that i want people to register for my members club, with first name, last name & phone number & i want to take this information & read it easily after is uploaded to my server. For testing i'm using my dropbox account as a server. Is it possible? Thanks for the help :)

how to remote database mysql XAMPP from another computer?

the script of connection = <? $server = "192.168.0.167"; $username = "root"; $password = ""; $database = "dbbook"; mysql_connect($server,$username,$password) or die("Koneksi gagal"); mysql_select_db($database) or die("Database tidak bisa dibuka"); ?> and i had add this script on my.cnf file after [mysqld] = bind-address=192.168.0.167 but it didnt work with the following caption mycomputer.mshome.net is not allowed to connect to this Mysql server Please help me.How to remote database mysql XAMPP from another computer ?

creating a Java Proxy Server that accepts HTTPS

i already have a working HTTP proxy server that can handle multiple HTTP request. now my problem is how do I handle https request? here's a simplified code i am using: class Daemon { public static void main(String[] args) { ServerSocket cDaemonSocket = new ServerSocket(3128); while(true) { try { Socket ClientSocket = cDaemonSocket.accept(); (new ClientHandler(ClientSocket )).start(); }catch(Exception e) { } } } } and the ClientHandler class ClientHandler extends Thread { private Socket socket = null; private Socket remoteSocket = null; private HTTPReqHeader request = null; ClientHandler(Socket socket) { this.socket = socket; request = new HTTPReqHeader(); request.parse(socket); // I read and parse the HTTP request here } public void run() { if(!request.isSecure() )

How do I select only the root domain from $_SERVER["HTTP_REFERER"];?

I want to have a 404 page that can detect if a user has come to that page either via my site, via my shortened URL or via another site, and I am making it using PHP. I am slowly getting to grips with PHP and this may well be a simple question, but I am quite tired to be honest and have no caffeine in my system, and I am wanting to tie up any loose ends in my portfolio as soon as possible. I have found the $_SERVER['HTTP_REFERER']; PHP variable gives me the entire URL, which is a start. Is there a way that this can give me only the root domain, either via another variable or a function, bearing in mind that some referrers may be using http:// and some https:// (so simply starting from the seventh character would not always work)? That way, I can match the URL based on two (or more) predefined addresses and produce the content that relates to that domain.

How to Bind SWFs to a Host?

I'm working on a major Flash project that is going to be the core content of a site. As most of you well know, almost any site can be entirely copied by copying the cached files and the hierarchy (files and folders structure), and it would run without problems on an Apache server with PHP enabled, if used. What I would like to know is: How to bind SWF files to run on a specific host? The SWFs will be encrypted, so outsiders won't have access to the methods used to stop the SWF from running on a different host, question is: what method to use? I think the solution could be hardcoding the host IP inside the SWF, so if the SWF is looking for 123.123.123.123, only a host with that IP would allow the SWF to run further. The issue is that AS3 alone can't discover the host IP or could it if it's trying to load a resource file? Anyway, that's why I need your help. EDIT: Ok, seems someone asked for something similar earlier: Can you secure your swf so it checks