Jump to content

westman

Members
  • Posts

    600
  • Joined

  • Last visited

Posts posted by westman

  1. hi all,am looking for a way users can download a file from my site if my file is...www.mysite.com/files/15.png how do i right the script to download it?

  2. i have an example code...

    <?phpif (isset($_POST['username'])){$username = $_POST['username'];}?><form action="index.php" id="username_form" name="username_form" method="post"><input name="username" id="username" type="text"><input name="username_submit" id="username_submit" type="submit"></form>

    my question is...is $username the name or the id?andhow can i get the name and id sepretly?

  3. how do i - 20% of a number in php? i tryed...

    $my_num = "100";$my_num2 = ($my_num - 20%);

    but DW is giving an err plus i would like to save the $my_num2 in the format of 0.00 (example 99 - 20% = 79.20)

    time()

    got it!!!... i 1st tryed...

    function time_elapsed_A($secs){    $bit = array(	    'y' => $secs / 31556926 % 12,	    'w' => $secs / 604800 % 52,	    'd' => $secs / 86400 % 7,	    'h' => $secs / 3600 % 24,	    'm' => $secs / 60 % 60,	    //'s' => $secs % 60	    );	      foreach($bit as $k => $v)	    if($v > 0)$ret[] = $v . $k;	      return join(' ', $ret);    }$nowtime = time();$dis_time_left = time_elapsed_A($dis_d_time_indb - $nowtime)."\n";

    and i found a bug in this so i made...

    $nowtime = time();$secs = ($dis_d_time_indb - $nowtime);$day_left = $secs / 86400 % 7;$hour_left = $secs / 3600 % 24;$min_left = $secs / 60 % 60;$dis_time_left = '' . $day_left .' D ' . $hour_left . ' H ' . $min_left . ' M '';

    and this works for me 100% of the time ;) thank you and please comment

    time()

    hi all,i got 1 for you ;) i am placing this in my DB...$time = time() - 259200;witch is (now - 3 days) and i am using VAR (50) in my DB how can i pull this out on my DB to show on the page... "2days,7hours,34min left" i looked at...http://www.w3schools.com/php/func_date_time.aspbut it only shows days and i need time any help?

  4. i just tryed...$handle = fopen("../email/theemail.php", "rb");$email_in_put = stream_get_contents($handle);fclose($handle); but it did not work, i am runing php 5.2 am trying to get html code from 1 file in my directy in to a verible.any help?

  5. as some of you may know php has got a smail bug with $file_in_put = file_get_contents('../theflie.php'); when i 1st used it i had no prob. am trying to get 1 file (html) content in to a verible (the file can be .php or .html any that works)what is the next best way to do this? ps. yes i looked at...http://php.net/manual/en/function.file-get-contents.phpbut still no help

  6. hello agin am back ;) how do i remove evey at the end on a url like... http://www.google.co.uk/#hl=en&output=search&sclient=psy-ab&q=cat&oq=cat&gs_l=hp.3..0l4.1417.1966.0.2642.3.3.0.0.0.0.292.699.2-3.3.0...0.0.O5jDmsat_hQ&pbx=1&bav=on.2,or.r_gc.r_pw.r_qf.,cf.osb&fp=1deb3a27a4d9b1ab&biw=1366&bih=664 will be...http://www.google.co.ukremoving every thing after the /how do i do this? i can remove everything before like... $site_url = str_replace("http://", "", $site_url);$site_url = str_replace("http://www.", "", $site_url);$site_url = str_replace("https://", "", $site_url);$site_url = str_replace("https://www.", "", $site_url);$site_url = str_replace("www.", "", $site_url); but i need to remove everything after the /how?

×
×
  • Create New...