Echo'd links showing after my web address [closed] - php

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Just a quick question obviously has a simple solution, however I am unable to find it...
Would anyone be kind anough to point me in the right direction on why this piece of code is showing up after my directory in the new tab...
echo "<td><a href='$row[link_address]' target='new'>" . $row['link_address']. "</a></td>";
Once the new tab opens it is echo'ing the link after my web address, for example www.mysite.com/$row['link_address'] I am obviously looking for this to be just the link and not a forward slash after my directory.
Any help would be much appreciated.
Thank you!

Absolute links (where the entire URL is in the link) need to start with the protocol part of the link (eg http:// or https://).
Otherwise, the browser assumes the link is to a directory called abc.com on your domain, rather than to the abc.com domain.

Related

How can I share image between two websites? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Two websites are running on one server, so let's say it A.com and B.com. Their document root directory is different of course. The problem is when I upload image on A.com, I should show it on B.com too.
How can I solve this?
I don't want to link from one site to another. I should use image in generating PDF and link is not working.
Just use full path in your code!!! It must work or check permission.
Use the url's for both site example if u you need an file from a.com in b.com just call
a.com/your_file_path
Let me know if there is any confusion

How do you move a website from localhost to server without changing much? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
For example in my website I have so many links say
"http//localhost/website/admin.php"
Which I want to be
"http://website.com/admin.php"
For now, I just use replace command in editor but it takes long time to figure out. But i was thinking $_SERVER['DOCUMENT_ROOT'] could solve this problem. But it did not either.
So how do you move your files from loalhost to server without changing anything? And I am not talking about wordpress site here. Its the one I created myself.
To start with you could make a defines.php file and include it in your index.php. What you could add is this: define('BASE_PATH', dirname(__FILE__));
This means when you enter for example this: $this->basePath = BASE_PATH . '/lib/company/Layouts/'; you will always have the right base_path incase you switch servers.
I suggest to use PHPStorm: www.jetbrains.com/phpstorm. Read the documentations to learn about the possiblities. You can for example press CTRL + R and search for 'localhost'. Now you receive a display so you can edit ALL localhost with another input. But there are many more functions. PHPStorm is a must-to-have.
Somehow you still need to edit your files only once and the defines.php could be the solution for your next projects or in future current project.
I hope this helped you.

COUNT both http and https Facebook sharing [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
Hi all this is very wired question, I want to add both http and https Facebook sharing count.
Is this possible ?
I'm not sure whether I understand your question - feel free to clarify and I'll update my answer.
I'm assuming your Share config looks like the following:
If so, the "Step 1" already has https:// / http:// already replaced with // - this will resolve to the corresponding protocol.
You could update the code in the second section, replacing https:// with // and you should be good to go.
If I'm not understanding the question properly, feel free to clarify.
Cheers
Edit: or do you mean showing the shares from both your http:// and https:// domains? Ideally, if you have a https:// domain, you'll be redirecting all traffic to that anyway in your server config.

Understanding about profile page url on facebook [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Why url for profile page on facebook is like
https://www.facebook.com/username
why not like
http://www.facebook.com/profile.php
Is the the profile page is stored within every username dir ? or something else ?
please clear my doubt and please explain how this type of url for profile is generated ?
Thanks in advance
This all about url rewriting using .htaccess file from the root of the almost all webservers.
The .htaccess file can transform facebook.com/profile.php?p=00012345678 into facebook.com/00012345678!
Try to search on Google about url rewriting, this can help you alot! :)

Shortened url redirect? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I need help to get this done.
My webpages have formatted urls in this pattern: "http://qifu.us/index.php?page=item&id=4" for example - if there are more pages, only the last page id number will be different.
I want to get this part "index.php?page=item&id=" out, and shortened like "http://qifu.us/s4", when a user input the shortened url into to address bar, it will be directed to the right page, which is the true url.
I am thinking to save the STATIC part "index.php?page=item&id=" into a string variable, and append the DYNAMIC page id - which is 4 in this example, then use Javascript or PHP to direct to the right page. But I don't know how the steps, pls help. Thanks.
Actually an htaccess will be very good for this purpose.
For urls like http://qifu.us/s4 do the following: Create a file with name .htaccess and place at your root directory with the following content.
RewriteEngine On
RewriteRule ^s([^/]*)$ /index.php?page=item&id=$1 [L]

Categories