Jump to content

[SOLVED] Help to make this work


almightyegg

Recommended Posts

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 :D

Link to comment
https://forums.phpfreaks.com/topic/62362-solved-help-to-make-this-work/
Share on other sites

<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 :)

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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.