Thursday, January 17, 2013

Microsoft HTTPAPI/2.0 disabling Apache

 

I’be been working on php for 2 months now and developing on my laptop with WAMP installed before uploading to work’s dev server. Now working with SQL Server instead of MySQL, I’ve installed SQL SERVER 2008 CTP for test and suddently Apache went down as port 80 was used by Microsoft HTTPAPI/2.0.
I then found SSRS (SQL Server Reporting Services) was still running after uninstalling SQL Server 2008 as it features a web service even though IIS is not installed according to wiki.
I couldn’t find any info on google relating to this small issue that puzzled me for a short while. i hope this helps finding ppl stupid like me sometimes to solve their problem

 


Monday, January 14, 2013

entered value from child window to parent window

From a child window or a small window once opened, we can transfer any user entered value to main or parent window by using JavaScript. You can see the demo of this here. Here the parent window is known as opener. So the value we enter in a child window we can pass to main by using opener.document object model. So if the name of the form in parent window is f1 and the text box where we want the value to be passed is p_name ( in parent window ) then from the child window we can access them by using the object.

opener.document.f1.p_name

The value for this object can be assigned like this

opener.document.f1.p_name.value="Any value";

We will try to make it interactive so we will assign this to a value entered by the user. Then we will use one input box in child window and name it as c_name. So we can pass the value of the input box of child window to the parent window input box by this line.

opener.document.f1.p_name.value = document.frm.c_name.value;

Related Tutorial
Refreshing the parent window
Opening Window
We will keep this line inside a function and call this function on click of a button. Inside the function after executing the above line we will add the code to close the child window. Like this ..

opener.document.f1.p_name.value = document.frm.c_name.value;
self.close();

To open the child window this is the code used in parent window



Your Name
onClick=window.open("child3.html","Ratting",
"width=550,height=170,left=150,top=200,toolbar=1,status=1,");>Click here to open the child window


Inside the Child window code is here






(Type a title for your page here)










Your name

In the above code take care that there is no line break ( in parent file ) in line saying onClick=window.open(......

How to create GD Image from base64 encoded jpeg?

How to create GD Image from base64 encoded jpeg?

 

$data = base64_decode($_POST['image_as_base64']);

$formImage = imagecreatefromstring($data);
"String" does not mean a "real" string. In that case it means bytes/blob data.