Jump to content

removing localhost from generated output


fishingbait

Recommended Posts

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

Link to comment
Share on other sites

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 by fishingbait
Link to comment
Share on other sites

...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).

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.