php - How do you direct the user to a certain div and also send a GET request at the same time? -


i'm trying use header() in php send request, , redirect user div id, , code came this:

header("location: ?load=10#divname"); 

however, gave 500 error code, due "redirecting me many times".

i tried doing this:

header("location: #divname?load=10"); 

however, ignored request, makes sense, since thinks it's part of div id.
should give , try using post request instead, or there way around this? thanks!

note: using header() tests, otherwise, connected <a> tag.

p.s. if wondering i'm trying on here, when click button, sends request load more blog posts, , directs user last blog post in list loaded. changed div id less confusion. please let me know if there better way around this, i'm sure there is!

first using header tag, need use full uri if want redirect somewhere. recommend using global $_server it. documentation

second, thing want achievable using javascript , ajax, instead of php. recommend research the ajax documentation see examples.

but fix main problem of "redirecting me many times", check if looping can callback header function more once.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -