Wrong Info sent Using $get in form
Posted on
16th Feb 2014 07:03 pm by
admin
Hi i have this code that i tried to make to send some info from one page to aother with lots of ppls help and it works ok but when i have multiple files it doesnt send the correct info.
What im tryin to get is the Num_Pages to another page it works fine if its just one file in the db but when its multiple and i select a file in the middle of the table or somewhere else i dont get tht info i get the last file info.
Can anyone help if I didnt confuse u?
Thank You
Code: <?php
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$sql = "SELECT * FROM files where username = '".$_SESSION['myusername']."' ORDER BY id ASC ";
//$sql = "ORDER BY id ASC";
$result = mysql_query($sql);
$rows = mysql_num_rows($result);
echo "<form method='POST' action='count.php'><table border='2px'>n";
echo " <tr>n";
echo " <td align='center'>Date Added</td>n";
echo " <td align='center'>Files</td>n";
echo " <td align='center'>Number of Pages</td>n";
echo " <td align='center'>Prepare To Print</td>n";
echo " <td> </td>n";
echo " </tr>n";
for ($i = 0; $i < $rows; $i++) {
$data = mysql_fetch_object($result);
// since our script is very small, i'm not going to escape out to html mode here
echo " <tr>n";
echo " <td>$data->Date</td>n";
echo " <td>$data->File_Name</td>n";
echo " <td align='center'><input name='pages' type='hidden' value='$data->Num_Pages'>$data->Num_Pages</td>n";
echo " <td align='center'>
<input type='submit' value='Edit' name='editbutton'></form></td>";
echo " </tr>n";
}
?>
No comments posted yet
Your Answer:
Login to answer
325
19
Other forums
How to separate records and ORDER BY
Let say i have 100 records and displayed in one page, then i want to get the records from 50-100 and
Redistributing dependent dlls
Hai all ,
I have created an application in VC++ using VS2008 in a development machine which r
How to limit the calls to an API
Hello, in my simple script I call an api which effectively involves me getting an xml file.
H
post to self
Trying to get my form to submit to itself. However I am also trying to use an image for my submit bu
help me, how to find text on an external html site using PHP
Would anyone know how to search an external html file for a work or phrase ?
I was thinking s
Which practice of iteration through containers is preferred
In the "real world" what kind of loop do most people use to iterate through a container like a vecto
BIG file upload!
Hey guys!
I'm trying to upload a file, it works well with smaller files but with 60mb+, I get
returning data from an ssh2_exec()
here's what i got.
$conn = ssh2_connect($this->_host);
ssh2_auth_password($c
background color imagefill
Hello
I would like to ask you why I see this square in red color just in my local xampp insta
how can i expire the submitted page using session.
hi,
i'm new to php world.
i'm using "post" method.
when i submit it,data goes to