• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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?
Reply

#2
(06-17-2017, 12:49 AM)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
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.