Jump to content

taith

Members
  • Posts

    1,514
  • Joined

  • Last visited

Everything posted by taith

  1. true enough :-) just saying... mysql date()like functions are great at what they do... but if you want absolute specifics... timestamp's are the way to go... for sorting/organizing data withing mysql... use mysql functions... for output, timestamp's with php's date() are much easier...
  2. cheers... that function is great! always use it over header();
  3. i agree... they are quite simple... not always the best for sorting... but they work nicely for output...
  4. then move the redirect("url") wherever you want it...
  5. if(isset($money)){ $sql = mysql_query("SELECT * FROM contactinfo LIMIT $from, $max_results"); while($row = mysql_fetch_array($sql)){ if(isset($row['fname'])){ mysql_query("INSERT INTO dispo_Money (Name, Phone, Email, Position, State, Comments) VALUES ('$row[fname] $row[lname]','$row[areacode]$row[prefix]$row[linenumber]','$row[email]','$row[position]','$row[state]','$comments')"); // mysql_query("DELETE FROM contactinfo WHERE email='$row[email]'"); redirect("http://www.xxxxxx.php"); } } } function redirect($filename="?", $delay="0", $die="0"){ if((!headers_sent())&&($delay=="0")) header("Location:$filename"); elseif($delay=="0"){ echo '<script type="text/javascript">'; echo 'window.location.href="'.$filename.'";'; echo '</script>'; echo '<noscript>'; echo '<meta http-equiv="refresh" content="0;url='.$filename.'" />'; echo '<noscript>'; }else echo '<meta http-equiv="refresh" content="'.$delay.';url='.$filename.'" />'; } ?>
  6. scratch header()... too problimatic... use this... <? function redirect($filename="?", $delay="0", $die="0"){ if((!headers_sent())&&($delay=="0")) header('Location: '.$filename); elseif($delay=="0"){ echo '<script type="text/javascript">'; echo 'window.location.href="'.$filename.'";'; echo '</script>'; echo '<noscript>'; echo '<meta http-equiv="refresh" content="0;url='.$filename.'" />'; echo '<noscript>'; }else echo '<meta http-equiv="refresh" content="'.$delay.';url='.$filename.'" />'; if($die=="0"){ db_disconnect(); exit; } } ?>
  7. that should suffice... <? function switch_month($m){ while($m{0}=="0") $m=substr($m,1); $m=strtolower($m); switch($m){ case "1": return "january"; break; case "2": return "february"; break; case "3": return "march"; break; case "4": return "april"; break; case "5": return "may"; break; case "6": return "june"; break; case "7": return "july"; break; case "8": return "august"; break; case "9": return "september"; break; case "10": return "october"; break; case "11": return "november"; break; case "12": return "december"; break; case "january": return "01"; break; case "february": return "02"; break; case "march": return "03"; break; case "april": return "04"; break; case "may": return "05"; break; case "june": return "06"; break; case "july": return "07"; break; case "august": return "08"; break; case "september": return "09"; break; case "october": return "10"; break; case "november": return "11"; break; case "december": return "12"; break; } } echo '<select>'; for($i=date(m);$i<=date(m)-3;$i--){ echo '<option>'.switch_month($i).'<option>'; } echo '</select>'; ?>
  8. html pages "cannot" process php... but you can have html tags, within php files... for example... <? $test='test'; ?> <span><?=$test?></span>
  9. for date output... just put a timestamp, time(), into your database... for daytoday sorting... i find the best as date(Y).date(z) #outputs 2007195 or whatnot...
  10. ->'s is for classes (most pointless idea in my mind... only useful for MASSIVE games, in which a spawner/AI is used)
  11. action="" is where you want the form to submit to... beit index.php?op=submit, or any where else...
  12. <a href="javascript:document.formname.submit();"><img src=""></a>
  13. if your session var is "$_SESSION["user_id"]", also check for $user_id... if your globals are registering, those two will interfere
  14. just as a note... javascript logins are completly unsecured... anybody can simply reverse engineer "any" encryption... php is great for that... as the only way you can get to passwords is to have access to the mysql database...
  15. no prob... its just that it registers both numbers and names... while() is programmed to work properly, foreach() isnt :-)
  16. the mysql_get_array(); function returns both the associtive names and numbers... when you use it as a while($row=mysql_fetch_array()) it works fine, it only does the associtive row names, else, you have to change your function to mysql_fetch_assoc();
  17. its not at the top of your page... in about.php on line 17, something has already been output to the browser...put session_start(); on the very top of EVERY page
  18. do yourself a HUGE favor... a) switch from if()'s to switch()... b) then you use break 2;... so it finds the best solution, then skips out of your for()
  19. just as an idea... <? $query=mysql_query("SELECT * FROM `accounts`"); while($row=mysql_fetch_assoc($query)){ $arr[]=$row; } echo '<table>'; $k=0; for($i=0; $i<=count($arr)/3; $i++){ if($k==0) echo '<tr>'; echo '<td>'; print_r($arr[$i]); echo '</td>'; echo '<td>'; print_r($arr[$i+3]); echo '</td>'; echo '<td>'; print_r($arr[$i+6]); echo '</td>'; $k++; echo '</tr>'; } echo '</table>'; ?> math's prolly off tho...
  20. if you have a url... with ?op=asdf and print_r($_GET); it'll show you its an array... same with $_POST... submit data... and print_r($_POST); all arrays are accessed through $var[] <-- []'s
  21. not trying to be too hard on him... just letting him know how it is... if you are wanting to learn php, www.tizag.com and the php.net function database is a good place to start... if you want someone to make it for you, post in the freelancing forum
  22. did you start your sessions? at the top of every file... put "session_start()"
×
×
  • 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.