Jump to content

Passing one number returned from a list to a new page


nyamanza

Recommended Posts

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! :)

 

 

 

 

 

 

Link to comment
Share on other sites

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;

?>

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.