faux Posted February 1, 2012 Share Posted February 1, 2012 basically if you read this, then you can see they have a "passing-var.php" and a "catching-var.php" How can i make this happen without the passing-var.php and make the catching-var.php actually GET a variable Quote Link to comment https://forums.phpfreaks.com/topic/256164-php-script-that-can-grab-a-variable-from-a-different-php/ Share on other sites More sharing options...
Pikachu2000 Posted February 1, 2012 Share Posted February 1, 2012 You can append GET arguments directly to the URL string. http://www.website.com/your_processing_script.php?arg1=value1&arg2=value2&arg3=value3 etc. Quote Link to comment https://forums.phpfreaks.com/topic/256164-php-script-that-can-grab-a-variable-from-a-different-php/#findComment-1313205 Share on other sites More sharing options...
faux Posted February 1, 2012 Author Share Posted February 1, 2012 Noted, but broken link. Quote Link to comment https://forums.phpfreaks.com/topic/256164-php-script-that-can-grab-a-variable-from-a-different-php/#findComment-1313211 Share on other sites More sharing options...
Pikachu2000 Posted February 1, 2012 Share Posted February 1, 2012 The link is an example of how to append those arguments, not an actual link . . . Quote Link to comment https://forums.phpfreaks.com/topic/256164-php-script-that-can-grab-a-variable-from-a-different-php/#findComment-1313212 Share on other sites More sharing options...
faux Posted February 1, 2012 Author Share Posted February 1, 2012 Sorry, lol. Went right over my head. Quote Link to comment https://forums.phpfreaks.com/topic/256164-php-script-that-can-grab-a-variable-from-a-different-php/#findComment-1313213 Share on other sites More sharing options...
faux Posted February 1, 2012 Author Share Posted February 1, 2012 I'm a little confused on how this will exactly work. Can you possibly show an example? Quote Link to comment https://forums.phpfreaks.com/topic/256164-php-script-that-can-grab-a-variable-from-a-different-php/#findComment-1313214 Share on other sites More sharing options...
wigpip Posted February 1, 2012 Share Posted February 1, 2012 without knowing exactly your intentions I would add why not use sessions e.g. $_SESSION['setexamplesessionhere'] = $somevariable; Quote Link to comment https://forums.phpfreaks.com/topic/256164-php-script-that-can-grab-a-variable-from-a-different-php/#findComment-1313226 Share on other sites More sharing options...
Proletarian Posted February 1, 2012 Share Posted February 1, 2012 I'm a little confused on how this will exactly work. Can you possibly show an example? www.example.com/script.php?arg1=something&arg2=somethingelse&arg3=blah arg1=something arg2=somethingelse arg3=blah Those are variables passed by the URL and retrieved via $_GET. The "?" denotes all things passed after it are variables. The "&" seperates variables from each other. With this method you can pass variables across as many scripts as you want. You can pass these variables in a FORM or you can pass them as URLs. You get the variables like this: $x = $_GET['arg1']; $y = $_GET['arg2']; $z = $_GET['arg3']; $x === "something"; $y === "somethingelse"; $z === "blah"; Quote Link to comment https://forums.phpfreaks.com/topic/256164-php-script-that-can-grab-a-variable-from-a-different-php/#findComment-1313243 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.