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 Link to comment https://forums.phpfreaks.com/topic/62362-solved-help-to-make-this-work/ 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? Link to comment https://forums.phpfreaks.com/topic/62362-solved-help-to-make-this-work/#findComment-310337 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 Link to comment https://forums.phpfreaks.com/topic/62362-solved-help-to-make-this-work/#findComment-310339 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> Link to comment https://forums.phpfreaks.com/topic/62362-solved-help-to-make-this-work/#findComment-310342 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 Link to comment https://forums.phpfreaks.com/topic/62362-solved-help-to-make-this-work/#findComment-310344 Share on other sites More sharing options...
almightyegg Posted July 29, 2007 Author Share Posted July 29, 2007 Didn't make a difference Link to comment https://forums.phpfreaks.com/topic/62362-solved-help-to-make-this-work/#findComment-310346 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.