Jump to content

samshel

Members
  • Posts

    837
  • Joined

  • Last visited

Everything posted by samshel

  1. Hello, Check your "register_globals" variable in php.ini. i think it was ON initially and upgradation it is OFF so. $a = $DOCUMENT_ROOT; will not work, you will have to use $a = $_SERVER['DOCUMENT_ROOT']; or turn "register_globals" ON, (this is high risk, avoid this) PS: i m not sure whether this exactly is the problem or not. hth
  2. hello, you can use: [code] if($x > $y) { echo "<script type=\"text/javascript\">window.open('newwindow.php?var=".$something."&var1=".$somethingelse."');</script>"; } [/code] something like this. hth
  3. Hello, First try the header function. if it does not work then i think another alternative is using javascript to redirect: [code] <?php $time_now = time(); $allowed_time = $time_now-30000; if($is_locked>$allowed_time) {    echo "<script language=javascript>document.location.href='locked.php';</script>";    exit; } else {     echo ("Editing is allowed");//Editing form is in html/php mix below this } ?> [/code]
  4. Hello, as i said, [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] out of which i think you need not check for arr ( x-1, y-1 ) and arr ( x+1, y-1 ) as while navigating if you start from x=0,y=0 these 2 elements would have been already checked. so u need to check only the remaining 2 elements. if any of these 2 is same as the arr( x , y ) then you have ur diagonals [/quote] u need not check arr ( x-1, y-1 ) and arr ( x+1, y-1 ) , so u will not check repeatedly....:) ...give it a shot, i think it should work. hth
  5. [code] <?php $queryF = "SELECT * FROM Products"; $result=mysql_query($queryF) or die (mysql_error() . "\nActual query: " . $query); $num=mysql_numrows($result); $main = ""; $i=0; while ($i < $num) { $ProductName=mysql_result($result,$i,"ProductName"); $main .= $ProductName." "; $i++; } echo "<MARQUEE BEHAVIOUR=SCROLL>$main</MARQUEE>"; ?> [/code] hth
  6. Hello, I am not sore if this will work, but no harm in trying.... select SEC_TO_TIME(sum(TIME_TO_SEC (TotalBlockTime) )) as total_time from table_name let me know if it works.
  7. Hello, Try this, [code] <?php $filenames = array ("abc1.txt","abc2.jpg","abc3.png","abc4.txt");//this is the array which contains ur filenames $extension_arr = array(); foreach($filenames as $key=>$val) {     $arr = explode(".",$val);     $extension = $arr[1];     $extension_arr[$extension][] = $val; } $extensions = array_keys($extension_arr));//this array will contain all the extensions without duplicates //array $extension_arr will contain extension wise filenames which can be used to display files belonging to a particular extension. ?> [/code] hth
  8. Hello, I am not sure if i understand it correctly. still no harm in trying.... to check for any diagonal elements, you will have to navigate thru each element of the array and check diagonal elements for each. example : suppose the current array element u r checking is arr( x , y ) the possible digonal elements are arr ( x-1, y-1 ) arr ( x+1, y-1 ) arr ( x-1, y+1 ) arr ( x+1, y+1 ) out of which i think you need not check for arr ( x-1, y-1 ) and arr ( x+1, y-1 ) as while navigating if you start from x=0,y=0 these 2 elements would have been already checked. so u need to check only the remaining 2 elements. if any of these 2 is same as the arr( x , y ) then you have ur diagonals hth sorry if i confused u more :) was just trying to help :)
  9. [code] function filter_elements($var) {      $to_check_strings_array = array("if","and","is","was","or","then");      if(!in_array(trim($var),$to_check_strings_array)) {          return($var);      } } $explode = explode(" ", $search); $explode = array_filter($explode,"filter_elements"); [/code] I have not tested this code....but something like this should work.
  10. [!--quoteo(post=368767:date=Apr 26 2006, 03:58 AM:name=takeiteasy)--][div class=\'quotetop\']QUOTE(takeiteasy @ Apr 26 2006, 03:58 AM) [snapback]368767[/snapback][/div][div class=\'quotemain\'][!--quotec--] I have this problem here, i want to generate outstanding balance in my codes. i have 2 attributes, quotes and amtPaid in mysql table. my outstanding balance = quotes - amtPaid so do i need to declare a new attribute in the MySQL table? do MySQl have Subtraction aggregate functions? Thanks In Advance! [/quote] Try this out "select (quotes-amtPaid) as outstanding_balance from table_name" hth
  11. Hello, As far as i understand u r trying to use the same variable [main] in title as well as body, but in title u want to show text without HTML. I would advice u to use two diffenet variables In TPL, <title>[maintitle]</title> . . . <body>[main]</body> In PHP, $maintitle = strip_tags($title); assign both title and maintitle in template hth
×
×
  • 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.