Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. My Test works fine Dump -- -- Table structure for table `Test` -- CREATE TABLE `test` ( `uID` mediumint( NOT NULL auto_increment, `Date` date NOT NULL, PRIMARY KEY (`uID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; My SQL statment INSERT INTO `Test`.`Test` ( `uID` , `Date` ) VALUES ( NULL , CURDATE( ) ); edit (tagged it) edit#2 try changing CURDATE( ) to NOW( )
  2. whats the field type of due_date ? if its date you need to reformat the date to the same at the $date a table structure dump will help
  3. Off subject: Humm so if he was 30 and a doctor and you was 90 would you go under his knife ? then again if he was 90 would you go under his knife ? Scary thought!
  4. you should use client_id='{$_POST['c_id']}' or "client_id='".$_POST['c_id']'."etc Noooooooooooooooooooooooo.
  5. Opps shouldn't have the quotes on CURDATE() try $sql = "INSERT INTO invoices SET client_id='{$_POST['c_id']}', service_name='{$_POST['s_name']}', total_price='{$_POST['t_price']}', current_date=CURDATE() , due_date='{$_POST['d_date']}' ";
  6. from my understanding, its not the loading thats the problem, its seams that the system is getting cloged at times, this could be, depending on the system design, it may be an idea to add some caching.. but you really need to find where the problem is, if you had a query doing a massive search on a common page then that would cause problems.. without more info its very hard to say, what the problem could be, i would refer to the logs
  7. try this a few fixes and changed $date to CURDATE() $sql = "INSERT INTO invoices SET client_id='{$_POST['c_id']}', service_name='{$_POST['s_name']}', total_price='{$_POST['t_price']}', current_date='CURDATE()' , due_date='{$_POST['d_date']}' "; if this is wrong can you post how your setting $date
  8. $fn = $aname; $fext = substr($aname, strrpos($aname, '.')); $jpg = ".jpg"; $jpeg = ".jpeg"; if ($fext == $jpg || $fext == $jpeg ) { // || = or print "foo"; } EDIT: lol : conker87 beat me
  9. could it be the server traiffic ? are you on a shared server, is it always at the same time (could be backups) check your not using mysql_pconnect, when unneeded. check the logs for images leachers etc
  10. welcome (can you click solved) (if its their)
  11. this will echo their details <?php foreach($data[$server_id]['players'] as $p) { echo $p['player']; echo "<br>"; echo $p['honor']; } ?> time for bed MasterACE14 lol EDIT: if you print_r($data[$server_id]['players']); you should get what the foreach does it set P to each player ie then you echo the item ie player = killer1killer hope that makes sense
  12. What you have looks okay, what makes you think its not closing ? as a note:~ Using mysql_close() isn't usually necessary, as non-persistent open links are automatically closed at the end of the script's execution.
  13. try this (its not mine but works well) <?php // $dir = the target directory // $DeleteMe = if true delete also $dir, if false leave it alone function SureRemoveDir($dir, $DeleteMe) { if(!$dh = @opendir($dir)) return; while (false !== ($obj = readdir($dh))) { if($obj=='.' || $obj=='..') continue; if (!@unlink($dir.'/'.$obj)) SureRemoveDir($dir.'/'.$obj, true); } closedir($dh); if ($DeleteMe){ @rmdir($dir); } } //SureRemoveDir('EmptyMe', false); //SureRemoveDir('RemoveMe', true); ?>
  14. Wrong Section, please post in the CSS/HTML section
  15. your need to show more than just the form, we will need the class set for $tNGs, also what do you mean by insert ? insert into a database ?
  16. your using addslashes while having magic quotes turned on try this example if (!get_magic_quotes_gpc()) { $lastname = addslashes($_POST['lastname']); } else { $lastname = $_POST['lastname']; }
  17. Their no was missing }, in my code use the /n should be fine for line breaks, you could try, the following (depends how the file was built) /r/n /n /r
  18. this isn't really a PHP problem, you maybe better off asking in the third party section.. personally i think this will be a real pain to do (i could be wrong), why not use it as it was intended, just update the header and footer on the forum. (admin section in the manual may help) i don't mean any of that in a rude way.
  19. Frames are client side, sessions are sever site.. they touch each other.. so i fail to see how a frame can mess up sessions... whats the problem? "don't work" doesn't help!
  20. i think this is what your looking for.. but just so you know <?php /* File example http://site1.com,http://site2.com,http://site3.com */ $file=file_get_contents("file.txt"); $sites = explode(",",$file); // change "," to "\n" for line delimitors $referrer = $_SERVER['HTTP_REFERER']; foreach($sites as $site) { if (preg_match("%$site%i",$referrer)) { // found header('Location: http://www.mysite1.com'); exit; } } //Not found header('Location: http://www.mysite.com'); exit; ?>
  21. $_POST['Necklaces'] will be an array, try this <?php $Necklaces = implode($_POST['Necklaces'], "<br>"); echo $Necklaces; //or print_r($_POST['Necklaces']); //or foreach($_POST['Necklaces'] as $Name) { echo $Name; } ?>
  22. The reason is because the header will fail if their any ouput before it, think of it this way, if you get an error (thats output) thus the header rediect will fail.. so the exit will stop the code, without the exit, the code would continue.
  23. oopps, i assumed ot_shipping was a field, try this, (using the value of ot_shipping) "select Title from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$oID . "' AND Class = 'ot_shipping'"
  24. unless i am missing something wouldn't it just be "select Title from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$oID . "' AND Class = ot_shipping"
  25. if you use $_SESSION[var] then var is treated as a constant, php look for the value of the constant and fails, so it decided to use the contant name instead.. which is 'var' where as $_SESSION['var'] uses var no questions asked example <?php session_start(); //test then comment/remove the line below define("VAR", "Hello world."); $_SESSION[VAR] = "Test1"; //sets $_SESSION["Hello world."] becuase the constant is set $_SESSION['VAR'] = "Test2"; echo $_SESSION[VAR]; echo $_SESSION['VAR']; ?>
×
×
  • 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.