Jump to content

Please Help I am losing my mind - Php Help


media
 Share

Recommended Posts

I have a site using a directory engine and I have just realized that link starts with secure https cannot be registered...

The Code is checking that is here, but I do not how to correct (Note: Vendor went out of business no help on that side)

						if (0 !== strpos($field_value, 'http://'))
						{
							$field_value  = 'http://' . $field_value;
						}

1. Directory Listing - Like a search engine, people add their website with URL

When they add URL with http://www.yahoo.com it is ok but when they add their url as https://www.yahoo.com it is giving error message

Complete code

					elseif ($field_name == 'url')
					{
						if (0 !== strpos($field_value, 'http://'))
						{
							$field_value  = 'http://' . $field_value;
						}

						if ($value['required'] && !esynValidator::isUrl($field_value))
						{
							$error = true;
							$msg[] = $esynI18N['error_url'];
						}
						elseif (!$value['required'] && (empty($_POST['url']) || ('http://' == $_POST['url'])))
						{
							$listing['domain'] = '';
							$listing['listing_header'] = '200';
						}
					}

How can I get both http and https work???
Thanks

Edited by media
Link to comment
Share on other sites

5 hours ago, Ahmad E. said:

If I understand the limitation correctly, something like this should this should work:


if ( 0 !== strpos($field_value, 'http://') && 0 !== strpos($field_value, 'https://') )
{
	$field_value  = 'http://' . $field_value;
}

 

Thank you Ahmad... Thank you thank you thank you... :)

It worked... :)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...