提交在线填写的字段

时间:2018-12-10 14:01:48

标签: php jquery html

这是我的代码:

     <html>
<HEAD>
<TITLE>Test Input</TITLE>
</HEAD>
<body>
<?php
	$nume = $_GET['nume'];
	$cif = $_GET['cif'];
	$email = $_GET['email'];
	$telefon = $_GET['telefon'];
	$tip = $_GET['tip'];
	$produs = $_GET['produs'];
	$pret = $_GET['pret'];
	$stoc = $_GET['stoc'];
	$transport = $_GET['transport'];
	$judet = $_GET['judet'];
	$adresa = $_GET['adresa'];
	$empty = $_GET['empty'];
	
	?>
<form action="fgo-wise.php" method="get" >
Name: <input type="text" name="nume" value="<?php echo $nume;?>"><br>
TIP: <select name="tip">
  <option value="pf">PF</option>
  <option value="pj">PJ</option>
</select><br>
CIF: <input type="text" name="cif" value="<?php echo $cif;?>"><br>
E-mail: <input type="text" name="email" value="<?php echo $email;?>"><br>
Telefon: <input type="text" name="telefon" value="<?php echo $telefon;?>"><br>
Judet: <input type="text" name="judet" value="<?php echo $judet;?>"><br>
Adresa: <input type="text" name="adresa" value="<?php echo $adresa;?>"><br>
Produs/Serviciu: <input type="text" name="produs" value="<?php echo $produs;?>"><br>
Pret: <input type="text" name="pret" value="<?php echo $pret;?>"><br>
Cantitate: <input type="number" name="stoc" value="<?php echo $stoc;?>"><br><br>
<!--- Al doilea produs ---><br><br>
Produs/Serviciu: <input type="text" name="produs2"><br>
Pret: <input type="text" name="pret2" ><br>
Cantitate: <input type="number" name="stoc2" ><br>
UM: <input type="text" name="um"><br>
TVA: <input type="number" name="tva"><br><br>
<--- Transport ---><br><br>
Serviciu: <select name="transport">
	<option value=""></option>
  <option value="Transport Curier">Transport Curier</option>
</select><br><br>
Pret: <input type="text" name="prett"><br><br>
Cantitate: <select name="stoct">
	<option value=""></option>
  <option value="1">1</option>
</select><br><br>
UM: <select name="umt">
	<option value=""></option>
  <option value="buc">BUC</option>
</select><br><br>
TVA: <select name="tvat">
	<option value=""></option>
  <option value="19">19</option>
</select><br><br>


<input type="submit">
</form>
</body>
</html>

当我提交URL时,就像这样:

  

http://mydomain.ro/comenzi/fgo-wise.php?nume=Casut+Claudiu&tip=pf&cif=440250&email=klaucasut%40gmail.com&telefon=0743678321&judet=Satu-Mare&adresa=Strada+Paulesti%2C+UP+4%2C+ap.+5&produs=Tastatura+Laptop+Lenovo+Y700-17ISK+iluminata+UK&pret=250.0000&stoc=1&produs2=&pret2=&stoc2=&um=&tva=&transport=&prett=&stoct=&umt=&tvat=

我只想提交填充字段。

1 个答案:

答案 0 :(得分:-1)

使用if else语句验证值。您可以使用POST方法。 像:

<?php if(isset($nume)) { echo $nume; }?>