Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • September 05, 2015, 12:49:04 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: <Script> tag for PHP?  (Read 3163 times)

jeremejazz

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 58
  • hey!
    • View Profile
    • Jereme's Pinboard
    • Donate to Member
<Script> tag for PHP?
« on: October 18, 2010, 07:03:23 AM »
Hi, someone told me that the
Code: PHP
  1. <script>
tag can also be used for calling php functions... is that true?
:) I love coding

mwb1100

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,430
    • View Profile
    • Donate to Member
Re: <Script> tag for PHP?
« Reply #1 on: October 18, 2010, 12:03:28 PM »
you should be able to use:

Code: [Select]
<script language="php"> ... </script>

See Example #2 on http://www.php.net/m...c-syntax.phpmode.php
« Last Edit: October 18, 2010, 12:06:55 PM by mwb1100 »

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 7,050
    • View Profile
    • Just for mouser.
    • Donate to Member
Re: <Script> tag for PHP?
« Reply #2 on: October 18, 2010, 12:08:05 PM »
If you just want to do a short section of PHP, why wouldn't you use the normal PHP tags? It's been a long time since I've done any PHP, but isn't it something simple like <?php>?


Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 5,883
    • View Profile
    • www.StoicJoker.com
    • Donate to Member
Re: <Script> tag for PHP?
« Reply #3 on: October 18, 2010, 12:51:12 PM »
you should be able to use:

Code: [Select]
<script language="php"> ... </script>

See Example #2 on http://www.php.net/m...c-syntax.phpmode.php


The moral of the story (at the link you posted) seems to be yes you can do it, but it's a bad habbit/idea that will bite you in the ass down the road. <?PHP ...code...  ?> or <?=$Value?> are both universally safe in any environment/version or mixture of code.


Not to mention it looks too much like a Java Script tag of your skimming something large in a hurry (We've all done that at least once...).