Welcome to Dream.In.Code
Click Here
Getting PHP Help is Easy!

Join 117,570 PHP Programmers for FREE! Ask your question and get quick answers from experts. There are 1,769 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Access a hidden variable value in php

 
Reply to this topicStart new topic

Access a hidden variable value in php

ashaajith
post 11 Jul, 2008 - 08:22 AM
Post #1


New D.I.C Head

*
Joined: 10 Jul, 2008
Posts: 22

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

php
<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.gif
Thanks, gabehabe smile.gif

This post has been edited by gabehabe: 11 Jul, 2008 - 08:25 AM
User is offlineProfile CardPM

Go to the top of the page


didgy58
post 11 Jul, 2008 - 08:25 AM
Post #2


D.I.C Head

**
Joined: 23 Oct, 2007
Posts: 157



Thanked 1 times
My Contributions


where are you getting the value $idMiles from to be passed into the function ?
User is offlineProfile CardPM

Go to the top of the page

EvinOwen
post 11 Jul, 2008 - 01:29 PM
Post #3


New D.I.C Head

*
Joined: 1 Jul, 2008
Posts: 8



Thanked 1 times
My Contributions


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

CODE

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

Go to the top of the page

ashaajith
post 11 Jul, 2008 - 07:49 PM
Post #4


New D.I.C Head

*
Joined: 10 Jul, 2008
Posts: 22

QUOTE(didgy58 @ 11 Jul, 2008 - 08:25 AM) *

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



it is passed from the previous page
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/7/08 08:24PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month