简体   繁体   English

如何在Javascript代码示例中使用变量:src =“ htp://www.url.com/file.php?id = [3434]”

[英]How To Use Variable In Javascript Code Ex: src=“htp://www.url.com/file.php?id=[3434]”

I'm running a wordpress multisite network where I give users an options page with different settings to make their page unique. 我正在运行一个wordpress多站点网络,在该网络中,我为用户提供具有不同设置的选项页,以使其页面唯一。

I would like to implement a GetResponse optin form on their page. 我想在他们的页面上实现GetResponse optin表单。

In the options page I have a field where they can put in their GetResponse FormID - which is usually 6 numbers (422125). 在选项页面中,我有一个字段,他们可以在其中输入GetResponse FormID-通常为6个数字(422125)。

The getresponse form looks like this: getresponse表单如下所示:

<script type="text/javascript" src="http://app.getresponse.com/view_webform.js?wid=422125&mg_param1=1"></script>

I need to be able to change 422125 to whatever id they set within their options page. 我需要能够将422125更改为他们在选项页面中设置的ID。

I already have the php code written that calls the id from the options page, but I can't figure out how to set it within the javascript. 我已经写了从选项页调用id的php代码,但是我不知道如何在javascript中进行设置。

Any help would be greatly appreciated... Thank you for your time! 任何帮助将不胜感激...谢谢您的时间!

在PHP页面上,您可以执行以下操作,它将回显$form_id作为URL的wid参数。

<script type="text/javascript" src="http://app.getresponse.com/view_webform.js?wid=<?php echo $form_id ?>&mg_param1=1"></script>

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

相关问题 使用htaccess将www.url.com/x=y重定向到www.url.com/file.php?x=y? - Redirect www.url.com/x=y to www.url.com/file.php?x=y with htaccess? 需要使用 www.mydomain.com/filename/ 而不是 www.mydomain.com/file.php?id=1 - need to use www.mydomain.com/filename/ instead of www.mydomain.com/file.php?id=1 结合来自url.com和www.url.com的喜欢 - Combining likes from url.com and www.url.com 使用CURL进行下载而无需直接路径| www.url.com/things?download=文件 - Using CURL to download without a direct path | www.url.com/things?download=file Laravel-Azure DNS-网站网址问题(url.com有效,www.url.com无效) - Laravel - Azure DNS - Website url issues (url.com works , www.url.com does not) 如何使用.htaccess url.tld / file.php重定向到url.tld / file.php / - how to redirect with .htaccess url.tld/file.php to url.tld/file.php/ 如何打开PHP套接字到一些URL? (例如www.ex.com:8080/mySock/) - How to open PHP socket onto some URL? (like www.ex.com:8080/mySock/) 如何在另一个file.php中包含文件file.php - How include file file.php in another file.php 如何使用javascript将输入文件的数据传递到另一个file.php - how to pass the data of input file to the another file.php with javascript PHP将&#39;../folder/file.php&#39;转换为url - PHP convert '../folder/file.php' into url
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM