Url Field
-
Update, works for now, looking for better solution.
I am having users pass a url trough a text field, then it is outputted this way:
echo'<a href="https://' . $vendor['vendor_link'] . '">';
This works unless they include https:// in the field.
How would i filter it out ? or is there a cleaner solution?If i remove the http from my echo, then it passes the link as a subpage of the page the code is in.
So this works for now, but i am unsure if it is the best solution.
$strip_these = array("https://", "https://"); echo'<a href="https://' . str_replace($strip_these, "", $vendor['vendor_link']) . '">';
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Url Field’ is closed to new replies.