PHP中的小错误,我可以';我找不到。意外的T_变量
我正在尝试用这种当前语法解析一个表单,我非常确定大部分内容都是正确的。我一直收到这个错误:解析错误:语法错误,第13行的/home/pftech/public_html/wp content/themes/pureflo/formhandler.php中出现意外的T_变量。我在这里真的很迷茫,不知道这可能是什么,为什么它会导致整个形体失败。请在此问题上提供任何帮助,我们将不胜感激。刚刚迷路。谢谢PHP中的小错误,我可以';我找不到。意外的T_变量,php,forms,error-handling,Php,Forms,Error Handling,我正在尝试用这种当前语法解析一个表单,我非常确定大部分内容都是正确的。我一直收到这个错误:解析错误:语法错误,第13行的/home/pftech/public_html/wp content/themes/pureflo/formhandler.php中出现意外的T_变量。我在这里真的很迷茫,不知道这可能是什么,为什么它会导致整个形体失败。请在此问题上提供任何帮助,我们将不胜感激。刚刚迷路。谢谢 <?php /** * Template Name: Form Handler */ ?&
<?php
/**
* Template Name: Form Handler
*/
?>
<?php
if(isset($_GET['zip'])){
$sandiego = array('91911', '91914', '91915', '91932', '91942', '91945', '91950', '92014', '92025', '92027', '92029', '92037', '92064', '92065', '92067', '92071', '92075', '92101', '92102', '92103', '92104', '92105', '92106', '92107', '92108', '92109', '92110', '92111', '92113', '92114', '92115', '92116', '92117', '92118', '92119', '92120', '92121', '92122', '92123', '92124', '92126', '92127', '92128', '92129', '92130', '92131', '92132', '92134', '92135', '92139', '92140', '92145', '92147', '92154', '92173', '92562', '92563', '92590', '92591', '92592', '92596');
if (in_array($_GET['zip'], $sandiego)){
$urls = array();
if($_GET["office"] == 1) {
$urls[] = "http://50.22.79.62/~pftech/office-delivery/"
$urls[] = "http://50.22.79.62/~pftech/office-delivery/"
$urls[] = "http://50.22.79.62/~pftech/office-delivery/"
} else {
$urls[] = "http://50.22.79.62/~pftech/water-delivery-service/"
$urls[] = "http://50.22.79.62/~pftech/coffee-delivery/"
$urls[] = "http://50.22.79.62/~pftech/water-filtration-systems/"
}
if($_GET['selection'] < 3 && $_GET['selection'] >= 0) {
$URL = $urls[$_GET['selection']];
header("Location: $URL?zip=$_GET[zip]");
} else header("Location: http://50.22.79.62/~pftech/nationwide/");
} else {
header("Location: http://50.22.79.62/~pftech/nationwide/");
}
}
exit;
您没有代码>每行后面的分隔符您没有代码>每行后面的分隔符此代码有效
<?php
/**
* Template Name: Form Handler
*/
?>
<?php
if(isset($_GET['zip'])){
$sandiego = array('91911', '91914', '91915', '91932', '91942', '91945', '91950', '92014', '92025', '92027', '92029', '92037', '92064', '92065', '92067', '92071', '92075', '92101', '92102', '92103', '92104', '92105', '92106', '92107', '92108', '92109', '92110', '92111', '92113', '92114', '92115', '92116', '92117', '92118', '92119', '92120', '92121', '92122', '92123', '92124', '92126', '92127', '92128', '92129', '92130', '92131', '92132', '92134', '92135', '92139', '92140', '92145', '92147', '92154', '92173', '92562', '92563', '92590', '92591', '92592', '92596');
if (in_array($_GET['zip'], $sandiego)){
$urls = array();
if($_GET["office"] == 1) {
$urls[] = "http://50.22.79.62/~pftech/office-delivery/";
$urls[] = "http://50.22.79.62/~pftech/office-delivery/";
$urls[] = "http://50.22.79.62/~pftech/office-delivery/";
} else {
$urls[] = "http://50.22.79.62/~pftech/water-delivery-service/";
$urls[] = "http://50.22.79.62/~pftech/coffee-delivery/";
$urls[] = "http://50.22.79.62/~pftech/water-filtration-systems/";
}
if($_GET['selection'] < 3 && $_GET['selection'] >= 0) {
$URL = $urls[$_GET['selection']];
header("Location: $URL?zip=$_GET[zip]");
} else header("Location: http://50.22.79.62/~pftech/nationwide/");
} else {
header("Location: http://50.22.79.62/~pftech/nationwide/");
}
}
exit;
?>
我添加了代码>这结束了一个php函数这段代码有效
<?php
/**
* Template Name: Form Handler
*/
?>
<?php
if(isset($_GET['zip'])){
$sandiego = array('91911', '91914', '91915', '91932', '91942', '91945', '91950', '92014', '92025', '92027', '92029', '92037', '92064', '92065', '92067', '92071', '92075', '92101', '92102', '92103', '92104', '92105', '92106', '92107', '92108', '92109', '92110', '92111', '92113', '92114', '92115', '92116', '92117', '92118', '92119', '92120', '92121', '92122', '92123', '92124', '92126', '92127', '92128', '92129', '92130', '92131', '92132', '92134', '92135', '92139', '92140', '92145', '92147', '92154', '92173', '92562', '92563', '92590', '92591', '92592', '92596');
if (in_array($_GET['zip'], $sandiego)){
$urls = array();
if($_GET["office"] == 1) {
$urls[] = "http://50.22.79.62/~pftech/office-delivery/";
$urls[] = "http://50.22.79.62/~pftech/office-delivery/";
$urls[] = "http://50.22.79.62/~pftech/office-delivery/";
} else {
$urls[] = "http://50.22.79.62/~pftech/water-delivery-service/";
$urls[] = "http://50.22.79.62/~pftech/coffee-delivery/";
$urls[] = "http://50.22.79.62/~pftech/water-filtration-systems/";
}
if($_GET['selection'] < 3 && $_GET['selection'] >= 0) {
$URL = $urls[$_GET['selection']];
header("Location: $URL?zip=$_GET[zip]");
} else header("Location: http://50.22.79.62/~pftech/nationwide/");
} else {
header("Location: http://50.22.79.62/~pftech/nationwide/");
}
}
exit;
?>
我添加了
这结束了一个php函数您没有用分号结束$url[]
行。大量的缺失代码>…您没有用分号结束$url[]
行。大量的缺失代码>…我不认为你需要在每一行上都放分号,但我猜你需要这样做?很可能在每一条指令终止后,如这里所说:我不认为你需要在每一行上都放分号,但我猜你需要这样做?很可能在每一条指令终止后,如这里所说:代码>结束一行,而不是函数。;结束一条语句,而不是一行。这是真的,但当您将数据放入变量或数组时,在PHP中调用此函数;)function
有一个非常特殊的含义,它基本上就是大多数语言所称的方法。语句是单个操作,即声明变量、调用函数等代码>结束一行,而不是函数。;结束一条语句,而不是一行。这是真的,但当您将数据放入变量或数组时,在PHP中调用此函数;)function
有一个非常特殊的含义,它基本上就是大多数语言所称的方法。语句
是单个操作,即声明变量、调用函数等。