3 Replies - 3048 Views - Last Post: 11 July 2008 - 07:49 PM Rate Topic: -----

#1 ashaajith  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 25
  • Joined: 10-July 08

Access a hidden variable value in php

Post icon  Posted 11 July 2008 - 08:22 AM

This is for a facebook app i am developing using php.
I have a hidden field ('editmiles'the value of which is set using javascript.
I want to access the value of that hidden variable inside my php code. Is there a mechanism. This is my code

<script language="javascript">
function editMilesFunction(idMiles)
 {
         		    document.getElementById('editMiles').setValue(idMiles);
document.getElementById('MyMiles').submit();
}
</script>

<?php
<form action="x.php">
<input type="hidden" name="editMiles" value="0" id="editMiles">
<input type="image" src="http://116.68.64.204:7001/MMApp/images/edit.jpg" name="editMilesButton" id="Image1" onclick="editMilesFunction(<?php echo $idMile;?>);" >

</form>
?>

Mod edit: Please :code:
Thanks, gabehabe :)

This post has been edited by gabehabe: 11 July 2008 - 08:25 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Access a hidden variable value in php

#2 didgy58  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 246
  • Joined: 23-October 07

Re: Access a hidden variable value in php

Posted 11 July 2008 - 08:25 AM

where are you getting the value $idMiles from to be passed into the function ?
Was This Post Helpful? 0
  • +
  • -

#3 EvinOwen  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 8
  • Joined: 01-July 08

Re: Access a hidden variable value in php

Posted 11 July 2008 - 01:29 PM

use 'object.value = whatever' such as...

<script language="javascript">  
 function editMilesFunction(idMiles){  
  document.getElementById('editMiles').value = idMiles;  
  document.getElementById('MyMiles').submit(); }  
</script>  


Was This Post Helpful? 0
  • +
  • -

#4 ashaajith  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 25
  • Joined: 10-July 08

Re: Access a hidden variable value in php

Posted 11 July 2008 - 07:49 PM

View Postdidgy58, on 11 Jul, 2008 - 08:25 AM, said:

where are you getting the value $idMiles from to be passed into the function ?



it is passed from the previous page
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1