+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Banner rotation - Using what? and how?

  1. #1
    Lord Of The Land is offline x10Hosting Member Lord Of The Land is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    26

    Banner rotation - Using what? and how?

    I want to do my own advertising on my site, i would like it to rotate when looking at my website. Soo I have not a clue what to use and also I dont want the same banner to appear everytime. Could someone help me thanks!

  2. #2
    tnl2k7 is offline Banned tnl2k7 is an unknown quantity at this point
    Join Date
    Nov 2007
    Location
    #offtopic ;)
    Posts
    3,131

    Re: Banner rotation - Using what? and how?

    Hey,
    I use a small section of PHP code that randomly picks a number between two numbers I specify, then uses a PHP include to import the contents of that advert. I.E.

    Code:
    <?php
    
    srand((double)microtime()*1000000);
    $advertcode = rand(1,5);
    
    include("$advertcode".".php");
    
    ?>
    The above chooses a number between 1 and 5 (this can be changed) and then shows it. For example, if the advert chosen was 3, the file it would look for would be '3.php'. You need to place the adverts in the same directory for this to work.
    Last edited by tnl2k7; 03-17-2008 at 01:23 PM. Reason: spelling

  3. #3
    Lord Of The Land is offline x10Hosting Member Lord Of The Land is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    26

    Re: Banner rotation - Using what? and how?

    Thats perfect thanks, I didn't think of doing it that way!

  4. #4
    tnl2k7 is offline Banned tnl2k7 is an unknown quantity at this point
    Join Date
    Nov 2007
    Location
    #offtopic ;)
    Posts
    3,131

    Re: Banner rotation - Using what? and how?

    No problem mate, can you add to my rep please? It's just that not many people bother :D

  5. #5
    Lord Of The Land is offline x10Hosting Member Lord Of The Land is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    26

    Re: Banner rotation - Using what? and how?

    This is happening when it generates 1.php

    JFIFHHC       C  <J  !1AQ"#SU’“2aq‘BRbrt%35T$ Cs‚4c3Qa‘ R!1A"23qr#b ?–‡hh|’i#B IA’N*x‘̾kkNj[o*{% }[kcVWUKp{’€4V˜꺪$7$h>*1)uTInH }[kcS“ƒܐ< UQ' xAmNNcr@ƒ_sWUDœ ն?…:‰8=m} u]Up{’€4V˜꺪$7$h>*1)uTInH}[kcS“ƒܐ< UQ' xAmNNcr@ƒ_sWUDœ ն?…:‰8=/sKi9DKƒr0ALu[ ‡j-o2`‡>D{‹Kˆ*H1I-vž\dcRƒ, ›{=mo+ IDr3Vv-@‘g+m7†IhƒoƒœP9D[MŒ(;#l7e‹Lh#bŸU@MŒ>j1} ն?…yuTNcr@ƒ_sWUDœ…ss7@I 'UQ'! N‰ UQ'!o€4V˜꺪$7$h>*1)uTInH }[kcS“ƒܐƒ ^_1)uTInHPšVŒ论EXS<]:‰8= a{Ÿ–1"–9‚0r#꺪$7$m} u]Up{’€4V˜꺪$7$h>*1)uTInH+F…N U$WUDœƒxAmNNcr@ƒ_sWUDœ ն?…:‰8=m} u]Up{’€4V˜꺪$7$3G"šEeOc4꺪$7$ 4xB-AUQ'!>}[kcS“ƒܐ< UQ' xAmNNcrBeœG FXC3€zNNcrA Vcrt6py9Ӫ“ƒܐm} u]Up{’€4V˜꺪$7$h}du–z:uTInH CϣFL*|};Kvv-:‰8=ƒ_sWUDœ‚Gw? b4o%Š1HuTInH?€4V˜꺪$7$h>*1)uT InH}[kcS“ƒܐ< UQ'!% vGfXJg{el8G*Χ/pšȨDDaiߺ1Z2Σƒ,S3zZ9F”*2 '@i’4ŽG*KŽv€€Œh4šf€3@  h7WH8\[7;\vgG*㸴O…-G!\’ĝ“j%†W-–AFF Ž߲W!›aVO2.`‡Š \=“ŒG™š–fc’JX˜UsrI:Ž$+}=K< 'UCޥwDƒpVžšaѱmG•gr8s‡^cg“ ‘E2p ?3XyjB[G&˜b( lvVnXҦIg•8lyݰnUg0\Mo4~nC<$Iƒ: ,@**€r|†NES?h jZx€˜"ŒzB€*d lnd1ۺȹvˆ3ŒX?A‰/0•!’W|3K‚–b ^@h6w93lMƒ;ݴ„3JIfx”,g2 z…K\{U,n JLpz nŽBgTŽz D&sGJ ;[E2O™.œY)ŒxžWX(ŠhC,M˜8Ši^k :MZ7<<œI žGDͧ™]œŸisk޳Ž&$ž\ D;@,wvx'•@Vw‘G(Ÿ€GŽd[ ,9c #( 3 •$̣“y 83EŽK|9ƳeXfq!X$Œb•8ž!Y nˆ‰’jZ*C ‹Ÿ3X&‡g-fW’h.ŽNkGخ-UŽzq0_$: UŠ=j'v9Š3@OyŽƒ@3M#rf-œ\m 40$o “vwg-<*N:2MoOM"GŽŠL"~h.OIyW !f9f,~t€3@NŒuP —w;2hg•F€šKg™  tPn&#Fh…#†9ljn޼›‰ˆ‘š™#~&€ M€‘+0c&yOKG3@BX€†vc–9=€+vW [> œ—}d=‚ݡ˜~e'YZb^yˆ$}y Te“w‹?…#`AﻏPTw,1ŒvŽ3y) e‚d\x[{Ztk›5͝˜“g( Q44K+B"Žuƒ“?^X@neœ’EǶJK x`f‰i,s+ŠqŒ9u .5]:C1+ :˸9Pž -|s?_–O*’* g<***Jll9„u‹mY'š|Ÿny('8D@Z 2sȴ2z09fHeW)9kWrr ˆWtw)‘f9f5™ Z~nuP‹rdcŸ.nj:_‹>rJOF ~Ž ָJšImp%Q1x,‘@EŸ?@t@p HPe~*$–."d G%p,YS@4Wi!*'w’‘JIh–wŽ‚o>K~Œlo ~@ 9ŒvF……yl î€d{z,A721 O]™m”Eݷ€| l\›Pn}€d’=m Š>E–6@r‹Ÿ = }ˆ-G2 7aWo"€Q%̫†c#G†>:‚-{Y—l •檏ŽŽ\ 1;qHƒe‚g%Y?OmM?h*„_™~I~)) {ž,Lh?t'•J9~tf€_Ÿ*]Bk{i–a$==ŸY z—*?M—RŽW’Š€si@u,t@yƒhn0n8ˆf hI‡?•@GdŒpH>Ÿ-ƒZ†I'~|g˜Y1lZb"ž[m! ^;m–œŒG#Nt\6кBŠ)T$cs3t“€3R-BQѝby ^ k–k‹ti1eO:cY–‚G"™S?9n”‘ ‰$‚I*#mJqJY{A‘?!۰A[UŠGKgp[ӱ &8n~Q:?•.C—ݫ&L?‡”–d2A ;WUƒVY/Zgjg9'—`*k?gOp——™pDA‚tV ?@1|œPgŽozH#˜'€yI–†I•$n+F9mT f˜s7W賦cSh #€@UU(ƒ?1|$xy`B"Y8„yJU"(qW—ˆA ” 8\ Q3#K,Q%t+g ˆzhŽ8“€qn‘“ /=–žs^‘T‚$l’n%Ž8wI4a‚ h`ŸOHzhf€3@BH5(F~@#EE,g8˜z… ša\곦cSh‹tK.n#]ŶF;J1=;–b“žf€B™c•7P3€3P‚„!vds +2–Y)Œ*-Ǫ€H$p‰dY6*W8Xש {may<53 „eƒ „ŽGžMwM‹‰3:*%YR˜^a|`zG(f (f€3@ >sEƒe‚g%Y?OiŸ[ݢ@~e'YM6OEvžPW<€N@&€ũi ~"A" +:5(qռ9oͷ 'Y[†{™ž› x\&€>›1k›;o+}ݝ”Zm–Š€}+Tž2“u* ‡z-‰6A9Š0†qŸ84\ƒn`ˆfSžYXT‹FŸ^ :Oy€IQ%Œ"‡F ‡Š–Ÿ(Jgku‚r^^z*— ==WŸGگˆ`_T[,n_%”,>sjV5|$NH*_kOCzè5]~+h*%*j7"œuP-žH^zEG|q,Zˆ#mG+iou=/{ζT•/•‘ŠtW˜–“}m•>.kO –K[dˆs˜24ŒYžg5ŸK?^+=+@:;3Y z5-R‡tWrqR[$(G:kQ֯*v4cSF,•Jcˆ sQ– d4:4{6ШsyT —@LwVg‡*9  {hgB  --€OeZ –wŒ 2w@47*@(1™/c "0ȲŸ$端w‹q7V|h wP@un )k‡€|'c>xc]A’Ѹ[„PFzp@,7Q;NTž.X :1H^YO@]d…[][ E –€V‹ln$N8S&|>Šc‘*;v+@3P<Š72/mOr™—-D} †5*#:+>’ƒ}lqS†N@C^گҝFFXtRs% $eLf69~4ž~Pơ_xOSh‡x *„_™~I~)6,†h4šf€3@ h4=*ZS V†9žY3@ gF`Xˆz.HGuF€ EcyŒ‘ —‘| 9n“@MK-N+ѼQq†@7EufY17-!oqk9cwW@ Y ;}DT/:žgqln*œ›1epgiLLfiF`N >:’o4e…" Iq$/HJ žX˜MGq;3@&h4š+2c$ j‡rA91B(H‡+’_96n@[nvm’4!IVݿŸG1œf€X$I•wZlo†=tŽiš tYh}%ž‚E%@W 2) )x˜:9/P†U‹p7%f€-–…s/l’1™K":; c&‚IpS—–725€Ir˜˜Ÿ"€`$: D$\Jon3$™.…5,xJK4VY$1Be™zU0:) S,5b{–RFKts  1q$˜Œ$|_(ž_eŠ’+€ȥ™˜’’HOO@ #4(?0z_/{'MvV!EIW`gʯ]5V28^7F6K=-Y6“q$Q?>†ž’M_ѨwŸCoI&/n‡ϡ_“qj7]g/I‹5m—$EpY6’n"Fx ezI7Fu<} =$›ˆQ?>†ž’M_ѨwŸCoI&/n Db_“qj7]g/I‹5m—$EpY6’n"F?>Š ž’M_ѨwN59=$‰s&#ɵƒŽ`“ >•e(,L/œܬ.d‰m^׽!0;(C}"s]]—Kmm"Or7“•œN@YzgU›q,_Ѩw6/wzAn?ž’MF>?>Šž’M_ѨwŸEoI&/n‡Ϣ_“qj7]g[/I‹5*—$EpYV’n"Fx+ ezI7Fu<}=$›ˆQ?>Šž’M_ѨwŸC oI&/n“m—$EpY6’n"FxezI7 Fu<} =$›ˆQ?>†ž’M_ѨwŸCoI&/n‡ϡ_“qj7]g/I‹5m—$EpY6’n"Fx ezI7Fu<} =$›ˆQ?>†ž’M_ѨwŸCoI&/n‡ϡ_“qj7]g/I‹5m—$EpY6’n"Fx ezI7Fu<} =$›ˆQ?>†ž’M_ѨwŸCoI&/n‡ϡ_“qj7]g/I‹5m—$EpY6’n"F5‹V n.`Fž{jxP‘‰b/‹tws:l
    Anyone explain what I have to do to stop this happening. I am using the code tnl2k7 provided.

  6. #6
    nexhunter's Avatar
    nexhunter is offline x10 Sophmore nexhunter is an unknown quantity at this point
    Join Date
    Nov 2007
    Location
    millbury,massachusetts
    Posts
    239

    Re: Banner rotation - Using what? and how?

    did you rename the image file extension into .php or did you put <img> code for the ad into a php file



  7. #7
    tnl2k7 is offline Banned tnl2k7 is an unknown quantity at this point
    Join Date
    Nov 2007
    Location
    #offtopic ;)
    Posts
    3,131

    Re: Banner rotation - Using what? and how?

    Make sure there's a file called '1.php' in the same directory as the script, and edit the bit where the random numbers are specified (i.e. if you've got two ads change the bit in brackets from 1,5 to 1,2). Name the script adverts.php or something like that (with the .php extension).

    Then put everything in the same directory as the page you want to use it on, and use this code to make the adverts appear in the area of the page you'd like them:
    Code:
    <?php
    include("adverts.php");
    ?>
    If you're trying to get images to rotate, you'll need to put this code into 1.php:
    Code:
    <a href="URL"><img alt="ALTERNATE TEXT" src="PATH/TO/IMAGE" /></a>
    Keep the image's file extension the same, such as .jpg, .png, .gif, etc. Just use the standard code to embed the image in 1.php.

    If you've still got problems, post back and I'll help you out.
    Last edited by tnl2k7; 03-18-2008 at 03:00 AM.

  8. #8
    Sohail's Avatar
    Sohail is offline x10 Spammer Sohail is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    London, UK
    Posts
    3,052

    Re: Banner rotation - Using what? and how?

    You could pay someone credits in the marketplace to do this for you, that way it would be professional and everything...

  9. #9
    tnl2k7 is offline Banned tnl2k7 is an unknown quantity at this point
    Join Date
    Nov 2007
    Location
    #offtopic ;)
    Posts
    3,131

    Re: Banner rotation - Using what? and how?

    Quote Originally Posted by sohailamir52 View Post
    You could pay someone credits in the marketplace to do this for you, that way it would be professional and everything...
    Charming...no really, how polite.

  10. #10
    Lord Of The Land is offline x10Hosting Member Lord Of The Land is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    26

    Re: Banner rotation - Using what? and how?

    I found this very helpfully! If you have a banner I would be more than happy to advertise it in return for this help. Thanks!

+ Reply to Thread
Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers