njdubois Posted May 8, 2014 Share Posted May 8, 2014 Odd one for you! I am sending emails out with some text and a link to : someurl.com/view.php?blah=blip Been using the same code for a while, and outside of emails actually being sent (which ended up being godaddy, not my code!) the link has worked 100%. Until today! I got forwarded an email back. The link was pointing to an error page. File not found! Huh? Looked at the link and it is now : http://www.someurl.com/someurl.com/view.php?blah=blip I do send out CC to myself and other admins, our links were fine? For good measure I'm going to complete the whole url, probably should have in the first place. What is stopping this from becoming : http://www.someurl.com/http://www.someurl.com/view?blah=blip Is there something else I can be doing to stop that from ever happening again? Thanks Nick Quote Link to comment https://forums.phpfreaks.com/topic/288338-random-question-about-links-in-emails/ Share on other sites More sharing options...
ginerjm Posted May 8, 2014 Share Posted May 8, 2014 Don't understand what you are doing. You say you are sending out an email with a link in it. So what is all this about the link changing??? And what does godaddy have to do with this? Quote Link to comment https://forums.phpfreaks.com/topic/288338-random-question-about-links-in-emails/#findComment-1478743 Share on other sites More sharing options...
njdubois Posted May 8, 2014 Author Share Posted May 8, 2014 Sorry for the confusion! On my site, I have an email function that sends an email alerting the user to a change. The godaddy part was unrelated, ignore it. From my code, I am sending the link: someurl.com/view.php?file=123 but the user gets : http://www.someurl.com/someurl.com/view.php?file=123 Is this happening because I don't have the full "http://www" ? or is there something else causing this? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/288338-random-question-about-links-in-emails/#findComment-1478748 Share on other sites More sharing options...
ginerjm Posted May 8, 2014 Share Posted May 8, 2014 can you simply post the code that sends that link, showing us what you place in that link (in the code)? Quote Link to comment https://forums.phpfreaks.com/topic/288338-random-question-about-links-in-emails/#findComment-1478749 Share on other sites More sharing options...
njdubois Posted May 8, 2014 Author Share Posted May 8, 2014 Sure, <br /> This alert is to inform you that a Final Critique was posted to the call with these details:<br /> <a href="someurl.com/view.php?file='.$call_id.'">'.$brief_call_details.'(Click here to see this call)</a> <br /><br /> Thanks for looking! Nick Quote Link to comment https://forums.phpfreaks.com/topic/288338-random-question-about-links-in-emails/#findComment-1478752 Share on other sites More sharing options...
Ch0cu3r Posted May 8, 2014 Share Posted May 8, 2014 Start your url with http:// otherwise the link will be treated as relative, ie the href value gets appended to the current url, thus you'll get links like http://site.com/site.com/whatver not http://site.com/whatver Quote Link to comment https://forums.phpfreaks.com/topic/288338-random-question-about-links-in-emails/#findComment-1478755 Share on other sites More sharing options...
Solution njdubois Posted May 8, 2014 Author Solution Share Posted May 8, 2014 I thought that was the cause, but was puzzled because it only happened .01% of the time. I have already changed that. Thanks for your time! Nick Quote Link to comment https://forums.phpfreaks.com/topic/288338-random-question-about-links-in-emails/#findComment-1478758 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.