Transferring a variable is giving me quite a headache...
Posted: Thu May 15, 2008 11:35 am
So I am trying to get a button to, when clicked, add a specified amount to a value in a table. Since the buttons are created in a while loop, they have no unique identifiers, which is where my problem comes in. I want the button to only affect the row of the table that it is in, so in order to do this I set it up so that when it is clicked it will send the value I want affected to a separate php page where I will modify it, update the mysql database, and refresh the original page.
The problem I am having is that the variable that I want to send is already a php variable, and I'm trying to send it like this:
And that would work fine for any other variable except one that needs to be in php tags. Either I get a blank result, (right now my 2nd php page just gets the post data and prints it out to make sure i'm getting what I want), or it works but, like I said, only with out the php tags.
So, does anyone know of a way for me to send that variable with the HTML input command with my php tags? Am I doing something completely bonkers? I've googled this stuff all morning and most of yesterday afternoon. If anyone has any ideas I'd really appreciate the help.
If there is anything confusing here, I will do my best to fix it asap, but I'm pretty sure I've explained myself thoroughly.
The problem I am having is that the variable that I want to send is already a php variable, and I'm trying to send it like this:
Code: Select all
<form action="counter.php" method = post>
<input name="used" type="hidden" value="<?php $info['used'] ?> ">
<input type="submit" value="Used +1" >
So, does anyone know of a way for me to send that variable with the HTML input command with my php tags? Am I doing something completely bonkers? I've googled this stuff all morning and most of yesterday afternoon. If anyone has any ideas I'd really appreciate the help.
If there is anything confusing here, I will do my best to fix it asap, but I'm pretty sure I've explained myself thoroughly.