rsammy Posted December 22, 2006 Share Posted December 22, 2006 i am working on an email module as part of a patient application. i need to post some date variables/parameters via one of the ahref links on the screen. my code for this bit is here...<tr> <td> <div align="left"> <img src="images/selectedfolder-icon.gif" width="16" height="13">Inbox </div></td></tr><tr> <td> <div align="left"> <img src="images/selectedfolder-icon.gif" width="16" height="13">Sent Items </div></td></tr><tr> <td> <div align="left"> <img src="images/compose-button.gif" width="21" height="15"><a href="compose.php">Compose</a></div></td></tr>in the above code, i need to pass some variables via the Compose ahref link. how do i do that?i am looking for something similar to ...<tr><td><a href="view.php<?PHP print("?mess_id=".$rowz["ID"]. "&m1=".$m1. "&d1=".$d1 . "&y1=".$y1. "&m2=".$m2 . "&d2=".$d2 . "&y2=".$y2 . "&incount=".$inboxcounter . "&sentcount=".$sentcounter ); ?>"><?PHP print($rowz["subject"]); ?></a></td></tr>i will need to pass the m1, d1, y1 and m2, d2, y2 variables to compose.php ahref link in the code above.any help will be greatly appreciated. thanx Quote Link to comment Share on other sites More sharing options...
.josh Posted December 22, 2006 Share Posted December 22, 2006 well...that example you showed that you want it to be like, is pretty much what you need to do. Have you tried it? Getting some kind of error? Or are you asking how you would retrieve the info, once the linkie is clicked? You can access them in the $_GET arrayexample:[code]echo $_GET['mess_id'];echo $_GET['m1'];..[/code]p.s. - please use code tags! Quote Link to comment Share on other sites More sharing options...
rsammy Posted December 22, 2006 Author Share Posted December 22, 2006 thanx crayon violet. i know i can use the GET thingy there. but, i need to know how to pass the m1, d1 y1, etc variables other than the mesg_id ... stuff.i only need to pass the month, day and year variabls and not the message id...hope im clear now! Quote Link to comment Share on other sites More sharing options...
trq Posted December 22, 2006 Share Posted December 22, 2006 I don't see what part your stuck on. You managed to do it for view.php? Quote Link to comment Share on other sites More sharing options...
.josh Posted December 22, 2006 Share Posted December 22, 2006 i don't get it...perhaps you should re-explain your whole situation here, because what I'm hearing is that you have like 5 variables that are being passed through the url, but you only want to pass 4 of them? So I'm wanting to tell you to uh, just remove one of them. But I somehow doubt that's what you mean, so please re-explain what you're wanting to do. [code]<a href = 'somepage.php?var1=value1&var2=value2&var3=value3'>blah</a>[/code]this passes 3 variables in the link, when the user clicks it. Then, to access those variables on somepage.php, you would use the $_GET array. If you only want to pass the year, month and day, then only put the year, month and day in the url string. If you know how to do all of that, then I really don't see what your issue is here? Again, please explain in more detail. Quote Link to comment Share on other sites More sharing options...
rsammy Posted December 22, 2006 Author Share Posted December 22, 2006 im trying the exact same syntax u gave me here...do i need to include any quotes(" or ') before or after each & sign? i tried passing variables exactly same way u showed my here...<a href = 'somepage.php?var1=value1&var2=value2&var3=value3'>blah</a>but, it shows up as ...compose.php?m1=$m1&d1=$d1&y1=$y1&m2=$m2&d2=$d2&y2=$y2when i point on the hyperlink!am i wrong somewehre. i know i am,...but not sure where Quote Link to comment Share on other sites More sharing options...
.josh Posted December 22, 2006 Share Posted December 22, 2006 if it is inside php tags, it would look like this:[code]<?php echo "<a href = 'compose.php?m1=$m1&d1=$d1&y1=$y1&m2=$m2&d2=$d2&y2=$y2'>blah</a>";?>[/code]if it is outside php tags, it should looks like this:[code]<a href = "compose.php?m1=<?php echo $m1; ?>&d1=<?php echo $d1; ?>&y1=<?php echo $y1; ?>&m2=<?php echo $m2; ?>&d2=<?php echo $d2; ?>&y2=<?php echo $y2; ?>">blah</a>[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.