Rectangle 27 5

Content-Type: application/json is just content header, the content header is just information about type of returned data, ex::JSON,image(png,jpg,etc..),html. Keep in mind, that JSON in javascript is an array or object. if you want to see all the data, use console.log instead of alert

alert(response.text);//will alert "[object Object]" string
console.log(response.text);//will logging all data object

if you want to alert original JSON as string, than add single quotation marks ('):

echo "'" . json_encode(array('text' => 'omrele')) . "'";
//alert(response.text) will alert {"text":"omrele"}

Do not use double quotes, it will confuse javascript, because JSON uses double quote on each value and key:

echo '<script>var returndata=';
echo '"' . json_encode(array('text' => 'omrele')) . '"';
echo ';</script>';

//it will return wrong javascript code: 
<script>var returndata="{"text":"omrele"}";</script>

javascript - HTTP Content-Type Header and JSON - Stack Overflow

javascript php json http
Rectangle 27 5

Content-Type: application/json is just content header, the content header is just information about type of returned data, ex::JSON,image(png,jpg,etc..),html. Keep in mind, that JSON in javascript is an array or object. if you want to see all the data, use console.log instead of alert

alert(response.text);//will alert "[object Object]" string
console.log(response.text);//will logging all data object

if you want to alert original JSON as string, than add single quotation marks ('):

echo "'" . json_encode(array('text' => 'omrele')) . "'";
//alert(response.text) will alert {"text":"omrele"}

Do not use double quotes, it will confuse javascript, because JSON uses double quote on each value and key:

echo '<script>var returndata=';
echo '"' . json_encode(array('text' => 'omrele')) . '"';
echo ';</script>';

//it will return wrong javascript code: 
<script>var returndata="{"text":"omrele"}";</script>

javascript - HTTP Content-Type Header and JSON - Stack Overflow

javascript php json http
Rectangle 27 6

In my case, I wanted to see .htaccess files, but not all the other .* resources. In Zend Studio for Eclipse, in PHP Explorer (not Remote System Explorer), click the downward facing arrow (next to the left/right arrows). Choose Filters. Uncheck .* resources In the "Name filter patterns" area, type the filenames you want to ignore. I used: .svn, .cvs, .DS_Store, .buildpath, .project

How can I get Eclipse to show .* files? - Stack Overflow

eclipse file hidden
Rectangle 27 6

In my case, I wanted to see .htaccess files, but not all the other .* resources. In Zend Studio for Eclipse, in PHP Explorer (not Remote System Explorer), click the downward facing arrow (next to the left/right arrows). Choose Filters. Uncheck .* resources In the "Name filter patterns" area, type the filenames you want to ignore. I used: .svn, .cvs, .DS_Store, .buildpath, .project

How can I get Eclipse to show .* files? - Stack Overflow

eclipse file hidden
Rectangle 27 1

Here is working code for something that will take what is typed by the user into a text box and use that as the src for the iFrame. Check your console to see if there are further errors (like Mixed Content security warnings, etc.).

<script>
function myFunction() {
    url = document.getElementById('newURL').value;
    url = url.replace(/^http:\/\//, '');
    url = url.replace(/^https:\/\//, '');
    url = "https://" + url;
    document.getElementById('myframe').src = url;
};
</script>
<input type="button" id="mybutton" value="Home Page" onclick="myFunction()" />
<input type="text" id="newURL" />
<iframe id="myframe" src="">

</iframe>

I've updated the script to remove http:// and https://prefixes before prepending https:// to ensure it tries to fetch secure resources.

Ok, I have tried it, and it does not work. Here is the actual url where it is: hypnomindcontrol.net/testing/mytest.html

OK. The only errors I'm getting are security errors. Because you are serving from HTTPS, the iframe won't show anything from an non-secure location.

If you try something like https://www.xkcd.com in the text box it should work because it is served over https. If you use the normal http:// protocol it will not load.

You could force the script to prepend https:// (and remove http:// if it exists), but there are sites that still won't serve over an iFrame and some that don't have https enabled anyway.

javascript - I need to dynamically update an iframe using an input fro...

javascript php html iframe
Rectangle 27 17

If you are dealing with images, use getimagesize. Unlike file_exists, this built-in function supports remote files. It will return an array that contains the image information (width, height, type..etc). All you have to do is to check the first element in the array (the width). use print_r to output the content of the array

$imageArray = getimagesize("http://www.example.com/image.jpg");
if($imageArray[0])
{
    echo "it's an image and here is the image's info<br>";
    print_r($imageArray);
}
else
{
    echo "invalid image";
}

Results in 404 warning when the remote resource is not available. For the time being, I handled it by suppressing error using @ in front of getimagesize, but feeling guilty for this hack.

In my case this was the best approach, because I get redirected whenever an image/file doesnt exist. I second that the suppressing errors with @ is a no go but in this case it was neccessary.

exif_imagetype

How can one check to see if a remote file exists using PHP? - Stack Ov...

php file networking testing
Rectangle 27 1

set location.href = a.php (as example). then set header content of that a.php file to csv type and then echo your csv file(see google help). Maybe this will help you. see header content for csv file for html page from google.

<?php header('Content-type:text/csv'); ?>

The same code is worning fine in my Windows XAMPP Server...

Is their any way to configure httpd.conf for prompting download for any csv file requested?? header("Content-type: text/x-csv"); header("Content-Disposition: attachment; filename=$filename"); Can content-Disposition configured in httpd.conf?

php - CSV File displayed by browser insteed of prompting download - St...

php ajax csv download httpd.conf
Rectangle 27 2

Remove the headers and look at the page, do you see any error messages? If PHP outputs anything else than the actual PDF source, the file will appear to be corrupted.

If I remove the header for the first line...its gives an output as tokina.pdf.htm

if I remove both the header's then PHP shows a page with binary encoded lines

Obvious but i didn't think about this, that helped, thank you!

php - Download file corrupt. Content-type not working? - Stack Overflo...

php download content-type
Rectangle 27 1

If you're loading from an external source, you can check the file's MIME type and see if it's application/xhtml+xml; if it is, it's most definitely XHTML (of course it can lie and serve with that type, but with horribly malformed markup). Otherwise if it's text/html then it'll be parsed as HTML tag soup. Validity of the actual markup aside, the doctype declaration is your next best way of telling whether the content is (or claims to be) HTML or XHTML.

Like you say, you can check the public identifier and/or the URI and determine the type from there.

Okay. So my test for XHTML is now: "strpos(strtolower($dom->doctype->publicId), 'xhtml') !== false". If this is not the case then I assume it is HTML. What do you think?

@Alex: That sounds alright, since browsers most often receive pages as text/html anyway, so that's a reasonable assumption. You can use stripos() instead of strpos(strtolower()).

Differentiating between XHTML and HTML with PHP DOMDocument - Stack Ov...

php html dom xhtml
Rectangle 27 1

If you're loading from an external source, you can check the file's MIME type and see if it's application/xhtml+xml; if it is, it's most definitely XHTML (of course it can lie and serve with that type, but with horribly malformed markup). Otherwise if it's text/html then it'll be parsed as HTML tag soup. Validity of the actual markup aside, the doctype declaration is your next best way of telling whether the content is (or claims to be) HTML or XHTML.

Like you say, you can check the public identifier and/or the URI and determine the type from there.

Okay. So my test for XHTML is now: "strpos(strtolower($dom->doctype->publicId), 'xhtml') !== false". If this is not the case then I assume it is HTML. What do you think?

@Alex: That sounds alright, since browsers most often receive pages as text/html anyway, so that's a reasonable assumption. You can use stripos() instead of strpos(strtolower()).

Differentiating between XHTML and HTML with PHP DOMDocument - Stack Ov...

php html dom xhtml
Rectangle 27 4

The best you could hope for is to store both MD5 and SHA1 versions, and populate the SHA1 content when the user logs in. Just check to see if the SHA1 version is available, and if not use old validation strategy.

You should, eventually, migrate most of your users over to the new SHA1/SALT based system transparently.

php - Most efficient way to change the hash type of a password (md5 to...

php database hash md5 sha1
Rectangle 27 1

I do not believe that this is safe. The same origin policies are designed to prevent the documents from different domains from accessing the content that is returned from a different domain. This is why XSRF problems exist in the first place. In general XSRF doesn't care about the response. It is used to execute a specific type of request, like a delete action. In the simplest form, this can be done with a properly formatted img tag. Your proposed solution would prevent this simplest form, but doesn't protect someone from using the XMLHttp object to make the request. You need to use the standard prevention techniques for XSRF. I like to generate a random number in javascript and add it to the cookie and a form variable. This makes sure that the code can also write cookies for that domain. If you want more information please see this entry.

Also, to pre-empt the comments about XMLHttp not working in script. I used the following code with firefox 3.5 to make a request to google from html running in the localhost domain. The content will not be returned, but using firebug, you can see that the request is made.

<script>
var xmlhttp = false; 

if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
        xmlhttp = new XMLHttpRequest();
    } catch (e) {
        xmlhttp = false;
    }
}
if (!xmlhttp && window.createRequest) {
    try {
        xmlhttp = window.createRequest();
    } catch (e) {
        xmlhttp = false;
    }
}

xmlhttp.open("GET", "http://www.google.com", true);
xmlhttp.onreadystatechange = function() {
    if (xmlhttp.readyState == 4) {
        alert("Got Response");
        alert(xmlhttp.responseText)
    }
}

xmlhttp.send(null)
alert("test Complete");

I'm giving it to Artefacto, because it looks like X-Requested-With doesn't make it through, but this was interesting. Thank you.

php - Is an X-Requested-With header server check sufficient to protect...

php ajax security token csrf
Rectangle 27 1

I do not believe that this is safe. The same origin policies are designed to prevent the documents from different domains from accessing the content that is returned from a different domain. This is why XSRF problems exist in the first place. In general XSRF doesn't care about the response. It is used to execute a specific type of request, like a delete action. In the simplest form, this can be done with a properly formatted img tag. Your proposed solution would prevent this simplest form, but doesn't protect someone from using the XMLHttp object to make the request. You need to use the standard prevention techniques for XSRF. I like to generate a random number in javascript and add it to the cookie and a form variable. This makes sure that the code can also write cookies for that domain. If you want more information please see this entry.

Also, to pre-empt the comments about XMLHttp not working in script. I used the following code with firefox 3.5 to make a request to google from html running in the localhost domain. The content will not be returned, but using firebug, you can see that the request is made.

<script>
var xmlhttp = false; 

if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
        xmlhttp = new XMLHttpRequest();
    } catch (e) {
        xmlhttp = false;
    }
}
if (!xmlhttp && window.createRequest) {
    try {
        xmlhttp = window.createRequest();
    } catch (e) {
        xmlhttp = false;
    }
}

xmlhttp.open("GET", "http://www.google.com", true);
xmlhttp.onreadystatechange = function() {
    if (xmlhttp.readyState == 4) {
        alert("Got Response");
        alert(xmlhttp.responseText)
    }
}

xmlhttp.send(null)
alert("test Complete");

I'm giving it to Artefacto, because it looks like X-Requested-With doesn't make it through, but this was interesting. Thank you.

php - Is an X-Requested-With header server check sufficient to protect...

php ajax security token csrf
Rectangle 27 1

The "LanguageType" + "Source Editor" editor types are provided by the Aptana studio, whereas the "LanguageType" + "Editor" is from Eclipse (i.e. not compatible with the Aptana bundles, although you will be able to see the commands, you cannot complete them).This is true for PHP, too. Unfortunately, there are some ways that the PDT is superior to the Aptana Studio plugin-provided "PHP Source Editor", but overall I'm starting to feel that the benefits of the PHP bundles (e.g. for Drupal development, for Wordpress dev) and for jQuery, not to mention the better support for renumbering when turning on Word Wrap (another plugin), make the Aptana Studio better, overall, so I've assigned the Aptana "source" editors for all language types and started to remove other redundant plugins to reduce the load and compatibility issues.

In short, editors with "source editor" in the name support using the Rubles/bundles, whereas the editors which you had in Eclipse before installing Aptana Studio do not. Hope that helps others... I was stumped by this for some time, too.

Many hours, 5 highly voted SO-Qestions, 3 reinstallations and dozens of Blog-posts to get work the content assistent for jQuery in Studio 3 - finally your zero voted Answer helps. Thx a lot.

Aptana Ruble for Jquery does not work properly - Stack Overflow

jquery aptana bundle
Rectangle 27 2

First of all, to see what charset s used for requests, install something like Firebug and check the 'Content-Type' header of your request/response. It will look something like 'application/json; charset=...'. This should be charset=utf-8 in your case.

My guess why it worked when posting a form is probably because of x-www-form-urlencoded - non-alphanumeric characters are additionally encoded on the client side and again decoded on the server, that's the difference to posting the data directly.

This means that somewhere there is a wrong encoding at work. PHP treats your strings agnostic to its encoding by default, so I would tend to rule it out as the source of the error. jQuery.post also uses UTF-8 by default... so my suspect is the filename variable. Are you sure it is in UTF-8? Where and how do you retrieve it?

You should probably also ensure that the actual HTML page is also sent as UTF-8 and not, let's say iso-8859-1. Have a look at this article for a thorough explanation on how to get it right.

thanks for the reply...the filename variable comes from a folder on my hard drive which i read thru php script. the folder names are the country names in spanish text.

im on mac..additionally if make the "filename" equal to espaol by myself in the code, instead of reading it from the disk. it works :S...so in conclusion the filename is not in utf-8! but i check the encoding (mb_detect_encoding() )before and after the post call and it gives me UTF-8 :S

Hmm, have not much experience with Macs... but they should use the platform default encoding similar to Linux. You could use iconv to enforce UTF-8 encoding.

php - How to ensure variables submitted in UTF8 using jquery $.post - ...

php mysql character-encoding
Rectangle 27 1

Problem: I guess you are putting extra space for content-type declaration code in His mail:. See my code there is no need for spaces before that if you will give space it will produce error.

Now the working code with correct formatting is given below:

<?php
error_reporting(E_ALL | E_STRICT);
if (isset($_POST['submit'])) {
    $sector = $_POST['cSector'];
    $cAdministration = $_POST['cAdministration'];
    $cBranch = $_POST['cBranch'];
    $cCareer = $_POST['cCareer'];
    $name = $_POST['cName'];
    $telephone = $_POST['cTelephone'];
    $cEmail = $_POST['cEmail'];
    $cMessage = $_POST['cMessage'];

    $recipient = 'info@test.com';
    $subject = "Someone apply for career";

    $myCv = $_FILES['upFile']['name'];
    $attachment = chunk_split(base64_encode(file_get_contents($_FILES['upFile']['tmp_name'])));
    $boundary = md5(date('r', time()));

    $content = "This information is for someone who apply for your new career\n
    Sector Applied For:" . $sector . ",\n
    Administration Applied For:" . $cAdministration . ",\n
    Branch Applied For:" . $cBranch . ",\n
    Career Applied For:" . $cCareer . ",\n
    His Name Is: " . $name . ",\n
    His Phone Number: " . $telephone . ",\n
    His Message: " . $cMessage . ",\n
    His Email: " . $cEmail . ",\n if he uploaded any C.V the C.V will be attached to this Email
--_1_$boundary
Content-Type: multipart/alternative; boundary=\"_2_$boundary\"

--_2_$boundary
Content-Type: text/plain; charset=\"UTF-8\"
Content-Transfer-Encoding: 7bit

--_2_$boundary--
--_1_$boundary
Content-Type: application/octet-stream; name=\"$myCv\"
Content-Transfer-Encoding: base64
Content-Disposition: attachment

$attachment
--_1_$boundary--";

    $headers = "From:info@test.com\r\nReply-To:info@test.com";
    $headers .= "\r\nMIME-Version: 1.0\r\nContent-Type: multipart/mixed; boundary=\"_1_$boundary\"";

    $sent = mail($recipient, $subject, $content, $headers);
    if ($sent) {
        header("Location:index.php?pid=17&carr=your message has been sent, we will contact you soon.");
    } else {
        echo "Error";
    }
}
?>

Yes it did but something gone wrong with the body message, yes I try you code it worked like cream but now it just sends the attached file and not the body message. thanks @Deepak Goswami

can you please tell me did it sends the attached file and the email body with you try this code or just tested the attached file thanks in advance

php - attaching file to an email - Stack Overflow

php forms email
Rectangle 27 1

then , in your success function of javascript you have :

dataType : 'json',//So we need to do the header() step in php
    success : function (result) {
       console.log(result['average'])// ???????
    },

You try to get an item of a javascript array by string index ... which is not possible.

1) You write dataType:json <<< So, the result variable is a object ! So you can access average value with :

success:function(result){
    console.log(result); // see too what we get in the request
    console.log(result.average); // thats all
}

UPDATE : in order to help you ._.

your php script is failing too because you are retrieving POST values that doesn't exist because you are not sending them !

Please read the documentation of $.ajax() here.

Try first with a simple script in php to see if your javascript works. Comment everything just let 2 lines.

header('Content-Type: application/json');
$avg = array(
'average' => $_POST["javascriptvalue"]
 );
echo json_encode($avg);

then in your javascript file add the data tag (because you need to retrieve data in your server !)

data:{
  javascriptvalue:"I'm sending this to php so it can be retrieved in my php script"
},

Finally your success javascript function should be executed without problem with :

success:function(data){
     console.log(data);//an object with average property (data.average)
   }

It should work anyway this is not dificult, read the documentation

Im still getting "avg is undefined" in the console. Should i be using something else for my data: statement

you have in your ajax :" data : avg " , what is this value in your function ? could you update your question with this information ? Remember data is the post/get etc .. that you send to the php script and retrieve it there via $_POST or whatever method you use

this is the variable im defining in PHP. I thought this was needed in the POST request. Ive removed this piece of code and now its no longer giving the undefined error, however now its giving the error alert from the jquery error function. Would it be helpful if i posted the rest of my PHP file?

Yes , keep in mind you need to set in php the header as JSON, otherwise $.ajax will throw error because the response is not json format !

ive added the updated PHP file, which includes the other functions i am using to submit data back to the database. This request will come before the SQL data creation request

javascript - Errors when attempting an ajax POST call to PHP to return...

javascript php jquery mysql ajax
Rectangle 27 1

To answer my own question, "What's the difference between HTTP__CONTENT_TYPE and CONTENT_TYPE?" If you see "HTTP__CONTENT_TYPE", it most probably means you have made mistake in setting the CONTENT-TYPE header field. Probably, when curl doesn't recognize the valid CONTENT_TYPE value, then the wrong value is set to HTTP__CONTENT_TYPE and CONTENT_TYPE takes a default value.

curl - $_POST is empty in php - Stack Overflow

php curl
Rectangle 27 1

public class UploadToServer extends Activity {

TextView messageText;
Button uploadButton;
int serverResponseCode = 0;
ProgressDialog dialog = null;

String upLoadServerUri = null;

/********** File Path *************/
final String uploadFilePath = "/mnt/sdcard/";
final String uploadFileName = "Quotes.jpg";

@Override
public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_upload_to_server);

    uploadButton = (Button) findViewById(R.id.uploadButton);
    messageText = (TextView) findViewById(R.id.messageText);

    messageText.setText("Uploading file path :- '/mnt/sdcard/"
            + uploadFileName + "'");

    /************* Php script path ****************/
    upLoadServerUri = "http://192.1.1.11/hhhh/UploadToServer.php";

    uploadButton.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {

            dialog = ProgressDialog.show(UploadToServer.this, "",
                    "Uploading file...", true);

            new Thread(new Runnable() {
                public void run() {
                    runOnUiThread(new Runnable() {
                        public void run() {
                            messageText.setText("uploading started.....");
                        }
                    });

                    uploadFile(uploadFilePath + "" + uploadFileName);

                }
            }).start();
        }
    });
}

public int uploadFile(String sourceFileUri) {

    String fileName = sourceFileUri;

    HttpURLConnection connection = null;
    DataOutputStream dos = null;
    String lineEnd = "\r\n";
    String twoHyphens = "--";
    String boundary = "*****";
    int bytesRead, bytesAvailable, bufferSize;
    byte[] buffer;
    int maxBufferSize = 1 * 1024 * 1024;
    File sourceFile = new File(sourceFileUri);

    if (!sourceFile.isFile()) {

        dialog.dismiss();

        Log.e("uploadFile", "Source File not exist :" + uploadFilePath + ""
                + uploadFileName);

        runOnUiThread(new Runnable() {
            public void run() {
                messageText.setText("Source File not exist :"
                        + uploadFilePath + "" + uploadFileName);
            }
        });

        return 0;

    } else {
        try {

            // open a URL connection to the Servlet
            FileInputStream fileInputStream = new FileInputStream(
                    sourceFile);
            URL url = new URL(upLoadServerUri);

            // Open a HTTP connection to the URL
            connection = (HttpURLConnection) url.openConnection();
            connection.setDoInput(true); // Allow Inputs
            connection.setDoOutput(true); // Allow Outputs
            connection.setUseCaches(false); // Don't use a Cached Copy
            connection.setRequestMethod("POST");
            connection.setRequestProperty("Connection", "Keep-Alive");
            connection.setRequestProperty("ENCTYPE", "multipart/form-data");
            connection.setRequestProperty("Content-Type",
                    "multipart/form-data;boundary=" + boundary);
            connection.setRequestProperty("uploaded_file", fileName);

            dos = new DataOutputStream(connection.getOutputStream());

            dos.writeBytes(twoHyphens + boundary + lineEnd);
            // dos.writeBytes("Content-Disposition: form-data; name=\"uploaded_file\";filename=\""
            // + fileName + "\"" + lineEnd);
            dos.writeBytes("Content-Disposition: post-data; name=uploadedfile;filename="
                    + URLEncoder.encode(fileName, "UTF-8") + lineEnd);

            dos.writeBytes(lineEnd);

            // create a buffer of maximum size
            bytesAvailable = fileInputStream.available();

            bufferSize = Math.min(bytesAvailable, maxBufferSize);
            buffer = new byte[bufferSize];

            // read file and write it into form...
            bytesRead = fileInputStream.read(buffer, 0, bufferSize);

            while (bytesRead > 0) {

                dos.write(buffer, 0, bufferSize);
                bytesAvailable = fileInputStream.available();
                bufferSize = Math.min(bytesAvailable, maxBufferSize);
                bytesRead = fileInputStream.read(buffer, 0, bufferSize);

            }

            // send multipart form data necesssary after file data...
            dos.writeBytes(lineEnd);
            dos.writeBytes(twoHyphens + boundary + twoHyphens + lineEnd);

            // Responses from the server (code and message)
            int serverResponseCode = connection.getResponseCode();
            String serverResponseMessage = connection.getResponseMessage();

            Log.i("uploadFile", "HTTP Response is : "
                    + serverResponseMessage + ": " + serverResponseCode);

            if (serverResponseCode == 200) {

                runOnUiThread(new Runnable() {
                    public void run() {

                        String msg = "File Upload Completed.\n\n See uploaded file here : \n\n"
                                + " http://www.androidexample.com/media/uploads/"
                                + uploadFileName;

                        messageText.setText(msg);
                        Toast.makeText(UploadToServer.this,
                                "File Upload Complete.", Toast.LENGTH_SHORT)
                                .show();
                    }
                });
            }

            // close the streams //
            fileInputStream.close();
            dos.flush();
            dos.close();

        } catch (MalformedURLException ex) {

            dialog.dismiss();
            ex.printStackTrace();

            runOnUiThread(new Runnable() {
                public void run() {
                    messageText
                            .setText("MalformedURLException Exception : check script url.");
                    Toast.makeText(UploadToServer.this,
                            "MalformedURLException", Toast.LENGTH_SHORT)
                            .show();
                }
            });

            Log.e("Upload file to server", "error: " + ex.getMessage(), ex);
        } catch (Exception e) {

            dialog.dismiss();
            e.printStackTrace();

            runOnUiThread(new Runnable() {
                public void run() {
                    messageText.setText("Got Exception : see logcat ");
                    Toast.makeText(UploadToServer.this,
                            "Got Exception : see logcat ",
                            Toast.LENGTH_SHORT).show();
                }
            });
            Log.e("Upload file to server Exception",
                    "Exception : " + e.getMessage(), e);
        }
        dialog.dismiss();
        return serverResponseCode;

    } // End else block
}
<?php
$target_path  = "./Upload/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "The file ".  basename( $_FILES['uploadedfile']['name']).
" has been uploaded";
} else{
 echo "There was an error uploading the file, please try again!";
}
?>

android - How can I add an image file into json object? - Stack Overfl...

android json
Rectangle 27 0

Wild guess : open your file with something which would display any BOM. If you see some strange characters before <?php you have your problem. Check your current editor options to save UTF-8 file and make it save them without BOM.

apache - Content-type not working in PHP - Stack Overflow

php apache content-type wamp