ADS Problem !!!

Status
Not open for further replies.

iubtalks

New Member
Messages
90
Reaction score
0
Points
0
Whenever i put Corporate ads Links. it comes up with this result

Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/iubtalks/public_html/index.php on line 1354

Warning: include(http://staff.x10hosting.com/adCode.php?ad=corporate) [function.include]: failed to open stream: no suitable wrapper could be found in /home/iubtalks/public_html/index.php on line 1354

Warning: include() [function.include]: Failed opening 'http://staff.x10hosting.com/adCode.php?ad=corporate' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/iubtalks/public_html/index.php on line 1354


What is this mean? Is it the result of the work that going on behind the server?

In the past time ( before doing any change on free server by you) the Ads perfectly shows on my site and on every page under the first post. Now It only don't shows in the Index page.

I inserted the code of ads in the main index file. It works good in the past

But now .....

Don't know Wht happened now ! :(
 
Last edited:

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
or use

PHP:
<?php

echo file_get_contents("http://staff.x10hosting.com/adCode.php?ad=corporate");

?>


And it should work, this is untested way.
 

iubtalks

New Member
Messages
90
Reaction score
0
Points
0
Thanks but still don't work.

I don't know ! why this happening. because it works good earlier by the same code in the same place.

I think ! its may be fault created from php CONFIGURATION.

coz i got this warning

Warning: include() [function.include]: Failed opening 'http://staff.x10hosting.com/adCode.php?ad=corporate' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/iubtalks/public_html/index.php on line 1354
 

iubtalks

New Member
Messages
90
Reaction score
0
Points
0
yeah ! java script works fine in other parts of the site. but i can't put the java code in a php codded file. so, i have to use the php ad code. but it fails now. earlier it was good in its place. I mean the php ad code!
 
Last edited:

Micro

Retired staff <i> (11-12-2008)</I>
Messages
1,301
Reaction score
0
Points
36
or use

PHP:
<?php

echo file_get_contents("http://staff.x10hosting.com/adCode.php?ad=corporate");

?>
And it should work, this is untested way.

Use that, it works on my website.
 

dest581

New Member
Messages
348
Reaction score
0
Points
0
yeah ! java script works fine in other parts of the site. but i can't put the java code in a php codded file. so, i have to use the php ad code. but it fails now. earlier it was good in its place. I mean the php ad code!

You can easily put the javascript (not java, since that's entirely different) code in a php-generated file.

Code:
echo " <script language='JavaScript' type='text/javascript'>
<!--
   if (!document.phpAds_used) document.phpAds_used = ',';
   phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
   
   document.write (\"<\" + \"script language='JavaScript' type='text/javascript' src='\");
   document.write (\"http://x10hosting.com/advert/adjs.php?n=\" + phpAds_random);
   document.write (\"&what=zone:1&target=_blank\");
   document.write (\"&exclude=\" + document.phpAds_used);
   if (document.referrer)
      document.write (\"&referer=\" + escape(document.referrer));
   document.write (\"'><\" + \"/script>\");
//-->

</script><noscript><a href='http://x10hosting.com/advert/adclick.php?n=a7fb3e9d' target='_blank'><img src='http://x10hosting.com/advert/adview.php?what=zone:1&amp;n=a7fb3e9d' border='0' alt=''></a></noscript>";
Just had to escape the doublequotes
 

Cubeform

New Member
Messages
339
Reaction score
0
Points
0
You can easily put the javascript (not java, since that's entirely different) code in a php-generated file.

Code:
echo " <script language='JavaScript' type='text/javascript'>
<!--
   if (!document.phpAds_used) document.phpAds_used = ',';
   phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
   
   document.write (\"<\" + \"script language='JavaScript' type='text/javascript' src='\");
   document.write (\"http://x10hosting.com/advert/adjs.php?n=\" + phpAds_random);
   document.write (\"&what=zone:1&target=_blank\");
   document.write (\"&exclude=\" + document.phpAds_used);
   if (document.referrer)
      document.write (\"&referer=\" + escape(document.referrer));
   document.write (\"'><\" + \"/script>\");
//-->

</script><noscript><a href='http://x10hosting.com/advert/adclick.php?n=a7fb3e9d' target='_blank'><img src='http://x10hosting.com/advert/adview.php?what=zone:1&amp;n=a7fb3e9d' border='0' alt=''></a></noscript>";
Just had to escape the doublequotes
An even better way to do that is to use "heredoc" notation, like this:
PHP:
<?php
  echo <<< EOJS
<script language='JavaScript' type='text/javascript'>
<!--
   if (!document.phpAds_used) document.phpAds_used = ',';
   phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);

   document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
   document.write ("http://x10hosting.com/advert/adjs.php?n=" + phpAds_random);
   document.write ("&what=zone:1&target=_blank");
   document.write ("&exclude=" + document.phpAds_used);
   if (document.referrer)
      document.write ("&referer=" + escape(document.referrer));
   document.write ("'><" + "/script>");
//-->

</script><noscript><a href='http://x10hosting.com/advert/adclick.php?n=a7fb3e9d' target='_blank'><img src='http://x10hosting.com/advert/adview.php?what=zone:1&n=a7fb3e9d' border='0' alt=''></a></noscript>
  EOJS;
?>

Or, just use Micro's file_get_contents() solution.
 
Last edited:

iubtalks

New Member
Messages
90
Reaction score
0
Points
0
When i use the second Code given in php echo form. I get this result.

Parse error: syntax error, unexpected $end in /home/iubtalks/public_html/index.php on line 1404

But when i use the code given by "
dest581" The result you can See Now in www.iubtalks.com

Its just works fine. Thanx dest581. ;) :biggrin: :biggrin: ;)

I Donated you 50 points for this help. Looking forward for your help in future.
 
Last edited:
Status
Not open for further replies.
Top