-2

This is xhtml page:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile     

1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<title> Order </title>
</head>

<body>
<p>Chose car: 
<form method="GET" action="aa.php"
<select name="sastojci[]">
<option name="sastojci[]" value="ma">Mazda sp 25</option>
<option name="sastojci[]" value="op">Opel Karl</option>
<option name="sastojci[]" value="me">Mercedes Cla</option>
<option name="sastojci[]" value="da">Dacia Sandero</option>
<option selected="selected" name="sastojci[]" value="ja">Jaguar XJ</option>
<option name="sastojci[]" value="pe">Peugeot 308</option>
</select>
<br/>
How many cars you want: 
<input type="text" name="kolicina" maxlength="3" value="3"/> .<br />
</p>
<p>
<input type="submit" name="submit" value="Submit"/>
</form>
</p>

</body>
</html>

This is part of php file:

<?php echo $_GET["sastojci[]"]; 
 echo $_GET["narudzba"]; ?>

When you press submit button blank page appears. Something wrong with xhtml file but do not know what. What should i change?

silver
  • 49
  • 4

1 Answers1

0

Get grabs the variables from the URL where as post "posts" them in the header. Your issue is that you are posting the variables in the header while the php page is trying to get them from the URL. Instead of $_GET use $_POST.