Jump to content

samshel

Members
  • Posts

    837
  • Joined

  • Last visited

Everything posted by samshel

  1. <a href=\"car_upgrades.php?act=install2&id=".$_GET['id']."&carid=" . $getcars1['carid'] . "\">" . $getcars1['car_name'] . "</a> r u passing id to install2 url like above?
  2. you require the user to select a car manually so u will require install2. you can pass the install id from first page by query string similarly as u r passing the car id
  3. i think it has nothing to do with filename.. it checks the relative path when it tries to include the file. example: index.php members/members.php includes/config.inc.php in index.php you can.. include("members/members.php"); include("includes/config.inc.php"); as from the DIR where index.php is, it can access the two folders and files inside them.. to include config.inc.php from members.php include("../includes/config.inc.php"); as members.php is inside members folder, it will have to look up the includes folder one level up (and hence ../) from where it is located.
  4. or you can try... <?php $timestamp = mktime( 0, 0, 0, $cMonth, 1, $cYear ); $maxday = date( "t", $timestamp ); $thismonth = getdate( $timestamp ); $startday = $thismonth['wday']; for( $i=0; $i < ( $maxday+$startday ); $i++ ) { if( ( $i % 7 ) == 0 ) { echo "<tr>\n"; } if( $i < $startday ) { echo "<td></td>\n";} else { if(date("N", strtotime($cYear."-".$thismonth."-".($i - $startday + 1))) == 7) { echo ($cYear."-".$thismonth."-".($i - $startday + 1)). " is Sunday !! Hurray !!"; } else { echo ($cYear."-".$thismonth."-".($i - $startday + 1)). " is a WeekDay and my boss just called !!"; } echo "<td align='center' valign='middle' height='20px;'>". ( $i - $startday + 1 ) . "</td>\n"; } if( ( $i % 7 ) == 6 ) { echo "</tr>\n"; } } ?>
  5. try sending a simple mail..if it works , problem is with code, else it is with mail setup mail("[email protected]", "test", "test", 'From: TEST <[email protected]>'); and yes check ur spam mail folder too
  6. try require_once '../constants/constants.php';
  7. u can check if it is sent..the mail() function returns it, but it does not tell u whether it reached the destination properly or not. u have to configure something like smtp to actually send mail. PHP mail() function uses it, it itself is not a mail engine.
  8. try to echo something simple.. if ($account_id > '0') { echo "Test....."; } then if ur echo content is static try keeping it as HTML <?php if ($account_id > '0') { ?> <li class='last'><a href='index.php?step=login'>Account</a></li> <?php } ?>
  9. r u planning to spam?
  10. Correct ! i thought thats what he is looking for.
  11. its with regard to the situation..if the number of things are increasing and after some time you have say 100 items to check, then it is easier to define an array instead of writing 100 conditions with OR ofcourse this is my thought.
  12. not sure..try this. echo "<link href='/library/" .$color. "config.css' rel='stylesheet' type='text/css'>
  13. if there is a single DB interface for all queries, then u can easily print queries which are fired. else i m not sure if there is any software which does DB monitoring like this , atleast i m not aware. i will keep monitoring this post to see if anybody comes up with a name i will be interested.
  14. i think this will not work... try this.. $var = 1; if($var == 1 OR $var == 2 OR $var == 3 OR $var == 4){ // do it } OR better <?php $var = 1; $arr = array(1,2,3,4); if(in_array($var,$arr)){ echo "Sucess"; } ?>
  15. you have to print all those statements before you call return..else they wont be executed.
  16. or this $cnt = count($matches); for ($row = 0; $row < $cnt ; $row++) { echo "<li>".$matches[$row][1]."</li>"; }
  17. where ur populating all ur variables try doing this.. $info_id = ((trim($info['id']) != "") ? $info['id'] : " "); this code checks if the variable fetched from DB row has a value else assigns space to that variable. you can replace space with any char u like.. do it for all variables
  18. if you would have posted teh code, you would have got what u want in 1 reply
  19. You are right ! Sorry about that ! The difference was in our approaches. you are finding out DB DATES which ARE conflicting, whereas I was trying to check if INPUT DATES are conflicting. but i agree that ur approach is better
  20. 3) Optimize Cron queries, sometimes denormalizing database helps to gain performance. you may wish to distribute the operations between cron and end of game. Like instead of doing complete operation of rating, just do some calculations and store in fields in DB, Cron will refer to these fields and complete the operation. 4) If the system is already database/code optimized (indexes, less queries, de normalized) then you can go for MySQL replication.
  21. 1) Get a new hardware for running the crons seperately 2) Update scores/ratings at the end of game itself.
  22. You are correct, but I'm not going to always add ALL the details not specific to the solution. For example, youwould also want to use mysql_real_escape_string() on the POST values as well. I leave it up to the OP to implement all the other necessities. please correct me if i am wrong, but this will cover only if the new period is completely within the old period and not the overlap(if start a new period is within old, but end is out of it, this should also be not allowed) i think this will work.. $query = "SELECT * FROM reservations WHERE ( ($new_start_date >= 'start_date' AND $new_start_date <= 'end_date') OR ($new_end_date >= 'start_date' AND $new_end_date <= 'end_date') ";
  23. <?php $arrDays = array(); while() { //populate days $arrDays[] = $something; } $sql = "SELECT * FROM table WHERE MONTH(reg_date) ='".$m."' AND DAY(reg_date) IN ('".implode("','", $arrDays).'"); ?>
  24. <?php $month_list = array(); for( $i=1;$i<13;$i++) { $month_list[$i] = date("F", mktime(0, 0, 0, $i, 1, 2008)); } print_r($month_list); $newmonthlist = $month_list; foreach($newmonthlist as $monthnumber=>$month) { if( $monthnumber < date("n")) { unset($newmonthlist[$monthnumber]); $newmonthlist[$monthnumber] = $month." ".(date("Y")+1); } else { $newmonthlist[$monthnumber] = $month." ".date("Y"); } } echo "<br>"; print_r( $newmonthlist); ?>
  25. posting actual code will help. its difficult to understand ( for me atleast ) with this example.
×
×
  • 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.