1
CS_Swan
passing paramaters
  • 2009/1/4 17:14

  • CS_Swan

  • Just popping in

  • Posts: 28

  • Since: 2008/11/28


I have a php file inside a block, I want to be able to pass a url to the php file .. any one willing to help?

2
deka87
Re: passing paramaters
  • 2009/1/5 10:18

  • deka87

  • Friend of XOOPS

  • Posts: 1125

  • Since: 2007/10/5


could you explain it more detailed?
Mind anchors

3
CS_Swan
Re: passing paramaters
  • 2009/1/5 16:10

  • CS_Swan

  • Just popping in

  • Posts: 28

  • Since: 2008/11/28


certainly , the problem is more indepth than i first expected.
on my localhost site I have a block in which i placed the sentence ' include "rss2html.php"; '
it did performed exactly what i expected producing a feed from a local news source.
I expected that doing the exact same thing on the webserver would produce the same results . not so nothing but errors.
the original problem was simply that this rss2html script is supposed to be able to take 2 parameters a feed location and a template file.
thanks for your help.

4
trabis
Re: passing paramaters
  • 2009/1/5 18:37

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


maybe:

$_GET['param1']='something';
$_GET['param2']='something2';
include XOOPS_URL . "/filepath/rss2html.php";

5
CS_Swan
Re: passing paramaters
  • 2009/1/5 19:02

  • CS_Swan

  • Just popping in

  • Posts: 28

  • Since: 2008/11/28


on the localhost...
$_GET['$xmlfilename']='http://rss.cbc.ca/lineup/canada-manitoba.xml';
include "rss2html.php";

still loads the default feed


6
CS_Swan
Re: passing paramaters
  • 2009/1/5 19:10

  • CS_Swan

  • Just popping in

  • Posts: 28

  • Since: 2008/11/28


on the webserver i recieve 3 errors..

they are ..
Warning: include() [function.include]: URL file-access is disabled in the server configuration in file /class/xoopsblock.php(147) : eval()'d code line 1

Warning: include(http://www.ruralmanitoba.ca/stol_feed.php) [function.include]: failed to open stream: no suitable wrapper could be found in file /class/xoopsblock.php(147) : eval()'d code line 1

Warning: include() [function.include]: Failed opening 'http://www.ruralmanitoba.ca/stol_feed.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in file /class/xoopsblock.php(147) : eval()'d code line 1

stol_feed and rss2html are the same file
and is located on the root of ruralmanitoba.ca

7
trabis
Re: passing paramaters
  • 2009/1/5 20:31

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Maybe you need to enable 'allow url fopen' in your server php settings?

8
CS_Swan
Re: passing paramaters
  • 2009/1/5 20:37

  • CS_Swan

  • Just popping in

  • Posts: 28

  • Since: 2008/11/28


sorry to sound uneducated ... how do i do that

9
CS_Swan
Re: passing paramaters
  • 2009/1/5 20:41

  • CS_Swan

  • Just popping in

  • Posts: 28

  • Since: 2008/11/28


sorry allow_url_fopen is on but ..
allow_call_time_pass_reference - Off
how do i turn this on

10
trabis
Re: passing paramaters
  • 2009/1/5 21:04

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


My bad, you should use path and not url, also, you should not use $ for the variable.

Try this:

$_GET['xmlfilename']='http://rss.cbc.ca/lineup/canada-manitoba.xml';
include_once XOOPS_ROOT_PATH . "/rss2html.php";

Login

Who's Online

364 user(s) are online (286 user(s) are browsing Support Forums)


Members: 0


Guests: 364


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits