FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


What for <script type="text/php"> is used?





shamil
Do you know for what applications
Code:
<script type="text/php">. 
is being used
Like we use
Code:
<script type="text/javascript"></script>
to work with javascript.
dxhunter
He kardes ne olmuski buna ? ikiside ayni sey ?
shamil
deyirsen ki javascript ile php -nin hec bir farki yoxdu? Smile

Code:
<script type="text/javascript"></script>


nin harada islendiyini bilirem bes diyeri harada islenir bilirsen?
ml
Quote:
<script type="text/php">


thats never used. maybe because it doesn't work Very Happy
mathiaus
Please only speak english.
Rule 2j of the forum rules ( http://www.frihost.com/forums/vt-13011.html )
Nyizsa
Code:
<script type="text/php"></script>
is just an other way to tell the parser that the code between the tags is in PHP. However it is not recommended to use, because some browsers may not translate it correctly. Use the
Code:
<?php ?>
instead. So you can disregard the above code.
For further info check out this link:
http://www.php.net/manual/en/language.basic-syntax.php
rohan2kool
1st: Code between <?php ?> is not recieved by the browser, i mean actually it is processed by the php interpretor and then the code is sent out to the browser which is nothing but text, it can be HTML or JavaScript or CSS etc.

2nd: <script type="text/php"></script> doesn't work because PHP is a server side scripting language, not a client-side scripting language. Even if the browser gets it as a script, it won't be able to process it.

3rd: Please post only in English.

Thanks.
Stubru Freak
rohan2kool wrote:
1st: Code between <?php ?> is not recieved by the browser, i mean actually it is processed by the php interpretor and then the code is sent out to the browser which is nothing but text, it can be HTML or JavaScript or CSS etc.

2nd: <script type="text/php"></script> doesn't work because PHP is a server side scripting language, not a client-side scripting language. Even if the browser gets it as a script, it won't be able to process it.

3rd: Please post only in English.

Thanks.


<script language="php"> </script> does work however... It is translated to <?php on the server. Don't know if the type attribute is working too...
rohan2kool
Quote:
<script language="php"> </script> does work however... It is translated to <?php on the server. Don't know if the type attribute is working too...


That happens because, the php installed recognizes it on the server and the client has nothing to do with it.
Stubru Freak
rohan2kool wrote:
Quote:
<script language="php"> </script> does work however... It is translated to <?php on the server. Don't know if the type attribute is working too...


That happens because, the php installed recognizes it on the server and the client has nothing to do with it.


I know that's what I'm saying.
prashu132
I have seen that type of usage in Appcelerator Titanium Framework. checkout http://www.appcelerator.com/ and their docs Very Happy Very Happy
sonam
How I know it is working but I am prefer <?php ?> way. By the way <script language="php"> </script> is more typing for no reason.

Sonam
williamjohn
I am using <?php ?>. This syntax can be used wherever in the html part.
badai
prashu132 wrote:
I have seen that type of usage in Appcelerator Titanium Framework. checkout http://www.appcelerator.com/ and their docs Very Happy Very Happy


here, read this: http://webreflection.blogspot.my/2008/04/script-type-php.html

IMO, just waste of time. jquery ajax is better and less confusing.
jestoy0514
I believe php is using
Code:
<?php ?>
and javascript is using
Code:
<script></script>
.
sailor69
Nyizsa wrote:
Code:
<script type="text/php"></script>
is just an other way to tell the parser that the code between the tags is in PHP. However it is not recommended to use, because some browsers may not translate it correctly.


I had not known that ANY browsers would accept the above code. Do you know which ones, and are they worth coding for?
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.