[TYPO3] Form action --> $HTTP_GET_VARS does not get variable

typo3 at net-products.nl typo3 at net-products.nl
Thu Mar 2 22:27:40 CET 2006


Hi Lucas,
Thanx for helping me!!

You can see the site now at typo3.deleukstestofzuiger.nl. It is a dutch
site. It goes friday or monday "live"

when you press dealers button on the left and do a submit the url is
http://typo3.deleukstestofzuiger.nl/index.php?postcode=11

but the actual output should be redirect at:
http://typo3.deleukstestofzuiger.nl/index.php?id=77?postcode=11

See below the php code is now on page77
But page 77 is not getting the variable postcode...

So I keep seaching. Do you see what I do wrong?

Thanx Nico



<?php
// output.php it is now index,php?77
//$a = $HTTP_GET_VARS["postcode"];
$a = intval(t3lib_div::GPvar("postcode"));
$error = array(); // Array for errors
      if (!ereg("([0-9]{2})",$a))
      {
      $error[] = 'U heeft onjuiste gegevens ingevoerd'; //Message wrong
data
      }

      if (count($error) > 0 )
      {
            echo '<ul>';
            foreach ($error as $melding)
            {
                  echo "<ul>".$melding."</ul>";
                  include('invul.php');
            }
      }
      else
      {
require_once 'fileadmin/template/main/base/db.inc.php';
// zoek de alternatieve postcodes op //Search alternatives

$query_pc  = "select * from postcode where primair = '$a%'";
$result_pc = mysql_query($query_pc);

      if (!$result_pc)
        {
        echo "<br>Geen resultaat van de query : " . mysql_error();
//Message if No result
        }

$number_cols = mysql_num_fields($result_pc);

$row = mysql_fetch_row($result_pc);
$a=$row[0];
$b=$row[1];
$c=$row[2];
$d=$row[3];
$e=$row[4];
$f=$row[5];
$g=$row[6];
$h=$row[7];
$i=$row[8];
$j=$row[9];
// ==================================================================
// Maak een query in leverancier
$query = "SELECT * FROM dealers where     postcode like '$a%' or
                              postcode like '$b%' or
                              postcode like '$c%' or
                              postcode like '$d%' or
                              postcode like '$e%' or
                              postcode like '$f%' or
                              postcode like '$g%' or
                              postcode like '$h%' or
                              postcode like '$i%' or
                              postcode like '$j%' order by postcode";

$query = stripslashes($query);
$result = mysql_query ($query);

if (!$result)
      {
      echo "<br>Geen resultaat van de query : " . mysql_error();
      }

$number_cols = mysql_num_fields($result);


// zet de resultaten in tabel ??Put stuff in table
// ====================================================================
echo "<table border = 0> \n";
echo "<tr align=left>\n";
for ($i=0;$i<$number_cols;$i++)
      {
      echo "<th>".mysql_field_name($result,$i)."</th>\n";
      }
      echo "</tr>\n";//end table header
// ====================================================================
while ($row = mysql_fetch_row($result))
      {
      echo "<tr align=left>\n";
      for ($i=0;$i<$number_cols;$i++)
            {
            echo "<td>";
            if (!isset($row[$i]))//test for NULL value
             {echo "NULL";}
            else
            echo $row[$i];
            echo "</td>\n";
            }
      echo "</tr>\n";
      }
      echo "</table>";
}
// ===================================================================
?>



|---------+------------------------------------------>
|         |           Lucas Birk <tlist at birkit.com>  |
|         |           Sent by:                       |
|         |           typo3-english-bounces at lists.net|
|         |           fielders.de                    |
|         |                                          |
|         |                                          |
|         |           02-03-2006 20:22               |
|         |           Please respond to TYPO3 English|
|         |                                          |
|---------+------------------------------------------>
  >------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                              |
  |       To:       TYPO3 English <typo3-english at lists.netfielders.de>                                                           |
  |       cc:                                                                                                                    |
  |       Subject:  Re: [TYPO3] Form action --> $HTTP_GET_VARS does not get variable                                             |
  >------------------------------------------------------------------------------------------------------------------------------|





Nico,
In you php on the landing page (77) you would do somthing like:

$var = intval(t3lib_div::GPvar('postcode'));
//...do somthing with $var

Since you are using GET I assume you can see postcode=11 in the URL.
Lucas.
_______________________________________________
TYPO3-english mailing list
TYPO3-english at lists.netfielders.de
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english








More information about the TYPO3-english mailing list