|
Posted by Maiku Mori on 04/16/07 13:21
On Apr 16, 12:25 pm, "shotokan99" <soft_devj...@yahoo.com> wrote:
> ok so mean i need to convert it to a form..like this:
> <form name='reg' method='get' action='rem.php'>
> while (..){
> // display the data here...
> }
> </form>
>
> on this line instead of a link ill change to a submit button:
> echo '<font face="Verdana" size="1"><input type="submit"...>
>
> then my rem.php contains:
> <html>
> <head>
> </head>
> <body>
> <?php
> session_start();
> $user = $_SESSION['myuser'];
> $id=$_GET['id'];
> .
> .
> .
>
> am i getting it right? sorry im new to this so im making things as
> detailed as possible. tnx;-)
Could work but I think something like:
session_start();
$user = $_SESSION['myuser'];
while (..){
echo $nameOfItem + ' (<a href="remove.php&id='+$idOfItem
+'">Delelte</a>) '; //You can wrap it into a table, this is just
example.
}
if isset($_GET["id"]) {
$remId = mysql_real_escape_string($_GET["id"]); //Or whatever user
input check/prepare function you want to use.
$query = "delete from cart where cuser = '$user';
AND id = '$remId' ";
mysql_query($query);
}
I don't want to discourage you, but have you tried checking free php
cart scripts? At worst case you will find good programming approaches/
examples there.
~Maiku
Navigation:
[Reply to this message]
|