fishingbait Posted September 6, 2022 Share Posted September 6, 2022 hi my apologize for my english, im testing cms on localhost and i need a little help to fix some code how do i modify code bellow to remove http://localhost part from output result header('link: <https://mail.google.com'. $request->url(null, $submissionPath, 'view', $articleId) .'>; rel="meta"'); the generated code as follow link: <https://mail.google.comhttp://localhost/ojs23/index.php/biocenter/article/view/1>; rel="meta" while what im actually trying to achieve is link: <https://mail.google.com/ojs23/index.php/biocenter/article/view/1>; rel="meta" thank you Quote Link to comment https://forums.phpfreaks.com/topic/315286-removing-localhost-from-generated-output/ Share on other sites More sharing options...
requinix Posted September 7, 2022 Share Posted September 7, 2022 Find out what the $request->url method is and see if there is a way you can call it so that it does not include the part of the URL you do not want. Quote Link to comment https://forums.phpfreaks.com/topic/315286-removing-localhost-from-generated-output/#findComment-1600203 Share on other sites More sharing options...
fishingbait Posted September 7, 2022 Author Share Posted September 7, 2022 (edited) 8 hours ago, requinix said: Find out what the $request->url method is and see if there is a way you can call it so that it does not include the part of the URL you do not want. the code above is actually doesn't exist within source code, it was added by me by copying from different part of the CMS..i added the code at line 392 https://pastebin.com/j5yvgZEs so without $request->url then $submissionPath, 'view', $articleId part cannot work ? Edited September 7, 2022 by fishingbait Quote Link to comment https://forums.phpfreaks.com/topic/315286-removing-localhost-from-generated-output/#findComment-1600217 Share on other sites More sharing options...
requinix Posted September 7, 2022 Share Posted September 7, 2022 ...Why are you trying to provide a link to some place on mail.google.com that almost certainly does not exist? And is this a really old application that you're maintaining? Because it's using PHP 4-style code, and that version died off 14 years ago. Like, you aren't even using class autoloading. 4 hours ago, fishingbait said: so without $request->url then $submissionPath, 'view', $articleId part cannot work ? I don't know what you're trying to say, because what it does sound like you're trying to say doesn't make any sense, but the answer is very likely something along the lines of: We don't know what $request is or what its "url" method is. You have to learn about that method and see if there's a way to call it so that it does not include the URL scheme (http/s) or domain (localhost). Quote Link to comment https://forums.phpfreaks.com/topic/315286-removing-localhost-from-generated-output/#findComment-1600223 Share on other sites More sharing options...
fishingbait Posted September 9, 2022 Author Share Posted September 9, 2022 On 9/8/2022 at 1:16 AM, requinix said: ...Why are you trying to provide a link to some place on mail.google.com that almost certainly does not exist? And is this a really old application that you're maintaining? Because it's using PHP 4-style code, and that version died off 14 years ago. Like, you aren't even using class autoloading. I don't know what you're trying to say, because what it does sound like you're trying to say doesn't make any sense, but the answer is very likely something along the lines of: We don't know what $request is or what its "url" method is. You have to learn about that method and see if there's a way to call it so that it does not include the URL scheme (http/s) or domain (localhost). mail.google.com is just an example not the real one obviously, take it as forums.phpfreaks.com if you want to. And yes the code doesn't actually exist , it added by me via guessing (taking piece of code from different part of CMS)..thats why i posted in this forum ok thank you very much Quote Link to comment https://forums.phpfreaks.com/topic/315286-removing-localhost-from-generated-output/#findComment-1600290 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.