Jump to content

oni-kun

Members
  • Posts

    1,984
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by oni-kun

  1. You can see the obvious error if you look at the syntax highlighting. You need to escape the quotes within alert, or use double quotes: <?php echo '<td class="view" width=""><a href="edit.php?recordID='.$id.'">edit</a> <a href="delete.php?recordType=job&recordID='.$id.'" onClick="alert(\'Alert message goes here\');">delete</a></td>'; ?>
  2. Yes, as ignace brought to light your logic was wrong. || means or, meaning if they are admin, it's asking 'If you're not admin OR not staff, exit.'. Is admin staff? No. Therefor it exits.
  3. IE is there to download firefox you know. This whole world vs IE thing is .. just strange, It's like the world's powers have become so bored they wish to tackle IE out of IE's creator's OS? And "Consider this…if it is a large enough problem to hack Google, your site is not safe." Maybe i'll bring down their internet security branch with Lynx and see how that plays out, Linux's rep will be fucked!
  4. This is a tad harder than just what you could use with PHP itself. You'd need to use a cron job to check for e-mails and parse the data from then, and implicate them into a database of some sort and go on from there.
  5. You should read upon basic SQL techniques before you try to code something you cannot handle. http://www.w3schools.com/SQl/sql_update.asp http://www.techonthenet.com/sql/tables/alter_table.php $sql = "UPDATE tablename SET ip='$ip' WHERE id=$id"; or something similar for example..
  6. OP: Thorpe forgot a semicolon on ob_start if you want to try that method, although a simple include should work in practise.
  7. Yeah time, you can assume it's not too hard to calculate the difference, I mean it's 2010 - 40, but what I meant was to convert a timestamp to before epoch, in a fashion like the unix time stamp could not! Btw, where is your massive collection of emoticons? You (and the other gurus) seem to use them alot, is it in their arsenal? :-\
  8. What exactly is bloated about that? Are you wanting to create a loop to compensate for each 'x = {$playerxarray}'? That won't exactly speed anything up, It may look more compact but it's iterating pointlessly and may lead you to problems in the end.
  9. I'm not sure what you're asking from your wording, but if you're wanting to import a .sql file into a database you'd use phpMyAdmin, or via command line: mysql -p -h DBSERVER dbname < dbname.sql I can list many ways, but It'd help to further explain yourself.
  10. Albeit a good idea, it will better serve the structure if a mix of people ask in a common domain, as there are ranges of people who are learning and professionals, it's fairly safe to say it will get treated the same regardless if it were in a subsection or not. If you have a specific question about security, and it's about PHP, then it may as well be a PHP help question. It's pointless to catagorize everything.
  11. $today = new DateTime('today'); $timeDiff = $today->diff(new DateTime('0001-1-1')); echo "It has been $timeDiff->y years, and $timeDiff->d days since January 1st, 0001"; It has been 9 years, and 15 days since January 1st, 0001 I've been alive since a grand holy event! Your code relies too much on the said bugs, my epoch was to overcome that.
  12. Yes, it seems one way or another they found an exploit in the permissions or script structure and executed a shell to upload files to batch away at their will with their poorly written code. I'd recommend to change all passwords, Especially your (cPanel|Plesk) and FTP/admin area. It may be a good idea to check server logs (apache's) and see if there was anything going on from a client, or it was an 'inside job'. EDIT: '$fp = fopen($towrite."/".$qq.".php","w");' , The script may be spreading itself.
  13. I'm sure many of us have been a huge one at the start of our learning. Welcome.
  14. @Lamez, a longint is an int in range, is the same. As I was bored, I spent the night writing the epoch that should be! function zeroday_time($args=false) { if ($args==true){$case = $args;} else {$case = date('d/m/Y');} $map = array(31,28,31,30,31,30,31,31,30,31,30,31); $cur = explode('/', $case); $days = $cur[0]*24*60*60; $months = $cur[1]*($map[$cur[1]-1])*24*60*60; $years = $cur[2]*365*24*60*60; $result = (float)$days + $months + $years; return (float)$result; } $epoch = zeroday_time(); //62129203200 $date = zeroday_time('31/12/1969'); $diff = abs(floor(($date-$epoch)/365/24/60/60)); //Over 40 years!? echo "It has been $date (~{$diff}) years since December 31, 1969"; Surprised I got it right, calculates the offset in seconds based on January 1, 0000. Includes using doubles (+-1.79769e+308? signed, opposed to +-2147483647 in int). Screw limits, this (theoretically) will bug out when the sun explodes.
  15. You can use PHP with AJAX to update the time and keep track of it if need be. You can calculate the difference between the dates with the unix time stamp, as it is in seconds it'll be that much simpler in the long run. If you're wanting more specific examples, give us a specific code you're having trouble with.
  16. You should only use something new if it fits to your progmatic style and will be efficient to your code and its performance, You're wanting to use a database abstaction layer, when you can talk to your SQL database directly with it's own functions? If you're wanting to write a multi-dbm application then it would be in your best interest to use PDO, and its OO functionality, else it'd not.
  17. You're placing PHP delimiter tags within eachother. <?php if ($row["Money"] > '800') { echo "<a href='http://localhost/burned/buypistol.php?ID=" . $row["ID"] . "'> Buy </a>"; } else if ($row["Money"] < '800') { echo "You cannot afford this item"; } ?>
  18. Don't we have a TOS? And yes, It would be of their best interest to hand the usage rights to the current administration, I doubt they'd want to be blammed with possible copyright issues over some stupid code.
  19. I'm on Windows, You should be aware of how PHP handles whitespace.
  20. Your code relies upon session_register, a function that has been deprecated for over 9 years. The proper format is $_SESSION['key'] = 'value', this easy fix should rectify your problems. An old tutorial you followed? And where is $_SESSION['valid_user'] defined in the login code? If it's never defined, it will always redirect because the key simply doesn't exist.
  21. Why does using your OO code work for me after those changes? You can't expect to copy and paste things into a class and call it object oriented and it to work.
  22. PHP may be a tad more relenting, provided you explode the file based on spec.... Change \r\n to \n and you should get this: array ( 'COL1' => array ( 0 => 'val1g', 1 => 'val1f', 2 => 'val1e', 3 => 'val1d', 4 => 'val1c', 5 => 'val1b', 6 => 'val1a', 7 => NULL, ), 'COL2' => array ( 0 => 'val2g', 1 => 'val2f', 2 => 'val2e', 3 => 'val2d', 4 => 'val2c', 5 => 'val2b', 6 => 'val2a', 7 => NULL, ), 'COL3' => array ( 0 => 'val3g', 1 => 'val3f', 2 => 'val3e', 3 => 'val3d', 4 => 'val3c', 5 => 'val3b', 6 => 'val3a', 7 => NULL, ), 'COL4' => array ( 0 => 'val4g', 1 => 'val4f', 2 => 'val4e', 3 => 'val4d', 4 => 'val4c', 5 => 'val4b', 6 => 'val4a', 7 => NULL, ), 'COL5' => array ( 0 => 'val5g', 1 => 'val5f', 2 => 'val5e', 3 => 'val5d', 4 => 'val5c', 5 => 'val5b', 6 => 'val5a', 7 => NULL, ), )
  23. If the video is displaying the video name, it clearly is missing a .flv at the end.. ?
  24. Try using $Resort = utf8_encode($show_results['post_title']); I'm sure if it's proper in the PHPmyAdmin it should be able to be displayed properly.
×
×
  • 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.