我试图了解如何使用$ _GET函数。我正在使用我的CRM系统Infusionsoft的表格。我有几个不同的广告从不同来源运行到此表单。我使用UTM来跟踪人们的来源。
隐藏字段是我尝试提取数据并在提交表单时传递数据的尝试。不幸的是它不起作用,我是一个PHP的新手。
<form accept-charset="UTF-8" action="https://mk165.infusionsoft.com/app/form/process/ff023ed2f8ffd7c46b03cdc50a115e93" class="infusion-form" method="POST" name="myForm" onsubmit="return validateForm()">
<input name="inf_form_xid" type="hidden" value="ff023ed2f8ffd7c46b03cdc50a115e93" />
<input name="inf_form_name" type="hidden" value="Ninh Neuropathy" />
<input name="infusionsoft_version" type="hidden" value="1.48.0.46" />
<input type="hidden" id="inf_custom_GaSource" name="inf_custom_GaSource" value='<?php echo $_GET['utm_source']?>'/>
<input type="hidden" id="inf_custom_GaMedium" name="inf_custom_GaMedium" value='<?php echo $_GET['utm_medium']?>'/>
<input type="hidden" id="inf_custom_GaTerm" name="inf_custom_GaTerm" value='<?php echo $_GET['utm_term']?>'/>
<input type="hidden" id="inf_custom_GaCampaign" name="inf_custom_GaCampaign" value='<?php echo $_GET['utm_campaign']?>'/>
<input type="hidden" id="inf_custom_GaContent" name="inf_custom_GaContent" value='<?php echo $_GET['utm_content']?>'/>
<input class="infusion-field-input-container" placeholder="First Name" name="inf_field_FirstName" type="text" />
<input class="infusion-field-input-container" placeholder="Last Name" name="inf_field_LastName" type="text" />
<input class="infusion-field-input-container" placeholder="Phone" name="inf_field_Phone1" type="text" />
<input class="infusion-field-input-container" placeholder="E-mail" name="inf_field_Email" type="text" />
<input class="infusion-field-input-container submit" id="submit" name="" value="Get In Touch Today" type="submit" />
</form>
&#13;
答案 0 :(得分:0)
您的表单方法是 POST ,因此当您提交表单时,您将获得php中的值:
@Component({
selector: 'project-list',
template: `
<ul>
<project-component *ngFor="#project of projects" [project]="project"></project-component>
</ul>
`,
directives: [ProjectComponent]
})
class ProjectListComponent {
@Input() projects: Project[];
}
您将获得<?php
print_r($_POST);
?>
Super Global中包含所有隐藏输入的所有表单输入值。
最后一件事还使用隐藏输入值中的双引号而不是单引号:
$_POST
答案 1 :(得分:0)
通常需要两种类型的参数。如果GET和POST参数被规范化,然后可以以这样的独特方式访问它,这可能会使事情变得更容易:
$params = array();
foreach ($_GET as $k=> $v) $params [$k] = $v;
foreach ($_POST as $k=> $v) $params [$k] = $v;
echo $params['myvalue'];