Artur Gilimhanov Artur Gilimhanov - 24 days ago 18
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

Answer

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>';
Comments