Heim  >  Artikel  >  Backend-Entwicklung  >  传参过不去!

传参过不去!

WBOY
WBOYOriginal
2016-06-23 13:46:55877Durchsuche


这个questionid='".$v['id']."' 我知道这个questionid是传递过去的参数。
之后我找到这个php文件写了代码

$id = $_GET['questionid'];	print_r($id);
可是我这里显示undefined !
其中这个v['id']没有错误能够正常显示。
那问题来了 就只能出在这个questionid='".$v['id']."'上了。谁能告诉我这是要怎么写?


回复讨论(解决方案)


他是href='#' questionid='".$v['id']."'


传参的方式不一样吧。他这么写有的确实能传过去



传参的方式不一样吧。他这么写有的确实能传过去

那估计他有其他的js对这个链接进行操作的吧 ,你找找看 单凭这样是不可能的 因为href都是空的




传参的方式不一样吧。他这么写有的确实能传过去

那估计他有其他的js对这个链接进行操作的吧 ,你找找看 单凭这样是不可能的 因为href都是空的 他的那个js也是网上下的看着太费劲了!看看论坛上有人用过吗/?

贴出你的代码!

<?php 				echo "<a name='hf' href='#' questionid={$v['id']}>回复</a>";				?>	 

js的
function clickhf(){		var page = "<?php echo $page;?>";		//var questiontype = document.getElementsByName('questiontype')[0].value;		//var status = document.getElementsByName('status')[0].value;		//var username = document.getElementsByName("username")[0].value;		var questionid = this.questionid;		//alert('rtextquestion.php?page='+page+'&questionid='+questionid);		//alert('rquestion.php?page='+page+'&questiontype='+questiontype+'&status='+status+'&username='+username+'&questionid='+questionid);		window.location.href='rtextquestion.php?page='+page+'&questionid='+questionid;		}

贴出你的代码!

徐版主

clickhf() 函数在哪调用了?

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn