Forums

PHP

This topic is locked

Problem with HTTP_GET_VARS

Posted 02 Aug 2002 18:24:49
1
has voted
02 Aug 2002 18:24:49 Thorsten Röver posted:
Hi all together,

I've got a basic problem with transfering data from one to another page. I built an page with checkoxes displaying results out of a recordset. All I want to do now is to send the checked Items to an other page. I used form method "get" for that.

I filtered my result page by HTTP_GET_VARS. My problem is, that all get I displayed is one item, but not all the others I've checked, too. I think I have done a basic error.

Here's my little code of filtering the result-page. Can anyone help me?

<?php


// Copyright (c) Interakt Online 2001
// www.interakt.ro/

require("./adodb/adodb.inc.php";
require("./Connections/connShop.php";
?><?php
$KT_numRows_Artikel = -1
?><?php
$Artikel__MMColParam = "1";
if (isset($HTTP_GET_VARS["ItemID"])) {
$Artikel__MMColParam = $HTTP_GET_VARS["ItemID"];
}
?><?php
if (isset($KT_Tot) && $KT_Tot!="" {
if(!isset($KT_numRows_Artikel)){
$KT_numRows_Artikel=1;
}
$KT_index = (int)$KT_index;
$Artikel = $connShop->SelectLimit("SELECT * FROM f2card WHERE ItemID = " . ($Artikel__MMColParam) . " ORDER BY ItemID ASC", $KT_numRows_Artikel, $KT_index) or KT_DIE($connShop->ErrorNo(),$connShop->ErrorMsg());
$Artikel__totalRows = $HTTP_GET_VARS["KT_Tot"];
$Artikel__isLimited = true;
} else {
$Artikel = $connShop->Execute("SELECT * FROM f2card WHERE ItemID = " . ($Artikel__MMColParam) . " ORDER BY ItemID ASC" or KT_DIE($connShop->ErrorNo(),$connShop->ErrorMsg());
$Artikel__totalRows=$Artikel->RecordCount();
}
?><?php
$Repeat1__numRows = -1;
$Repeat1__index= 0;
$Artikel_numRows = $Artikel_numRows + $Repeat1__numRows;
?>

Replies

Replied 06 Aug 2002 00:58:27
06 Aug 2002 00:58:27 Tim Green replied:
When using checkboxes for multiple items in this way, it is important that you name them like this:-

<input type="checkbox" name="myBox[]">

In this way PHP knows that you are sending a number of checkboxes and constructs an array out of the variable.

Say for example, you have 5 checkboxes, and 3 of them are ticked. This will create an array of 3 items, each containing the value of the checked items.

It is this method that I think you need to employ to get your page working.

Hope this helps

Tim Green

Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
Replied 06 Aug 2002 10:46:52
06 Aug 2002 10:46:52 Thorsten Röver replied:
Yes, you are right. I thought about that. But further on I have to define a $ for the [], or am I wrong?

My problem is, that I don't know how to define such a $ and don't know how to code the query at the result page in order to display the results with the "Horizontal Looper". I think I have to code that array via hand, because I can't do that with the ImpaKt-Extension, or am I wrong here, too?

That is my problem - I'm still not good enough to do that hand-coding.

Reply to this topic