473,387 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

php tag is not working in javascript tag

I'm trying to use php tag in a javascript function. But unfortunately its not working. I even used <?php but still not working. I checked php.ini file and there the short tag is already enabled.

Any sort of suggestion will be appreciated.
Nov 29 '10 #1
2 1606
Dormilich
8,658 Expert Mod 8TB
what does your code look like?
Nov 29 '10 #2
johny10151981
1,059 1GB
What is that mean php tag in javascript function?
If you are saying that you are trying to put Javascript variable using php in server site then there is several option is available...
as example
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.   $data='My message';
  3. ?>
  4. <script language='javascript'> 
  5. var A='<?=$data?>';
  6. </script> 
second is
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.   $data='My message';
  3. ?>
  4. <script language='javascript'> 
  5. var A='<?php echo $data?>';
  6. </script> 
Nov 29 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: descds | last post by:
OK im prety much a newbie at PHP but it has me hooked. Im writing a comment system for one of our modules on phpnuke. Its all going very well, well should i say WAS going very well :) Ok all...
9
by: L33VaNcL33F | last post by:
I like to make a javascript that generate random number from the range number within : (10016486 and 99999985). the number always + 22423 that begin from 10016486 and end at 99999985 Example...
27
by: Chris | last post by:
Hi, I have a form for uploading documents and inserting the data into a mysql db. I would like to validate the form. I have tried a couple of Javascript form validation functions, but it...
2
by: windandwaves | last post by:
Hi Folk Can someone tell me why this simple example is not working (javascript wise): http://www.photowarehouse.co.nz/test.html Thank you
2
by: trbjr | last post by:
Hello experts! I hope someone can tell me where I can find working javascript code that creates and enables tool tips. I have O'Reilly's JavaScript, The Definitive Guide and have been studying...
6
by: sudhashekhar30 | last post by:
hi i am trying to make a general function which is accepting control id as argument. mine code is like this. but it's not working. Javascript function function check(var obj) {alert(id of...
13
vikas251074
by: vikas251074 | last post by:
When change the <script language="javascript"> to <script type="text/javascript">, javascript function now works no more. Previously it was working. Javascript function is given below - function...
5
by: krg | last post by:
Hi, I started writing this blog some time back and it would be great if I could get an audience here and even better if we could have a conversation about developments possible on the techniques I...
10
by: maheswaran | last post by:
Hi I tried simple javascript + form in https. But javascrip alert is not working in some https. Can any one know that why it is not working My sample code is <html> <head> <script>...
1
by: npm | last post by:
Hi I've checked out this page (and it works fine) in FF, IE, Opera, Chrome and Safari: http://www.w3schools.com/dom/tryit.asp?filename=try_dom_list_loop But when I try and tweak it for a site...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.