简体   繁体   English

我必须将两个变量 about 和 product 发送到 php 中的另一个页面

[英]I have to send two variables about and product to another page in php

The two variables are about and product , they are coming from a form.这两个变量是aboutproduct ,它们来自一个表单。

<?php  
$about= $_POST['about'];
$product= $_POST['products'];
?>
<?php
if (empty($company)) {
    header("Location: templatewithoutcompany.php?product" = . $product&about = . $about);  
}
?>

I can successfully send one variable but when I try to send multiple variables, I get an error.我可以成功发送一个变量,但是当我尝试发送多个变量时,出现错误。

You have multiple syntax errors in your code.您的代码中有多个语法错误。 Try changing it to this:尝试将其更改为:

<?php  
$about = $_POST['about'];
$product = $_POST['products'];
?>


<?php
if (empty($company)) {
header("Location: templatewithoutcompany.php?product=" . $product . "&about=" . $about);  
}
?>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM