Jump to content

KrisNz

Members
  • Posts

    271
  • Joined

  • Last visited

Everything posted by KrisNz

  1. What is it you're trying to do? move_uploaded_file() moves files uploaded through a form, from the tmp directory to the destination you give. If that's not the case, use rename which moves the file from $source to $destination.
  2. You've practically written the answer in your topic! if (copy(....)) { echo "success"; unlink("..."); } else { echo "unable to move file"; } If you're just moving a file from one path to another, use rename(). If you're moving an uploaded file, use move_uploaded_file().
  3. you haven't closed this tag <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
  4. That's not a very nice thing to do, now is it?
  5. You aren't using strtotime correctly. If you want to add 28 days to a TIMESTAMP its $now = time(); $tsTwentyEightDaysLater = strtotime("+28 day",$now); /*note that by default strtotime uses the current time() as the second argument. I'm just putting that in for clarity. */ //In your case, you want to first convert your mm/dd/yyyy date to a TIMESTAMP $tsUserDate = strtotime($tse_start); //gives us a timestamp $tsTwentyEightDaysLater = strtotime("+28 day",$tsUserDate); //gives us a timestamp $mdyTwentyEightDaysLater = date("m/d/Y",$tsTwentyEightDaysLater); //gives us an m/d/Y formatted date
  6. Is your php info file in the htdocs directory of apache? By default its something like C:\Program Files\Apache Software Foundation\Apache2.2\htdocs
  7. As Teng mentioned, you might be looking for the date function. The php equivalent of now() is date("Y-m-d H:i:s");
  8. You can use file() to read the file into an array, where each line is an entry in the array. If count() of array == 30 then array_shift() to remove the first entry, implode() the array back into a string, append your new line, rewrite the file.
  9. You should read this Protect Your Code and Graphics - Or Not If you think the information you have is so exclusive/valuable then you perhaps you should be looking at ways of generating revenue by allowing access to that information rather than trying to discourage people from stealing it.
  10. This is dangerous exec($_POST['user_command']);
  11. While I realize there's educational value in this, I thought I'd point out that there's already grease monkey scripts that allow you to do this
  12. If all you want to know is how many files are included then use the get_included_files() function.
  13. attach everything as a zip file under "additional options".
  14. 1) No. 2) Yes, in that case you'll need to use strpos() e.g if (strpos($event_id,"foo") === 0 ) { //does event id begin with "foo"...
  15. You can treate strings as arrays so if ($event_id[0] == 'T') { ....
  16. Theres also the strtotime() function e.g //assuming $tse_start is a timestamp $tse_estlive = strtotime("+28 day",$tse_start); //if its not... $tse_estlive = strtotime("+28 day",strtotime($tse_start));
  17. try putting &copy=1 and see what happens! & is the html entity for & and the correct way to put an ampersand in an html document, it wont validate if you don't.
  18. Theres a modify headers add-on for firefox, I haven't tried it. https://addons.mozilla.org/en-US/firefox/addon/967
  19. the beginning of the string should be {$row3['property_type']} - any hash key you access inside a string has to be inside {}. You can get around some of the messiness by using heredoc syntax (though the rule about {} I just mentioned still applies) or by breaking out of php like so <?php while($row3 = mysql_fetch_array($results3)) { ?> <tr> <td class="bodytext"> <?php echo $row3['property_type'] ?> <input type="checkbox" name="<?php echo $row3['property_type'] ?>" value="<?php echo $row3['property_type'] ?>" /> </td> </tr> <?php } //end while ?> I use a keyboard shortcut for <?php echo
  20. separate each item with & e.g <a href="www.example.com/welcome.php?id=Chinese&anotherarg=somethingelse">Text</a>
  21. I don't really understand this.. But you might like to investigate the Registry pattern - this can be used to hold or retrieve a reference to your $classes hash.
  22. If I understand correctly, you've got a file that has a hash of class names and their associated file name? Doesn't this mean that every time you write a class you have to go and update that file? To me that somewhat defeats the purpose of having autoload. If you use a naming convention for your classes and their associated filenames you can avoid this altogether. If you camelcase your class names e.g <?php class ThisIsMyClass { //.... } ?> Then name the file this_is_my_class.php You can convert the camelcase to the underscored version with this <?php function camelToUnderscore($s) { //http://www.regular-expressions.info/refadv.html //this translates to //look behind(to the right of) the first character for any upper case //character and replace it with an underscore + the matched character return strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $s)); } ?> That way you can convert $class_name to its matching file name without needing to keep a reference of it.
  23. If you want that to all happen on the same page, You'll need to send the email before you output the pdf. Your pdf library will almost certainly have a method for outputting directly to the browser.
  24. note that the variable is $yesOrNo not $yesorNo (i.e the capital O)
×
×
  • 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.