pass variable between pages with java

PatrickOttawa

新手上路
注册
2004-08-25
消息
53
荣誉分数
0
声望点数
0
Hi everyone,

I have a code writtend by html and java, and part of code liket this

var data;
...

<a href="editrecord.php?prod="data>Edit</a>
...



how do I pass data to the new page using URL, because the data value could be changed, so did like the above, but not work

Please give some information!

Thanks a lot!
 
var data;
...

<!--<a href="editrecord.php?prod="data>Edit</a>-->
...

put <!-- --> hope it will show the code.
 
var data;
...

"<a href="editrecord.php?prod="data>Edit</a>"
...

still not, put it into double quote.
 
I do put the some double quote here, because if you put corrently, it only show the link, not the code. but you should get the idea.

Thanks!
<TABLE class="code notranslate" id=table1 cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY><TR>
<TD><TABLE class="code notranslate" id=table1 cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY><TR>
<TD>
</TD>



</TR>





</TABLE>





</TD>







</TR>



<table class="code notranslate" cellspacing="0" cellpadding="0" border="0" width="100%" id="table1">
<tr>
<td>
&lt;a href=&quot;<i>"editrecord.php?prod="+ data</i>&quot;&gt;<i>Edit</i>&lt;/a&gt;
</td>
</tr>
</table>








</TABLE>
 
LZ, please try to use
代码:
 tag with your html source code.
 
dude, there is something called single quote
<br>
代码:
&lt;a href="<i>editrecord.php?prod='data'</i>"&gt;<i>Edit</i>&lt;/a&gt;
<br>if you got single quote mark with in the url, use backslash to escape the character. <br>
 
其实我想说,这个板块不是为了HTML 101设计的。google会是个更好的老师。
 
Hi thanks for reply!

Here the "data" is variable, can be changed from time to time.

代码:
 var data;
...
 
<a href="editrecord.php?prod="+ data>Edit</a>
Tried this, not work, any idea if can do this or other way to work around this?
 
后退
顶部