almightyegg Posted July 29, 2007 Share Posted July 29, 2007 I have posted this before I know, but I can't find the post now <center><br> <form action="viewthread.php?<? echo "f=$f&t=$t"; ?>" method="GET"> <b>Input a Thread ID and jump straight to it:</b><br> Thread ID <input type="text" name="pos"> <? $pos = $_POST['pos']; $arr = explode('.',$pos); $fid = $arr[0]; $tid = $arr[1]; $t = $_GET['tid']; $f = $_GET['fid']; ?> <input type="submit" value="Jump to Thread"> </form></center> This code is meant to split up a code put in by the user in the format of XXXX.YYYY . XXXX = ForumID and YYYY = PostID. I need both to identify which exact post the user wants. The code above doesn't work because it just puts the XXXX.YYYY code into a link like viewthread.php?pos=XXXX.YYYY (pos is the name of the input field in the form) is there any way I can make it split like I've attempted above and send to a link like viewthread.php?f=XXXX&t=YYYY ??? any help will be greatly apreciated Quote Link to comment Share on other sites More sharing options...
soycharliente Posted July 29, 2007 Share Posted July 29, 2007 Put your PHP code above where you echo the variable? Quote Link to comment Share on other sites More sharing options...
almightyegg Posted July 29, 2007 Author Share Posted July 29, 2007 <center><br> <form action="viewthread.php?<? echo "f=$f&t=$t"; ?>" method="GET"> <b>Input a Thread ID and jump straight to it:</b><br> Thread ID <input type="text" name="pos"> <? $arr = explode('.',$pos); $fid = $arr[0]; $tid = $arr[1]; $t = $_GET['tid']; $f = $_GET['fid']; $pos = $_POST['pos']; ?> <input type="submit" value="Jump to Thread"> </form></center> Like that? If so it didn't work, but thanks Quote Link to comment Share on other sites More sharing options...
soycharliente Posted July 29, 2007 Share Posted July 29, 2007 You didn't change anything. <? $pos = $_POST['pos']; $arr = explode('.',$pos); $fid = $arr[0]; $tid = $arr[1]; $t = $_GET['tid']; $f = $_GET['fid']; ?> <center><br> <form action="viewthread.php?<? echo "f=$f&t=$t"; ?>" method="GET"> <b>Input a Thread ID and jump straight to it:</b><br> Thread ID <input type="text" name="pos"> <input type="submit" value="Jump to Thread"> </form></center> Quote Link to comment Share on other sites More sharing options...
almightyegg Posted July 29, 2007 Author Share Posted July 29, 2007 I did, I swapped the order of stuff, but I see you didn't mean what I thought you meant anyways, I'll try that Quote Link to comment Share on other sites More sharing options...
almightyegg Posted July 29, 2007 Author Share Posted July 29, 2007 Didn't make a difference 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.