Jump to content

westman

Members
  • Posts

    600
  • Joined

  • Last visited

Everything posted by westman

  1. westman

    new learner

    most impotent question has been asked "What are you trying to do?" are you posting info to a DB or are you link building? from your code it is uncertain.
  2. thank you it works. you got me! it is not my code but I have used it before and it has worked outside a loop. would love to know how each line of the code works. have you got the time?
  3. westman

    php string bold

    try... $mailtext .= '<b>' . $name . '</b>' . $trenner . $einzelwert . $trenner2;or$mailtext .= '<strong>' . $name . '</strong>' . $trenner . $einzelwert . $trenner2; as mentioned above.
  4. westman

    logging

    He what'd to know how to send an email. I helped with code. you are welcome
  5. westman

    logging

    $to = "me@gmail.com"; $from = "admi@mysite.com";$subject = "error";$message = '<html> <body bgcolor="#FFFFFF"> <br /><br /> Error: ' . $error_log . ' </body> </html>'; // end of message $headers = "From: $fromrn"; $headers .= "Content-type: text/htmlrn"; // Finally send the activation email to the member mail($to, $subject, $message, $headers); NOTE to the mods and admin. It is ok to help with code from time to time it will not kill you to help in this way.
  6. I do not know what part of my code defines the function so here is what I did... $time04 = date("Y-m-d",time() - (60*60*24*7*26)); // 6.5 mouths (26 weeks)$time04 = mysql_real_escape_string($time04);function delete_directory($directory, $empty=false){ if(substr($directory,-1) == DIRECTORY_SEPARATOR){ $directory = substr($directory,0,-1); } if(!is_dir($directory) || !is_readable($directory)){ return false; } else{ $handle = opendir($directory); while (false !== ($item = readdir($handle))){ if($item != '.' && $item != '..'){ $path = $directory.DIRECTORY_SEPARATOR.$item; if(is_dir($path)){ delete_directory($path); } else{ unlink($path); } } } closedir($handle); if($empty == false){ if(!rmdir($directory)){ return false; } } return true; }} $sql02_info_get = mysql_query("SELECT * FROM ads WHERE live='0' AND addate < TIMESTAMP('$time04')");$sql02_info_get_count = mysql_num_rows($sql02_info_get);if ($sql02_info_get_count > 0){while($row = mysql_fetch_array($sql02_info_get)){$remove_adid = $row["adid"];$directory = "pics/$remove_adid";//if(!is_dir($directory)){//echo "good";//exit(); //}else{//echo "bad";//exit(); //}delete_directory($directory);$remove_adid = mysql_real_escape_string($remove_adid);$sql02 = mysql_query("DELETE FROM ads WHERE adid='$remove_adid'"); } // end loop} will this work? if not please give code examples.
  7. how am I going to remove the code in the block that defines the function and still have a function than functions? I do not understand. please be more clear by telling me all the key words I need to remove or paste some code to see.
  8. Do you mean this line? function delete_directory($directory, $empty=false) // line 236{ If not please copy and past the line so it is clear.
  9. do you mean the last line? delete_directory($directory);
  10. omg you are right. the loop is messing up the second time. I can see it works 1 time since i have one less entry in my DB. now then.... how do i make it work on a loop?
  11. Hi all, I am trying to remove a folder if it exists and files within it if they exists. I keep getting this error. Fatal error: Cannot redeclare delete_directory() (previously declared in /home/content/31/1234321/html/ads/index.php:236) in /home/content/1234321/html/ads/index.php on line 236 $time04 = date("Y-m-d",time() - (60*60*24*7*26)); // 6.5 mouths (26 weeks)$time04 = mysql_real_escape_string($time04);$sql02_info_get = mysql_query("SELECT * FROM ads WHERE live='0' AND addate < TIMESTAMP('$time04')");$sql02_info_get_count = mysql_num_rows($sql02_info_get);if ($sql02_info_get_count > 0){while($row = mysql_fetch_array($sql02_info_get)){$remove_adid = $row["adid"];$directory = "pics/$remove_adid";//if(!is_dir($directory)){//echo "good";//exit(); //}else{//echo "bad";//exit(); //}function delete_directory($directory, $empty=false) // line 236{ if(substr($directory,-1) == DIRECTORY_SEPARATOR){ $directory = substr($directory,0,-1); } if(!is_dir($directory) || !is_readable($directory)){ return false; } else{ $handle = opendir($directory); while (false !== ($item = readdir($handle))){ if($item != '.' && $item != '..'){ $path = $directory.DIRECTORY_SEPARATOR.$item; if(is_dir($path)){ delete_directory($path); } else{ unlink($path); } } } closedir($handle); if($empty == false){ if(!rmdir($directory)){ return false; } } return true; }} delete_directory($directory);$remove_adid = mysql_real_escape_string($remove_adid);$sql02 = mysql_query("DELETE FROM ads WHERE adid='$remove_adid'"); } // end loop} any help?
  12. westman

    UTC+0 time set

    I know the logic but not the code. so hopefully this question helps. how do a make this variable hold the current time in London (in "Timestamp" format and "Date Time" format)? $The_Time_In_London_Is from this basic platform I may be able to do the maths.
  13. westman

    UTC+0 time set

    Hi there, I have been playing around with this code... $t = strtotime('Friday 18:30');$seconds_until_t = $t - time();$t2 = strtotime('Friday 18:30');$seconds_until_t2 = $t2 - date_default_timezone_set("UTC");echo $seconds_until_t * 1000;echo "<br />";echo $seconds_until_t2 * 1000;$TimeZoneNameFrom="UTC";$TimeZoneNameTo="Europe/London"; and I have a problem with my timestampthe problem is that when I get "echo $seconds_until_t * 1000;" I see the numbers 41550000 but when I copy and past it in JavaScript I get a long negative number and this feedback... Do It Result: java.util.GregorianCalendar[time=384847000,areFieldsSet=true,lenient=true,zone=Europe/Istanbul,firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=1,YEAR=1970,MONTH=0,WEEK_OF_YEAR=2,WEEK_OF_MONTH=2,DAY_OF_MONTH=5,DAY_OF_YEAR=5,DAY_OF_WEEK=2,DAY_OF_WEEK_IN_MONTH=1,AM_PM=1,HOUR=0,HOUR_OF_DAY=12,MINUTE=54,SECOND=7,MILLISECOND=0,ZONE_OFFSET=7200000,DST_OFFSET=0] Again I am trying to get a timestamp for how many days, hours and minutes are left till the next Friday 18:30 in London. or to make thinks even easier, to get my php to print out the next Friday 18:30 in London like this "01/23/2015 18:30" what am I doing wrong?
  14. westman

    UTC+0 time set

    I could not get any information from php's site
  15. westman

    UTC+0 time set

    I really do appreciate your examples, they are helpful. However, I am using App Inventor to build an app and can not use hard core code. The variable I am using in App Inventor is: day = 6 hour = 18 minute = 30 and the count down works https://lh3.googleusercontent.com/-rToyVjegrJ4/VK7brlHiFgI/AAAAAAAAGFA/e9NkeE9Y5Nc/s1600/Capture.JPG the only problem is that it takes the time from the phone. That's why I need to use php to call the UTC+0 time. How can I get the UTC+0 time in the format of... day = 6 (days remaining) hour = 18 (hours remaining) minute = 30 (minutes remaining) in php?
  16. westman

    UTC+0 time set

    in this echo i am getting "-" in the number for example "-384847000" why? plus here i have 3848 minutes till the next Friday 18:30 Ho do I change this long number from "-384847000" to "day = 4 hours = 2 minutes =45" I tried this but it did not work.... $t = strtotime('Friday 18:30'); $seconds_until_t = time() - $t; $minutes = $seconds_until_t / 60; $hours = $seconds_until_t / 60; $days = $seconds_until_t / 24; echo $seconds_until_t * 1000; echo "<br />"; echo $minutes * 1000; echo "<br />"; echo $hours; echo "<br />"; echo $days; echo "<br />";
  17. westman

    UTC+0 time set

    I am looking for "Friday" witch = 6 in JavaScript. I have a count down in JavaScript and i need php to give the day and hour to JavaScript so the count down is the same all over the world. The day "Friday (6)" The hour "18" The minute "30"
  18. westman

    UTC+0 time set

    No the user is not the one who is choosing the time.It is a set UTC+0 time in the system.
  19. westman

    UTC+0 time set

    I am working in JavaScript and need to past the time in a URL from php so the day will be a number from 1-7 (1 = sunday) and the time (for example 13:32) so i need the day and hour in 2 different php variables could you give an example?
  20. westman

    UTC+0 time set

    How do i get the time of 18:30 UTC + 0 ?
  21. foxy, again, thank you so much. lol 20% and %20
  22. so... $new_url = preg_replace(''/[20%]+/', '" "', $new_url); or $new_url = preg_replace(''/[20%]+/', ' ', $new_url); or $new_url = preg_replace(''/[20%]+/', " ", $new_url); ?
  23. hi all i have been trying for 7 hours now and i can not find the best way to change 20% from a url string to a space. I am trying to change this "20%" to this " ". this is what i have.... $new_url = preg_replace('"20%"', '" "', $new_url); any help?
  24. westman

    dynamic div width

    thanks. I also found display:table-cell to be helpful too. http://mihaifrentiu.com/how-to-fill-the-available-space-when-using-floated-divs
×
×
  • Create New...