Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のコードは機能しません。
$newPageURL1 = '#post2'; $newPageURL2 = 'http://localhost/feed/all'.$newPageURL1; header('Location: $newPageURL2');
div 位置にリダイレクトせずに /feed/all のみにリダイレクトします。
/feed/all#post2 にリダイレクトするコードが必要です
一重引用符を二重引用符に変更して、php が変数を評価するようにします。
header("Location: $newPageURL2");