vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   "Throwing" a variable at an external file (https://vborg.vbsupport.ru/showthread.php?t=138500)

cheekymonk3y 02-05-2007 08:40 AM

"Throwing" a variable at an external file
 
The simpliest way that I can put what I want to do is: To throw a variable at an external file when i execute that variable. Here is an example:

File 1: a.php
Code:

$z = 'drupal';
File 2: b.php
Code:

print $z;
Now how would I submit $z to b.php by executing a.php in shell. I know how to execute a.php, I just dont know what code I must add to get $z "thrown" at b.php.

Please help, if i manage to do this, it will quite literally save me MONTHS of work. And you'll also be my friend forever.
Regards
Cheeky

noppid 02-05-2007 01:30 PM

Do you mean this?

a.php
PHP Code:

$z 'drupal';
include(
'b.php'); 

b.php
PHP Code:

print $z


cheekymonk3y 02-05-2007 05:35 PM

*sigh* nope, bascially what I want to do is similar to the html "post" method in forms, but it has to be in php because I am executing it via shell and have no access to html. File b.php is on someone elses server and i have no access to it so no includes. The closest thing that I can think of that might do this is spam bots that file out forms and such.

I have $POST1 and I want to "pass" it to b.php How would I do that inside a script?

EDIT: it would be the opposite of include() or require()

Cap'n Steve 02-06-2007 03:10 AM

Why don't you want to include the other file? You could also pass arguments on the command line, but you'd have to look up how to read those in the second script.

cheekymonk3y 02-07-2007 08:38 AM

nevermind, a guy at phpbuilder told me to check out the curl functions which is what i will be doing


All times are GMT. The time now is 12:43 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.01390 seconds
  • Memory Usage 1,714KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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