vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   include (https://vborg.vbsupport.ru/showthread.php?t=54416)

Neo 06-16-2003 07:31 PM

include
 
How is it that I can use include to obtain variables from another site. I tryed this but I did not work.

script on http://www.site1.com/vars.php
PHP Code:

<?php

$VAR 
"this is a test";

?>

script on http://www.site2.com/getvars.php
PHP Code:

<?php

include 'http://www.site1.com/vars.php';

echo 
$VAR;

?>

I just have no clue..I looked on php.net but there was no real hlp as of how to do this.

Thanks
- Neon

assassingod 06-16-2003 07:35 PM

Worked fine for me...

Cloudrunner 06-16-2003 07:42 PM

Quote:

PHP Code:

<?php

include 'http://www.site1.com/vars.php';

echo 
$VAR;

?>


I believe that the include should look thusly:

PHP Code:

<?php

include ('http://www.site1.com/vars.php');

echo 
$VAR;

?>

Since both include and require are functions of PHP...could be wrong of course...

amykhar 06-16-2003 07:48 PM

With the way permissions are, you should read about including remote files. For security reasons, you can't just use variables in a file that you include from somebody else's site.

You can show the output of the file, but you can't access the variable values. If I recall correctly, fopen will let you use the variables, but you will need access permissions to the file. It's been a long time since I had to do this.

Search on Google for remote include php

filburt1 06-16-2003 07:53 PM

More specifically: think about what you could do if you could have scripts between two servers interact. It would be a nightmare. Security would be gone.

Neo 06-16-2003 10:33 PM

thats if you designed it without security measures. Thanks all for the info.


All times are GMT. The time now is 10:03 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01137 seconds
  • Memory Usage 1,724KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete