can i view the value in javascript function with php code???

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
softsolvers
Forum Commoner
Posts: 75
Joined: Fri Feb 13, 2004 4:26 am
Location: India

can i view the value in javascript function with php code???

Post by softsolvers »

hello friends
i am in deep trouble during the programming i need to view the value generated in javascript function in the php code,i am viewing the snapshot of the code.................
<html>
<head>
<script language="javascript">
<!--
function hello
{
temp=10
}
-->
</script>
</head>
//function being called by some event
now i like to use the php code in the same form and like to use the temp in the php code.
can i do this.
plz .do help me i need it very urgently
markbeadle
Forum Commoner
Posts: 29
Joined: Tue Dec 02, 2003 2:50 am
Location: Aachen, Germany

Post by markbeadle »

You cannot get the javscript value within PHP without reloading the page and storing the value (hidden input field within a form for example).

Once the SERVER has built a PHP page thats it. No changes.

Javascript is Client Based which means it does not send information back to the server for reprocessing. If you need to change information you have to change all information in javascript which does not contact the server, or reload the page passing values through POST or GET variables for use with PHP.

Hope that makes the situation clearer.
User avatar
softsolvers
Forum Commoner
Posts: 75
Joined: Fri Feb 13, 2004 4:26 am
Location: India

Post by softsolvers »

is it not possible that i pass the value to the url using window.location="some addd?pass=hello" and then retrieve the value from the url if it is possible then plz suggest me the approach.
Post Reply