|
|
|
||||
|
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
Confirmed User
Industry Role:
Join Date: Nov 2003
Posts: 8,053
|
PHP question
How can I use php virtual include to include php file but with some variables passed onto it?
For example: I wanna include the file substract.php but i want it to substract 5 from 19 to do this i have to call substract.php?a=19&b=5 if i call <?php virtual ("substract.php?a=19&b=5"); ?> it just includes substract.php without the variables Help would be highly appreciated
__________________
Programs that owe me money ---- Epassporte.com ~ $2700 | Protraffic.com ~ $2600 | XonDemand.com ~ $3000 Email: [email protected] |
|
|
|
|
|
#2 |
|
Confirmed User
Join Date: May 2004
Posts: 434
|
have you tied including the full URL to the php file?
eg include('"http://www.yourdomain.com/substract.php?a=19&b=5"); Also if the file is just calling a fucntion in subtract.php you can include the file and then call the fucntion in the intial script. eg. include('subtract.php'); subtract(5,6); where subtract is the function within subtract.php |
|
|
|
|
|
#3 |
|
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 3,108
|
You want to virtual include it using SSI? Or what do you mean by virtual include?
__________________
"Think about it a little more and you'll agree with me, because you're smart and I'm right." - Charlie Munger |
|
|
|
|
|
#4 |
|
Confirmed User
Industry Role:
Join Date: Nov 2003
Posts: 8,053
|
This is what i wanna add to my HTML
PHP Code:
__________________
Programs that owe me money ---- Epassporte.com ~ $2700 | Protraffic.com ~ $2600 | XonDemand.com ~ $3000 Email: [email protected] |
|
|
|
|
|
#5 |
|
Confirmed User
Join Date: May 2004
Posts: 434
|
if you HTML file isn't being passed at php then they shouldn't work.
If it is then just use the include or require commands. |
|
|
|
|
|
#6 |
|
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 3,108
|
Do you use substract.php by itself at some point? If not, why do it like that? Makes no sense.
If you do not use it seperately, just do include('substract.php') and set the 2 variables you want to substract before the include, the substract.php will see all variables your main php sees at the include() point. The other usefull thing really would be using a function instead of an include file. But I am guessing this is just a simple example and what you are trying to do is more complicated.
__________________
"Think about it a little more and you'll agree with me, because you're smart and I'm right." - Charlie Munger |
|
|
|
|
|
#7 |
|
Confirmed User
Join Date: Oct 2003
Location: The Netherlands
Posts: 310
|
if a var is set in the main page where you include the substract.php you can also call it in substract.
Like for example if $A="100" is set in main before you include the substract.php you can call $A in substract. Just as simple as that.. If you set $A after the include it isn't availble in substract.php Otherwise you need to make functions an parse the var through the function like this name_function($A, $B);
__________________
SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60. |
|
|
|