473,388 Members | 1,326 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,388 software developers and data experts.

Php variable inside Java script Code

106 100+
can anyone heLp me

i need to send an id to a page through a javascript function but it wont work
he can't read the variable
Expand|Select|Wrap|Line Numbers
  1.  function confirm_delete() {    
  2. var answer=confirm("Are You Sure You Want to Delete ?");
  3.    if(answer==true)
  4.      { 
  5.         window.location="delete.php?id=$id"; 
  6.       // alert(" Title Deleted");
  7.      }
  8.  else 
  9.         return false ;    
  10.         }
Aug 11 '08 #1
3 4752
Markus
6,050 Expert 4TB
PHP needs to be started for it to parse variables.

<?php echo $id; ?>
Aug 11 '08 #2
jessy
106 100+
I Tried this as well But also couldnt recognize this $id

i googled and found that it's not possible to write php inside JS since that'sis a server side and the other is client side
is that True ???????
Aug 11 '08 #3
dlite922
1,584 Expert 1GB
It would be nice to search for other posts before posting:
http://bytes.com/forum/thread827223.html

You just might get your questioned answered faster,




Dan
Aug 11 '08 #4

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

Similar topics

4
by: Andy R. | last post by:
Hello everyone, I've spent quite some time now, looking for some information on how to get this done, sadly none has helped me much, though. I have a bit of java scrpt on a webpage (.php) to...
3
by: Peter | last post by:
Hello, Two newbie questions: 1) I have a javascript file with a function in it. From this function I want to access a variable in another javascript file -which is not inside a function. I...
7
by: Donna Hawkins | last post by:
I want to use javascript to redirect to a URL which has been passed as a variable (in php). I have searched but cannot find any solution. I think this code is a basic redirect: <script...
7
by: tuxlover | last post by:
Is it possible to set an environment variable from inside the python script which will be retained after the script exits. If I use the following code: import os os.putvar("name", "tuxlover")...
23
by: Russ Chinoy | last post by:
Hi, This may be a totally newbie question, but I'm stumped. If I have a function such as: function DoSomething(strVarName) { ..... }
1
by: Pete Smith | last post by:
I am making the animated text inside the table cell data. The animation is done using Javascript. Here is the code looks like.. <table><tr><td><script>Java Script code which does animation of...
4
by: Arpan | last post by:
The following code works fine: <script runat="server"> Dim strName As String = "Arpan" Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs) Page.DataBind() End Sub </script> <form...
11
by: gg9h0st | last post by:
i saw a code refactorying onload event listener window.onloadListeners=new Array(); window.addOnLoadListener=function(listener) { window.onloadListeners=listener; } why declare the...
1
pbmods
by: pbmods | last post by:
VARIABLE SCOPE IN JAVASCRIPT LEVEL: BEGINNER/INTERMEDIATE (INTERMEDIATE STUFF IN ) PREREQS: VARIABLES First off, what the heck is 'scope' (the kind that doesn't help kill the germs that cause...
2
by: buntyindia | last post by:
Hi, I have a session variable msgSize that is being set by a Java file in the session. aRequest.getSession().setAttribute("msgSize", msgSize); It's value is variable depends on record count of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.