Skip to content
View in the app

A better way to browse. Learn more.

Unraid

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.

swag: PHP-Server

Featured Replies

Hey guys!

I'm currently learning to setup and develop some basic websites with the basics i've learned at University.

 

I already have swag up and running on my Unraid Server.

I was able to get a website running with some basic HTML and JS and access it over DNS, but now i want to use some PHP.

I have no clue, how to use PHP with swag and found absolutely nothing about it on the internet.

I've tried to just implement some PHP code in the standard index.html in the www/ folder, but it doesn't do anything at all.

 

 

I would appreciate any help.
Thanks in advance!

 

JM

  • 2 months later...

Having the same issue. PHP just shows up as a comment in my HTML

  • Community Expert

PHP runs server side so is run before the page is sent to the browser.   It is widely used to populate/generate  many of the pages in the web GUI.

 

What are you actually trying to use PHP to do?  Knowing that might mean you get some pointers.

On 11/23/2020 at 12:55 PM, JealousMaiden said:

I've tried to just implement some PHP code in the standard index.html in the www/ folder, but it doesn't do anything at all.

 

PHP incorporated into an HTML file always runs prior to the page being loaded.

 

ie: 

...
<?PHP
  var $test = "This is a test";
?>
<script>
  $("#element").html("<?=$test?>");
</script>

Will result in the javascript sent to the browser being

  $("#element").html("This is a test");

Are you trying to make the PHP dynamically affect the page?  In this case, you need to use appropriate post / get / ajax calls

Hi all. Was making a noob mistake. I had a .html extension on my index file instead of .php. I changed it to "index.php" and it works now. thanks

Archived

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

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.