Jump to content

Please Help I am losing my mind - Php Help


media

Recommended Posts

Posted

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

Posted

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;
}

 

Posted
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... :)

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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