nyamanza Posted May 21, 2008 Share Posted May 21, 2008 Hi, I am no programmer, but I am doing pretty well I think. I have a page that runs a query on a MYSQL database and returns the results and displays them on the page. Woohoo, go me. I have then placed an input text field after each item listed (note) and then a submit button(on each line). So my result looks something like this... Order Number Summary Note 12345 In Progress waiting on supplier [submit] 12344 Closed [submit] 12322 Waiting Not in production [submit] . . . 00823 Closed [submit] My query returns order number and Summary. The Note field is an input field and the [submit] is the submit button. My submit button goes to a note_add.php page which submits the note against the order number (or is supposed to). I can get the note passed to the next page (by simply calling "$note"), but not the order number. I have tried turning register_global=on in the php.ini to no avail. When I display the order number I am using the following syntax : <form method="post" action="note_add.php"> <td> <input colspan="0" type="hidden" name="order_id" > <?php echo string_get_order_view_link( $f_order_id ) ?> > </td> This displays the order number no worries (and of course the corresponding summary). My note that I input is done in the same file and displayed thus: </td> <td colspan="5"> <input type="text" name="order_note" value="" size="50" /> </td> <td> and I finally close the form after the submit button is printed: <td> <input type="submit" class="button" value="submit" /> </td> </form> In my note_add.php I am just displaying the data before I attempt to add it, so I just have (for the moment) <?php echo "$order_note"; echo "$order_id"; ?> I have also tried using GET and POST by adding (with register_globals=on in the php.ini) <?php $my_order_id= $_POST['order_id']; $my2_order_id=$_GET['order_id']; echo "$order_note"; echo "$my_order_id"; echo "$my2_order_id"; ?> but only my note comes through. Can someone PLEASE tell me where I am going wrong..please, please! Quote Link to comment https://forums.phpfreaks.com/topic/106558-passing-one-number-returned-from-a-list-to-a-new-page/ Share on other sites More sharing options...
mjcoco Posted May 21, 2008 Share Posted May 21, 2008 try taking out the quotes from echo "$my_order_id", i think it should just be echo $my_order_id; also if your method is post use <?php $my_order_id= $_POST['order_id']; $my_note = $_POST['order_note']; echo $my_order_id; echo $my_note; ?> Quote Link to comment https://forums.phpfreaks.com/topic/106558-passing-one-number-returned-from-a-list-to-a-new-page/#findComment-546242 Share on other sites More sharing options...
sasa Posted May 21, 2008 Share Posted May 21, 2008 in part[code]<input colspan="0" type="hidden" name="order_id" > you must add value propertiy <input colspan="0" type="hidden" name="order_id" value="<?php echo $variable_with_id_here; ?>" >[/code] Quote Link to comment https://forums.phpfreaks.com/topic/106558-passing-one-number-returned-from-a-list-to-a-new-page/#findComment-546244 Share on other sites More sharing options...
nyamanza Posted May 21, 2008 Author Share Posted May 21, 2008 sasa Thanks - you solved it! I was not setting the value correctly and there it was 0! duh! Awesome, I thank you heaps! Quote Link to comment https://forums.phpfreaks.com/topic/106558-passing-one-number-returned-from-a-list-to-a-new-page/#findComment-546247 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.