therif
-
Posts
2 -
Joined
-
Last visited
Never
Posts posted by therif
-
-
Hi,
I'm new to PhP, but I coded already a lot in C++, so PhP is quite similar
But thats not the point
I want to paste a countervariable to a $_GET
Well, this is the code :)
This here works fine:
<form id="add" name="add" method="get" action="BBCode.php">
<label></label>
<?php
while($teller <= $quantity)
{
echo "Omschrijving van object nummer ", $teller
?>
<p> </p>
<table width="250" border="9">
<tr>
<td>Verkoop van </td>
<td>
<select name="cmbType<?php echo $teller ?>" id="cmbType">
//... Some html form code
</p>
<?php
$teller++;
}
?>
<input type="hidden" name="txtQuantity"id="txtQuantity" value="<?php echo $quantity?>" />
<input type="submit" name="Submit" value="Submit" />
</form>
</body>
</html>
----------------------------------
As you can see, in another previous page i setted a quantity and here the counter(teller) is going to loop.
everytime I got a name, I add the number so I can process it on next page...
This code here is Ok, now I used the Get method, the next page have to take these, and for the moment only echo it, if I can echo, I can do everything else :)
---------------------------------
<body>
<?php
$Quantity = $_GET['txtQuantity'];
$teller = 1;
while ($teller < Quantity)
{
$Type = $_GET['cmbType'];//here, how do I add a counter so he can read the get with a counter next to it
$Model = $_GET['txtModel'];
$Description = $_GET['txtDescription'];
$Official_Link = $_GET['txtOfficial'];
$Directory_Link = $_GET['txtLinkDir'];
$Min_Price = $_GET['txtMinPrice'];
$Buy_It = $_GET['txtBuyIt'];
$Richtprijs = $_GET['txtDunno'];
$Introductie = $_GET['txtIntro'];
$Slot = $_GET['txtEnd'];
?>
<link href="topicgen.css" rel="stylesheet" type="text/css" />
<?php
echo "Hello World in while";
echo $Quantity;
echo $Type;
echo $Model;
echo $Description;
echo $Official_Link;
echo $Directory_Link;
echo $Min_Price;
echo $Buy_It;
echo $Richtprijs;
echo $Introductie;
echo $Slot;
$teller++;
}
echo $Type;
?>
</body>
Like this :) if you need more information, just PM me
Here is the test site [a href=\"http://therif.free.fr/testingtg/\" target=\"_blank\"]http://therif.free.fr/testingtg/[/a]
It is in dutch... but just write a quantity inferior to 10 in first page, and u can directly submit on next page
Cannot read variables with a counter
in PHP Coding Help
Posted
use sessions
good luck
[code]
page1.php
<?php
session_start();
$_SESSION['1'] = 1;
$_SESSION['2'] = 2;
$_SESSION['3'] = 3;
?>
[/code]
[code]
page2.php
<?php
session_start();
echo ".$_SESSION['1'] .";
echo ".$_SESSION['2'] .";
echo ".$_SESSION['3'] .";
?>
[/code]
[/quote]
k, thx;) I'll try it