- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
<script>
var queryString = window.location.search;
queryString = queryString.substring(1);
</script>
<?php
include("assignmentd.php");
$array;
$id=$_COOKIE['id'];
$count = "<script>document.write(queryString)</script>";
$count1=$count;
echo $count;
print_r(parse_str($count1,$array));
print_r($array);
//$q3="INSERT INTO previous_year(clicks)VALUES('$fcount') where id='$id'";
//$m3=mysqli_query($conn,$q3);
?>
I am taking this query String from some other html page but my parse string is not working on $count htmlpage from the quesry string is coming is
<input type="button" value="click me" onClick="count1()"><br>
<input type="button" value="log out" onClick="logout()">
<script>
var count=0;
function count1()
{
alert("in count");
count++;
alert(count);
}
function logout()
{
alert("in logout");
var queryString = "?para1=" + count;
window.location.href = "previous_year_logout.php" + queryString;
}
</script>
最佳答案
只能解析 URL 字符串。解析字符串中不能有脚本标签,也不能像 html 一样在 PHP 上执行 javascript。
使用表单提交数据,然后使用 $_GET 访问它。
关于javascript - parse_str 函数不适用于查询字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50282076/
if($_POST['VIDEO']){ $video = parse_url($_POST['VIDEO']); if($video['host'] == 'www.youtube.
我有一个 ajax 调用,它发送如下数据: $.ajax({ type:'POST', url:URL data:{'fexx': $('#form').serialize()
这个问题已经有答案了: What is the difference between client-side and server-side programming? (3 个回答) 已关闭 5 年前
我将查询字符串作为查询字符串的一部分传递给 PHP 脚本。 有点像这样: $.post('/url', { id: postID filters: $('#form').seriali
我一直在尝试使用 cURL,并尝试将数组作为 POST 变量发送。我决定使用 http_build_query 按预期传递字符串: curl_setopt($this->ch, CURLOPT_POS
php parse_str() 函数把查询字符串解析到变量中,主要用于页面之间传值(参数)。本文章向码农介绍php parse_str() 函数的使用方法,感兴趣的码农可以参考一下。 定义和用法
为什么我在传递带有“form.php?”之类的字符串时出错,例如, parse_str('form.php?category=contacts'); echo $category; 我明白了, Not
我的托管服务器上有 magic_quotes。所以当我使用 parse_str 时,它也会添加斜线。所以数据被存储为\\'name ..我该如何防止这种情况。? 最佳答案 // Turn off ma
有没有可靠的替代parse_str()解析查询字符串的函数? 我发现它非常困惑且容易出错,特别是当查询字符串来自外部服务(并且您无法完全控制它)时: $error = "Error message";
我有一个变量,我通过 url 作为 jSON 字符串传递,其中一部分是以下字符串: signature=8W2sp\/J+kC6fh8a88jabNPuA8048sShDnXNOo1jSQ= 当我读取
这个问题已经有答案了: Parsing query strings on Android (25 个回答) 已关闭10 年前。 Facebook 服务器端登录发送以下格式的响应: access_tok
是否存在与 PHP 函数 parse_str 等效的 C#? 我找不到任何东西并编写了自己的函数,但是 C# 框架中有什么东西吗? public Dictionary parse_str(string
环境:主机 (JustHost) 上测试站点上的 Wordpress(最新),PHP 版本为 5.4.43。 在 URL 查询中使用 parse_str,生成的数组返回 amp;keyname 的数组
public function postIndex(){ $url = new Url('https://www.dropbox.com/1/oauth2/authorize'); $url->que
我是一名优秀的程序员,十分优秀!