This is a discussion on show json in browser? within the PHP Language forums, part of the PHP Programming Forums category; Hello, a browser will download the file test.php instead of to display it, if the content type is text/...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello,
a browser will download the file test.php instead of to display it, if the content type is text/x-json. Is it possible to display the text in the browser? == file: test.php == <?php header("content-type text/x-json") echo "test"; ?> thanks best regards, schuen |
|
|||
|
xu.devel@googlemail.com kirjoitti:
> Hello, > > a browser will download the file test.php instead of to display it, if > the content type is text/x-json. > > Is it possible to display the text in the browser? > Yes, set the content-type to something the browser can handle (text/plain, for example) instead of text/x-json. -- Rami.Elomaa@gmail.com "Wikipedia on vähän niinq internetin raamattu, kukaan ei pohjimmiltaan usko siihen ja kukaan ei tiedä mikä pitää paikkansa." -- z00ze |
|
|||
|
Rami Elomaa wrote:
> Yes, set the content-type to something the browser can handle > (text/plain, for example) instead of text/x-json. Alternatively, configure the browser to open text/x-json documents itself. -- Toby A Inkster BSc (Hons) ARCS http://tobyinkster.co.uk/ Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux * = I'm getting there! |
|
|||
|
Toby A Inkster wrote:
> Rami Elomaa wrote: > >> Yes, set the content-type to something the browser can handle >> (text/plain, for example) instead of text/x-json. > > Alternatively, configure the browser to open text/x-json documents itself. How? -- -Lost Remove the extra words to reply by e-mail. Don't e-mail me. I am kidding. No I am not. |
|
|||
|
Lost wrote:
> Toby A Inkster wrote: > >> Alternatively, configure the browser to open text/x-json documents itself. > > How? Depends on the browser being used. In Opera it's in Preferences => Advanced => Downloads -- Toby A Inkster BSc (Hons) ARCS http://tobyinkster.co.uk/ Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux * = I'm getting there! |
|
|||
|
Toby A Inkster wrote:
> Lost wrote: >> Toby A Inkster wrote: >> >>> Alternatively, configure the browser to open text/x-json documents itself. >> How? > > Depends on the browser being used. In Opera it's in > > Preferences => Advanced => Downloads Thanks. -- -Lost Remove the extra words to reply by e-mail. Don't e-mail me. I am kidding. No I am not. |