Jump to content

t_machine

Members
  • Posts

    104
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

t_machine's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. I need to use .htaccess to rewrite my urls that have index.php to index2.php. My links are http://www.mysite.com/index.php/test http://www.mysite.com/index.php/test2 I would like them to be http://www.mysite.com/index2.php/test2 There are many of them so it would take a very long time to manually find the urls and rename them. Thanks
  2. Hi, I am using the following function to get the actual days between two given dates but it is having memory allocation issues. $sStartDate = 2009-06-22; $sEndDate = 2009-06-29; function _GetDays($sStartDate, $sEndDate){ $sStartDate = gmdate("Y-m-d", strtotime($sStartDate)); $sEndDate = gmdate("Y-m-d", strtotime($sEndDate)); $aDays[] = $sStartDate; $sCurrentDate = $sStartDate; while($sCurrentDate < $sEndDate){ // Add a day to the current date $sCurrentDate = gmdate("Y-m-d", strtotime("+1 day", strtotime($sCurrentDate))); // Add this new day to the aDays array $aDays[] = $sCurrentDate; } return $aDays; }//EOF What I am trying to do is get it to display 2009-06-22, ..23, ..24, 25, 26, 27, 28 and the 2009-06-29. This would be the days in between the start and end date including both dates. Any help or a better code would be really appreciated. Thanks
  3. Hi, I have links from a database that contains the image name and type. How can i strip the name and file type from the link. Example: $string = 'http://mysite.com/images/myimage.png'; How can I parse that string and get myimage.png Note also that the file type is not always .png, it is also .jpg, .jpeg, .gif.... Thanks
  4. This is a weird one and I am not sure where to begin. My website is on a subdomain (http://subdomain.mysite.com) The problem i get is that my images and some files will not load. I checked the properties and they are linked correctly. If I visit the webpage at http://www.mysite.com/subdomain then it loads fine or if I link to the image from the browser address bar http://subdomain.mysite.com/public/images/blue.jpg then it also loads fine. It just will not load inside a <img src.... . I used firebug for firefox and found out that it is throwing a no permission error. I checked folder permission and it is fine. Any help would be greatly appreciated.
  5. Hi, how can I list the days in the current month? It should account for months with 31, 29, 28, 30 days. 1,2,3,4....
  6. Thank you, it does work. Seems there was also another issue that was in part causing the original codes to not work.
  7. Hi, I have a table in mysql database that stores download_file, download_date(DATETIME), user_id How can i get the files downloaded in the last 7 days? I am using the following but does not seem to work. $sql = 'SELECT download_file FROM {my_table} WHERE DATE_FORMAT(download_date, "%d%m%y") >= DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 7 DAY), "%d%m%y")';
  8. Thanks for the reply. I will be sending back values in two variables which are encrypted(hash) but they cannot be retrieved via $_GET as the script will not accept anything other than a post. I have added fopen to the list which does work great.
  9. hi, i am writing a script that will give users a few options to post to another server depending on their server setup. So far I have cUrl and fsocket, I know php 5 offers HTTP, does any know how to use that to post to another server? I have tested on a server that has both curl and fsocket disable so I am hoping the HTTP in php 5 will help or if there is any other that would be great. Thanks for any help/guidance
  10. Thanks for the explanation Would this apply if I store my dates as DATETIME in mysql instead?
  11. There seems to be a problem with time() function if I add many years. Example; $fifty_years_from_now = 1577846300+time(); If I do a date() on the variable I get 22/04/1923 echo date("d/m/Y", $fifty_years_from_now); What am I doing wrong? Thanks
  12. Sorry for not posting the exact codes in the first place My host will not update to php 5 and I would like a fix until I get a new host. The fix that Crayon Violent added still did not get any results. This is how the links are laid out on the page: <a class="CLASS_NAME" href="URL" alt="ALT_TEXT"> <h2 class="ANOTHER_CLASS" style="display: inline;">LINK NAME</h2> <br/> </a> I am using file get content which gets the content fine but parsing it still gives no result. I am using the following with Crayon fix included $regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*><h2[^>]*>(.*)<\/h2><\/a>"; if(preg_match_all("/$regexp/siU", $input, $matches)) { foreach($matches as $match) { echo $match[2]; echo $match[3]; } } Thanks again for any help
  13. Is there a php 4 version of the Domdoc, the codes above worked great on my local server which uses php 5 but does not work on my main server which is php 4
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.