SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Jul 2001
    Location
    Luxembourg
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    It's me again :-((

    Hi to all, and many thanks for your past help , but now, I've got an other problem

    My form is not working as it has to: Updating (insert) the db, and forward to an other page. I've got a real problem, and I don't have a clue where to put my $insert, to get everything working....

    Could somebody help me?

    Thx
    Tzaff

    Here's the code:

    <tr><td align=center width=80><?echo $id;?></td>
    <td align=center width=350><?echo $name;?></td>
    <td align=center valign="middle" width=100><form method=post name=user action=<?$insert;?>>

    <input type=hidden name="userid" value="<?print $userid;?>">
    <input type=hidden name="id" value="<?print $id;?>">
    <input type="submit" value="download" action=";<a href="download.php?id=$id">
    </form>
    </tr>

  2. #2
    SitePoint Addict
    Join Date
    Apr 2001
    Location
    None
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What do you have in $insert?

    Also, you have some errors in your code... replace it with the following:

    PHP Code:
    <form method="post" name="user" action="download.php?id=<? echo "$id"?>">
    <tr><td align=center width=80><? echo "$id"?></td> 
    <td align=center width=350><? echo "$name"?></td> 
    <td align=center valign="middle" width=100> 
    <input type=hidden name="userid" value="<? echo "$userid"?>"> 
    <input type=hidden name="id" value="<? echo "$id"?>"> 
    <input type="submit" value="download">
    </tr>
    </form>

  3. #3
    SitePoint Member
    Join Date
    Jul 2001
    Location
    Luxembourg
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Pweb, thanks for your help, the downloading is now working fine, and it adds one to the downloadcount, but the 'download table' doesn't take the fileid.

    Here's my $insert code:

    mysql_connect("localhost", "root", "pass"); // connecting to the db
    mysql_select_db("arcuser",$db); // selecting the db
    $insert = "insert into download (sessionid,userip,fileid,downdate)
    values('$session','$userip','$id','$dates')";

    mysql_query($insert,$db);
    echo $insert; //used to control during the tests

    ThX
    Tzaff

  4. #4
    Victory shall be mine tubedogg's Avatar
    Join Date
    Mar 2001
    Location
    Medina, OH
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You realize you never assigned $db to anything?
    Try this.
    PHP Code:
    $db mysql_connect("localhost""root""pass"); // connecting to the db 
    mysql_select_db("arcuser",$db); // selecting the db 
    $insert "insert into download (sessionid,userip,fileid,downdate) 
    values('
    $session','$userip','$id','$dates')"

    mysql_query($insert,$db); 
    echo 
    $insert//used to control during the tests 
    Kevin

  5. #5
    SitePoint Member
    Join Date
    Jul 2001
    Location
    Luxembourg
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The problem has been fixed, Special Thanks to Bogdan

    In fact the problem was due to the $id, which I forgot to assign

    Many Thanks To all of you

    See you for the next coming problem

    Tzaff


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •