We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

PhP files - Where do I put them?[Answered] | Forum

Topic location: Forum home » Support » General Questions
Adrian
Adrian Dec 19 '13
Guys/Gals - I have a used Oxwall for years and totally love it but I have a major problem - I have created a new page entitled PLAYLIST and I need to add a php code to make the page update with the playlist from the site shoutcast stream.

Where do I put this php file??? I cant see where the html code for the new page is stored.

Also - If a create a text/html box on the main page for the playlist - where do I place the php code??

Cheers All!!

www.ukchristianmusicradio.com


The Forum post is edited by ross Dec 23 '13
Adrian
Adrian Dec 20 '13
Guess this is too difficult to answer .... ??? Anyone help please??

dave Leader
dave Dec 20 '13
Thao Le is correct it is not that simple, it would require a plugin or a code mod.  What you could do is do the process outside of Oxwall and then use an iframe on your oxwall page to display the results page.
Adrian
Adrian Dec 21 '13
Thanks guys .... looks like an iframe is the only option then ...


Axel
Axel Dec 21 '13

I am having the same exact dilemma as Adrian.


One thing I am slightly confused about is the execution of php on oxwall platform. I have a php file, which works perfectly fine on my server with a html page, which displays the results pulled from a shoutcast server.


The results are being pulled by javascript (which utilizes the php script on my server), for some odd reason, when the same java script is injected in a html box, on oxwall, if fails to work at all. Could anyone explain, what is "breaking" the code or stopping it from working as it would on a regular html page?


P.S I disabled the re-write rule for *.html files and *.php (except index.php), oxwall is performing as intended.

dave Leader
dave Dec 21 '13

Check this out.   http://www.oxwall.org/forum/topic/12662?&page=1


or here (abbrev version lol)


Probably because you need to add the file to the htaccess.   If you are planning to execute a file within oxwall and it is not a plugin you may need to add the file to the htaccess in order to execute the file.   You will get a 500 error if you try to execute a file inside of oxwall and it is not part of a plugin, part of oxwall, or not listed in the htaccess special section below.


in your htaccess oxwall root you need to add the following if it is not there.


FIND the close </FilesMatch> in htaccess


And AFTER that</FilesMatch> add the following code,  examples are shown and have been comented out with #


#added to access custom files - sub domains or special folders
#--------
#subdomains and add on domains
#RewriteCond %{HTTP_HOST} !sub_addondomain.com$
#RewriteCond %{HTTP_HOST} !myaddondomain.com$
#
# folders
#RewriteCond %{REQUEST_URI} !/folder1/
#RewriteCond %{REQUEST_URI} !/folder2/
#
# files
#RewriteCond %{REQUEST_URI} !/filejs.js
#RewriteCond %{REQUEST_URI} !/file.php
#RewriteCond %{REQUEST_URI} !/file1.html
#RewriteCond %{REQUEST_URI} !/file2.jpg
#RewriteCond %{REQUEST_URI} !/file3.txt


AND BEFORE THIS CODE - make sure this code below that came standard with oxwall is after your added code..

RewriteCond %{REQUEST_URI} !^/index\.php
RewriteCond %{REQUEST_URI} !/ow_updates/index\.php
RewriteCond %{REQUEST_URI} !/ow_updates/
RewriteCond %{REQUEST_URI} !/ow_cron/run\.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php

Axel
Axel Dec 21 '13

Thanks,


That gives me a better idea, but I am working with nginx, I created a separate rule for my php file, but it seems to fail


if ($uri !~ "/strmcore/getInfo.php"){
  set $rule_1 6$rule_1;
  }
  if ($rule_1 = "6"){
  rewrite /strmcore/getInfo.php /strmcore/getInfo.php;
  }


any ideas, please let me know.

The Forum post is edited by Axel Dec 21 '13