Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Get external file....

Featured Replies

Hey guys, I'm stuck.

 

I'm building a small site / app ....

 

The app MUST run on https:// which is set up on my servers ... now the problem is, the app needs to pull an external javascript file from a completely different server which I am unable to make any changes to, so I can't install SSL on there.... so everything on this second server is always http only.

 

Is it possible using PHP or Javascript to get the contents of the file ... and then output it via a new file or directly within the document, thus making it secure using my own SSL ?

Hi, is there a good reason why you cant have the javascript file on your server

 

or try this you can work around it

 

<?php
$file = file_get_contents('http://www.example.com/js/required-file.js');
echo $file;
?>

 

 

I think this will still give you a problem with SSL

Edited by ELITE

  • Author

Hi Elite,

 

the main issue is this website/app has variables based on a userID variable passed via the URL ... so for example I may need to pull http://domainname.com/userID/1234/jsfile.js or next time http://differentdomainname.com/userID/5487/jsfile.js ...

 

Esentially the files are almost identical, however in some of them there may be slight differences based on their account type.

 

I had a feeling the "file_get_contents" might be the way to go.... thanks for confirming my suspicions (sort of) ... I'll give it a try and see what happens! Fingers crossed... otherwise I need to try and persuade the server owner to SSL every domain name! (There are 600 domains urghhhhhhhhh)

 

Ohhh that could be costly! LOL LOL

  • Author

Elite... just wanted to post an update!

 

It worked!!!

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.