Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 17-12-03
25 chars.? Need more spac
 
Join Date: Aug 2003
Location: here
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
madstock is an unknown quantity at this point
  Including a PHP include within a PHP include ??

Currently I parse a perl database using a php include in the usual fashion...

<? include ('http://www.url.com/database.pl?qry=QUERY'); ?>

I also have a script day.php which will (strangely enough) display the day ....

What I would like to be able to do is to create an include simlar to above, but replacing QUERY with the output of day.php - however even using absolute paths I still can't get it to work ... and may just scream until I'm sick (and I can...)

Would someone please enlighten me as to how I should be doing this??

Cheers!
Duncan
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 17-12-03
Super Moderator
 
Join Date: Aug 2003
Posts: 2,451
Thanks: 0
Thanked 0 Times in 0 Posts
Rich is an unknown quantity at this point
If your day.php echos the day to the browser then that is what it will still do when included. What you need to do is edit day.php so instead of echoing the result it saves it to a variable (if it isn't already in one) then use that variable in the second include.

Assuming day.php assigns the day to $day then your code would look like

<?
include ('day.php');
include ("http://www.url.com/database.pl?qry=$day");
?>

Note: the second include must use " rather than ' to evaluate $day, also included php code is only parsed if the included file is local to the calling script i.e. accessed via a local path rather than a remote (http://) one.

Hope this helps.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 17-12-03
25 chars.? Need more spac
 
Join Date: Aug 2003
Location: here
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
madstock is an unknown quantity at this point
Quote:
Originally posted by Rich
If your day.php echos the day to the browser then that is what it will still do when included. What you need to do is edit day.php so instead of echoing the result it saves it to a variable (if it isn't already in one) then use that variable in the second include.
D'oh! Call me Mr Dim and beat me about with a wet haddock..

Cheers Rich, I make no excuses for my temporary lack of any common sense...

Duncan
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 17-12-03
jrisby's Avatar
Super Member
 
Join Date: Sep 2003
Location: Manchester
Posts: 1,047
Thanks: 2
Thanked 0 Times in 0 Posts
jrisby is an unknown quantity at this point
madstock,

sorry, not got the time today to think this through properly but take a look at the eval function. that may help as well.

john
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyone anygood with xml, php, mysql and Affiliate Window AnnonnyMouse The Affiliate Marketing Lounge 1 23-09-04 11:00 AM
Php Include scifind Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 5 14-08-03 05:01 AM


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7