Page 1 of 1

URL Parameters

Posted: Thu Aug 29, 2002 3:33 am
by Skywalker
How do I have to set URL parameters, tryed everything.

What I have now is this. The URL Parameters must be Dynamic.

<?php $imtem_id= $row_Recordset1['ProduktID']; //Haalt ProduktID op uit recordset en stopt hem in $item_id
$imtem_name= $row_Recordset1['ProduktNaam']; //Haalt ProduktNaam op uit recordset en stopt hem in $item_name


<?php "<a href='http://localhost/test/bestellijst.php?' ... em_name</a>";?>

Posted: Thu Aug 29, 2002 3:48 am
by twigletmac
You aren't echoing out the link you're creating and you seem to be mispelling some variable names, you've also not assigned a variable name to the $item_id value in the query string:

Code: Select all

&lt;?php 
//Haalt ProduktID op uit recordset en stopt hem in $item_id
$item_id= $row_Recordset1&#1111;'ProduktID'];
//Haalt ProduktNaam op uit recordset en stopt hem in $item_name
$item_name= $row_Recordset1&#1111;'ProduktNaam'];

echo '&lt;a href="http://localhost/test/bestellijst.php?item_id='.$item_id.'"&gt;'.$item_name.'&lt;/a&gt;';
?&gt;
Hope it helps.

Mac

Re: URL Parameters

Posted: Thu Aug 29, 2002 3:50 am
by mikeq
Skywalker wrote:How do I have to set URL parameters, tryed everything.

What I have now is this. The URL Parameters must be Dynamic.

<?php $imtem_id= $row_Recordset1['ProduktID']; //Haalt ProduktID op uit recordset en stopt hem in $item_id
$imtem_name= $row_Recordset1['ProduktNaam']; //Haalt ProduktNaam op uit recordset en stopt hem in $item_name


<?php "<a href='http://localhost/test/bestellijst.php?' ... em_name</a>";?>
Have a look at your single quotes

either this

<?php "<a href="http://localhost/test/bestellijst.php?= ... em_name</a>";?>

or

<?php "<a href='http://localhost/test/bestellijst.php?= ... em_name</a>";?>

but what are you setting to $item_id

<?php "<a href="http://localhost/test/bestellijst.php?[b]whatvariable[/b]=$item_id">$item_name</a>";?>

Then 'whatvariable' will be available within bestellijst.php as a variable and will contain the value that was in $item_id, it is passed as GET

$_GET['whatvariable'] or $whatvariable - dependent on your version of PHP and the status of the global variables setting in the php.ini

Posted: Fri Aug 30, 2002 2:55 am
by Skywalker
Arg I now know what was wrong in the next script, wher this vars wher send to, I used $_Post to get the vars, but is had to be $_GET :P

But thenk you guys enyway. :D No I have a new problem with my Cookie :S