0

I've a community site. All members have registered their personal website links in their member profiles on the community site. On a form of the site, they can submit the details of their personal website's page or post. This is done in a field where they fill in the link to their page or post.

I want to validate and verify that the member-submitted link is valid and originates from the member's website as listed in the community site's member profile and is not a third party link. I know this is possible but I don't know how. My programming knowledge is nearly nil.

[This is not necessary but just an idea]>> Is there any way to achieve like what Google does in its "fetch as Google" section of the Search Console, where the first part of the link (http://example.com/) is taken from the website link in the user's profile and cannot be changed, whereas the user can only fill in the later part of the link or only the slug of the page or post in an editable field. The resultant output on a page should be a combined and full link that can be clicked.

Edited and added for clarity:

Required steps:

Step 1 - Validate: Check if the submitted URL is valid.

If valid, go to the next step. Else, return an error.

Step 2 - Verify: Check if the root domain of the submitted link matches the root domain of the existing URL in the member's profile.

If yes, allow submit. Else, return an error.

vin
  • 11
  • 2
  • 1
    Check this link http://stackoverflow.com/questions/2280394/how-can-i-check-if-a-url-exists-via-php – Talha Q Apr 14 '16 at 03:23
  • Thanks @Johnny that addresses a part of the problem, I've edited the question for clarity. – vin Apr 14 '16 at 04:07
  • i am wanting to do a similar thing - but from reading your post - have a question - you want to check that a sumitted url matches their registered url in their profile, so why allow them to enter a different url at all? you have the registered URL in the db associated with their profile so when you / they want to add a link to their page it will be to that already registered link surely. and then you will need a mechanism to to allow them to edit that in their profile and allow the new url to take the place of the registered one. – gavgrif Apr 14 '16 at 04:35
  • @gavgrif Yes, I should've clarified this as well. The member's profile has the root domain link (http://example.com/) of their website. Nobody wants to change this. My purpose is different. I offer a facility for members on a different page on the community site, where they can share their website's post and pages by submitting the full links (http://example.com/a-link-to-their-page-or-post/). I need to make sure that the member is not misusing the facility by submitting third party links. So, a check needs to be made. The registered member link can be accessed using {user_url}. – vin Apr 14 '16 at 04:56
  • thanks @vin - two thoughts - first - just prepend the registed domain root to the submitted link and second have another table int the db that contains registered pages that they are allowed to post - and add this facility to the edit profile page. and in the community page provide a select list of aailable urls that is derived from the table of accepted links – gavgrif Apr 14 '16 at 05:11
  • Thanks @gavgrif for your reply and help. However, I can't make use of it as it's all greek to me - I mean that I'm not a programmer, hence, I need extended help. – vin Apr 14 '16 at 05:22

0 Answers0