Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. oops single quote <?php $stack = Array ( 1 => 'Accounting', 2 => 'Banqueting', 3 => 'Executive Office', 4 => 'Front Office', 5 => 'Housekeeping', 6 => 'Human Resources', 7 => 'Kitchen', 8 => 'Loss Prevention', 9 => 'Mini Bar', 10 => 'Repairs & Maintenance', 11 => 'Revenue', 12 => 'Room Service', 13 => 'Sales & Marketing' ); $SelectedID = 4; $select = '<select name="user_department" id="user_department" size="1">'."\n"; foreach($stack as $key => $value) { $Selected = ($key == $SelectedID)?"selected":""; $select .= "\t".'<option '.$Selected.' value="'.$key.'">' . $value.'</option>'."\n"; } $select .= '</select>'; echo $select; ?>
  2. print("test","test2"); will fail echo("test1","test2"); will work..
  3. someone said theirs a speed differents (depending on what your doing) but from what i know,, theirs none
  4. Oppp edited the one above.. updated
  5. cool i know that was probably a pain but it helps laters :-\ don't hate me
  6. wrong one If starts a block ie <?php if( $a == $b) { echo "hello "; echo "world" } ?> Quote this post to see the how to fix (or try to find it, as your intrested in learning bug finding is key) if ($_SESSION['view'] == 10); { to if ($_SESSION['view'] == 10) {
  7. Try this (slighlty more advanced) <?php $stack = Array ( 1 => 'Accounting', 2 => 'Banqueting', 3 => 'Executive Office', 4 => 'Front Office', 5 => 'Housekeeping', 6 => 'Human Resources', 7 => 'Kitchen', 8 => 'Loss Prevention', 9 => 'Mini Bar', 10 => 'Repairs & Maintenance', 11 => 'Revenue', 12 => 'Room Service', 13 => 'Sales & Marketing' ); $SelectedID = 4; $select = '<select name="user_department" id="user_department" size="1">'."\n"; foreach($stack as $key => $value) { $Selected = ($key == $SelectedID)?"selected":""; $select .= "\t".'<option $Selected value="'.$key.'">' . $value.'</option>'."\n"; } $select .= '</select>'; echo $select; ?>
  8. Oh LOL yeah ; ends a statement see IF you can find the problem try 10 attempts i think thats too many hints
  9. i knew that , thanks i feel like a noob now
  10. not really.. depends on the code!! re-design
  11. what about <?php $SelectedID = 4; $select = '<select name="user_department" id="user_department" size="1">'."\are\n"; echo '<option value="'.$SelectedID.'">' . $stack[$SelectedID].'</option>'."\are\n"; foreach($stack as $key => $value) { if($key != $SelectedID) { $select .= "\t".'<option value="'.$key.'">' . $value.'</option>'."\are\n"; } } $select .= '</select>'; ?>
  12. <?php session_start(); if ($_SESSION['view'] == 10); { unset($_SESSION['view']); } if ( isset($_SESSION['view']) ) //somthing is missing here { //Ahh thats better $_SESSION['view']++; //add's 1 else { $_SESSION['view'] = 1; } echo "Views: " .$_SESSION['view']. "<br> This will reset after 10 refreshes."; ?>
  13. thanks Daniel that gave me a kick my replie
  14. try this <?php $sql = "SELECT * FROM images WHERE page='$page' AND descriptions='header'"; $result = mysql_query($sql); while ($row = mysql_fetch_assoc ($result)) { $imageurl[] = $row['imagename'] . '.' . $row['type']; if($row['descriptions']!="header"){die("ERROR");} } ?> what happens
  15. can you post it in code tags please.. as you code is altered by the form.. PREVIOUS will only be a link on pages greater than 1
  16. nothing try this echo $var; as $var isn't set thiers nothing to echo, same when you unset.. it no longer exists (so isset will be false) but $var=""; will echo nothing but isset will be true as it exists but contains an empty string.. make sense ?
  17. Cool is that a new addition ? (unsolved that is) in anycase i am going to list my reasons. but also note i shouldn't have to justify them as its not in any agreement.. bunch of fools.. indeed anyone know how cron can be claessed as "a thing of the past" is their something new i have missed!
  18. and whats the "problem" PS you missed session_start();
  19. can you echo $sql and post the results please
  20. please use code tags and what appears as text not hyperlinks ?
  21. you really should use code tags and whats the problems i got confused what you was asking half way down
  22. i used unset first to make the isset fail thus setting it back to 1 hope that makes sense
  23. well mine uses the refeash.. :-\
  24. Oh Great Andy is in this thread.. Sighs.. i would like to point out this is not a my best work but its basic <?php session_start(); $wait = 30; //unset($_SESSION['time']); if( !isset($_SESSION['time']) ) { $_SESSION['time']=time(); echo "Started"; }else{ if(time() >= $_SESSION['time']+$wait) { echo "Done"; //include("hiddenpage.html"); }else{ echo $wait -(time() - $_SESSION['time']); echo "<meta http-equiv='refresh' content='0.5'>"; } } ?> waits for andy to create a great example in 0.2 seconds leaving mine in a bundle of smoke lol i know its not great ok...
  25. use number_format($save - $retail, 2, '.', ''); as number_format will round up
×
×
  • 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.