[PHP] Allow Download in 3 Seconds

Discussion in 'PHP' started by fLICKERR, Mar 27, 2012.

  1. #1
    User Allow To Download In 3 Seconds

    
    [COLOR=#0000BB][FONT=monospace]<?php 
    [/FONT][/COLOR][COLOR=#FF8000][FONT=monospace]// if name via get equals 'download", show the downloading message. 
    [/FONT][/COLOR][COLOR=#007700][FONT=monospace]if([/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]$_GET[/FONT][/COLOR][COLOR=#007700][FONT=monospace][[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]'name'[/FONT][/COLOR][COLOR=#007700][FONT=monospace]] == [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"download"[/FONT][/COLOR][COLOR=#007700][FONT=monospace]){ 
         
        echo [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"Downloading ... "[/FONT][/COLOR][COLOR=#007700][FONT=monospace]; 
         
    } else { 
    [/FONT][/COLOR][COLOR=#FF8000][FONT=monospace]// set refresh to 3 seconds, make the variable name be 'download' via the get method;
    [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]header[/FONT][/COLOR][COLOR=#007700][FONT=monospace]([/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"Refresh: 3: url=http://domain.com/index.php?name=download"[/FONT][/COLOR][COLOR=#007700][FONT=monospace]); 
    [/FONT][/COLOR][COLOR=#FF8000][FONT=monospace]// show this message 
    [/FONT][/COLOR][COLOR=#007700][FONT=monospace]echo [/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"You can download in 3 seconds."[/FONT][/COLOR][COLOR=#007700][FONT=monospace]; 
    
        } 
    [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]?>[/FONT][/COLOR]
    Code (markup):
     
    fLICKERR, Mar 27, 2012 IP
  2. mfscripts

    mfscripts Banned

    Messages:
    319
    Likes Received:
    4
    Best Answers:
    8
    Trophy Points:
    90
    Digital Goods:
    3
    #2
    Try semi-colon instead of colon after the 3. i.e.

    header("refresh:3;url=http://domain.com/index.php?name=download");
    PHP:
     
    mfscripts, Mar 30, 2012 IP