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

Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.