Welcome Guest, Not a member yet? Register   Sign In
Go to replies div on redirect
#1

On my forum when a user replies to a thread / post

I am trying to be able to get it to go to that div once created.

PHP Code:
redirect(base_url('viewthread?tid=') . $tid '#' $pid); 


Code:
http://www.project.com/viewthread?tid=1#14


But for some reason will not go to the div.

It will go to div if have a space before hashtag

PHP Code:
redirect(base_url('viewthread?tid=') . $tid ' #' $pid); 

But then the url produces 

Code:
http://www.project.com/viewthread?tid=1%20#14

How can I make it go to the div with out having space in the url?
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply
#2

(06-16-2017, 11:49 PM)wolfgang1983 Wrote: On my forum when a user replies to a thread / post

I am trying to be able to get it to go to that div once created.

PHP Code:
redirect(base_url('viewthread?tid=') . $tid '#' $pid); 


Code:
http://www.project.com/viewthread?tid=1#14


But for some reason will not go to the div.

It will go to div if have a space before hashtag

PHP Code:
redirect(base_url('viewthread?tid=') . $tid ' #' $pid); 

But then the url produces 

Code:
http://www.project.com/viewthread?tid=1%20#14

How can I make it go to the div with out having space in the url?

1. you id field need to be unique.
2. '#' . $pid to '#pid_' . $pid and the div id to pid_xx
Reply
#3

PHP Code:
redirect(base_url('viewthread?tid=') . $tid '#' $pid); 
This? You placed the space yourself in ' #'
Reply
#4

Thanks all now working fine
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB