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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 05-09-2004, 07:05 AM   #1
zentz
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]
zentz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-09-2004, 07:13 AM   #2
Apache_A
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
Apache_A is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-09-2004, 07:15 AM   #3
Nathan
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
Nathan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-09-2004, 07:20 AM   #4
zentz
Confirmed User
 
Industry Role:
Join Date: Nov 2003
Posts: 8,053
This is what i wanna add to my HTML
PHP Code:
<?php virtual ("substract.php?a=2&b=3"); ?>
when i do that it includes just the php file
__________________
Programs that owe me money ---- Epassporte.com ~ $2700 | Protraffic.com ~ $2600 | XonDemand.com ~ $3000

Email: [email protected]
zentz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-09-2004, 07:22 AM   #5
Apache_A
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.
Apache_A is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-09-2004, 07:32 AM   #6
Nathan
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
Nathan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-09-2004, 07:38 AM   #7
boyw_utr
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.
boyw_utr is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.