PHP Web Host - Quality Web Hosting For All PHP Applications Clan Themes! We make clans look good!!
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
draxx
Worker
Worker


Joined: Nov 19, 2003
Posts: 186

PostPosted: Sun Apr 19, 2009 6:12 pm Reply with quote Back to top

<?php

if ( !defined('BLOCK_FILE') ) {
Header('Location: ../index.php');
die();
}
$totalleads= 1;

mt_srand((double)microtime()*1000000);
$number = mt_rand(1,($totalleads-0));

$lead = include('blocks/leads/' . $number . '.html');

$content = " $lead content here <br/>";
$content .= " include('blocks/leads/' . $number . '.html'); ";


I want $lead to equal the content of the file 1.html.
In this case its an html img and link.
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Sun Apr 19, 2009 10:27 pm Reply with quote Back to top

draxx wrote:
<?php

if ( !defined('BLOCK_FILE') ) {
Header('Location: ../index.php');
die();
}
$totalleads= 1;

mt_srand((double)microtime()*1000000);
$number = mt_rand(1,($totalleads-0));

$lead = include('blocks/leads/' . $number . '.html');

$content = " $lead content here <br/>";
$content .= " include('blocks/leads/' . $number . '.html'); ";


I want $lead to equal the content of the file 1.html.
In this case its an html img and link.


Try
$lead = file_get_contents('blocks/leads/' . $number . '.html');
$content .= $lead
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
draxx
Worker
Worker


Joined: Nov 19, 2003
Posts: 186

PostPosted: Sun Apr 19, 2009 10:57 pm Reply with quote Back to top

I had used this:
ob_start();
include('blocks/leads/' . $number . '.html');
$leadin = ob_get_clean();

But yours works as well and I have a feeling yours is more efficient as the first way is creating a buffer and yours is not Wink

Thanks my good man! Smile Smile
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Sun Apr 19, 2009 11:11 pm Reply with quote Back to top

RavensScripts
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum