Jump to content

westman

Members
  • Posts

    600
  • Joined

  • Last visited

Everything posted by westman

  1. westman

    download script

    so using... $down_file = "www.mysite.com/files/15.png"; header('Content-Disposition: attachment; filename="pic.png"'); where do i put $down_file?
  2. westman

    download script

    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?
  3. westman

    info need on POST

    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?
  4. thank you so much + i got the 20% thing too.
  5. westman

    maths 20%

    got it... $my_num = "8";$my_num2 = ($my_num * 80 / 100);
  6. westman

    maths 20%

    could you give a code demo please
  7. yes,i made a login session to a site and if the login session is not there it will logout a user
  8. westman

    maths 20%

    i tryed...$my_num = "8";$my_num2 = ($my_num * 20 / 100);and i got 1.6i was looking for 6.4how do i get it write?
  9. westman

    maths 20%

    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)
  10. like i said a simple way ;)bro am not a php master
  11. yes i see the message all the time but i would like to stop it. to stop the reposting (dubole posting) of all $_POST & $_GET
  12. what is a simple way i can stop reposting a form when i press F5?
  13. westman

    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
  14. westman

    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?
  15. westman

    file_get_contents

    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?
  16. westman

    file_get_contents

    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
  17. westman

    URL editing

    could you povide a code example, that would be helpfull
  18. always have an "id" filed set to auto_increment in your DBand before posting to your DB check you have not got the info in there already
  19. westman

    URL editing

    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?
  20. westman

    catch a url link

    please do not bicker.cant we all be friend here thank you all for taking your time to awnser my Q. thank you
  21. westman

    catch a url link

    i do i understand thank you but what about...<?php$new_url = $_SERVER['HTTP_REFERER'];?>to get it in a $?
  22. westman

    catch a url link

    ok thank you ;)last 1, can i use it like this?<?php$new_url = $_SERVER['HTTP_REFERER'];?>to get it in a $?
  23. westman

    catch a url link

    ok thank you last 1, can i use it like this? <?php$new_url = $_SERVER['HTTP_REFERER']?>
×
×
  • Create New...