Artur Gilimhanov Artur Gilimhanov - 4 months ago 42
PHP Question

Data are not fully come

When sending the data from "admin" (admin.php) page to update data page (update.php) data are not fully reach the page and when you run a query (on update.php) page does not issue error and executes the query, the page just refreshes.

'<a href = update.php?id='.$line['id'].'&name='.$line['name'].'&weight='.$line['weight'].'&ingredients='.$line['ingredients'].'&time='.$line['time'].'&price='.$line['price'].'&kid='.$line['kid'].'>Update </a>'

So data is sent.

$name = trim( $_GET['name'] );
echo '<p><input type="text" value="'.$name.'" name="name"></p>';

Data is received


Because the querystring you are creating probably has at least one space in it, you must wrap the href="stuff......" in quotes.

So try changing your HTML to this:

echo '<a href="update.php?id='.$line['id'].'&name='.$line['name'].'&weight='.$line['weight'].'&ingredients='.$line['ingredients'].'&time='.$line['time'].'&price='.$line['price'].'&kid='.$line['kid'].'">Update </a>';