Jump to content


  • Posts

  • Joined

  • Last visited

About jhecht

  • Birthday 05/10/1990

Previous Fields

  • Languages
    PHP, Javascript, CSS, HTML, Flash(so-so), Java(bit),C++(ok),XML,XSL(T)

Contact Methods

  • AIM
  • MSN
  • ICQ
  • Yahoo

Profile Information

  • Location

jhecht's Achievements

Invested Member

Invested Member (3/7)



  1. Hey everybody, been a long time. I come bearing a question. I'm working on a website for a couple of buddies, and I'm trying to add some ambiguity in the AJAX calls by using Mod_Rewrite. RewriteEngine onRewriteRule ^([A-Z][A-Za-z]+)\\?(.*)?$ /modules.php?mod=$1&$2 At first I thought there was an error in my Regular Expression, so I decided to test it out in Javascript. Say I am trying to request /Data?user_id=1 The Javascript version returns exactly what it should, [Data,user_id=1], but the page redirects to /modules.php?mod=Data. There isn't even the ampersand, anyone have any ideas about why this isn't working? By the way, it works just fine for/DataRedirecting to /modules.php?mod=Data
  2. So as of late I've been attempting to get a calendar up and going in order to help out a club at the college I go to. I can get the calendar to be displayed, but the issue comes in at the type of database structure to be used. This was my first thought on creating the database structure: event_id INT UNIQUE NOT NULL AUTO_INCREMENT,event_title varchar(255) not null,event_start bigint not null,event_end bigint not null,event_all_day tinyint not null default 0,event_repeat_increment bigint not null My only problem with this method comes in on how I am supposed to determine if a timestamp of an entry is related to the timestamp we are working with.For example, assume we made a 5 hour long event that repeats every two weeks on the exact Unix Epoch. the event_start would be 0, event_end would be 18000(60*60*5), and the event_repeat_increment would be 1209600(60*60*24*7*2, where 2 is the number of weeks).Let's say we are 2 weeks later. i know the formula to calculate the start time of the event is new_start_time = [original start time] +x(repeat_increment). x can only be whole number iterations, so things like 1,2,3,4,5,6,etc. if you solve for x that gives you (new_start_time-original_start_time)/repeat_increment = x. None of this, however, gives me an answer as to how to pull results in a repeating fashion.I'm seriously lost, and if anyone could offer me any outside insight on this, I'd greatly appreciate it.Thanks,-Jhecht
  3. They are probably using display:none and display:; (no value allows it to pick up default inheritance.
  4. jhecht

    Postable Calender

    by following that guide, it gives you a pretty much done n done calendar script. your job would be to thusly alter it to include hours/minuntes in the db, check the dates, and make sure that they dont conflict with one another.
  5. jhecht

    Postable Calender

    the hardest part about calendars is getting the offset correct in the tables. I saw a method used in a tutorial... the link ishttp://www.evolt.org/quick_calendar_using_ajax_and_phpFrom what i can give you the logic goes like this:get the current month, day, year.figure out what day of the week the first isfigure out how many days are in the current monthdivide days by seven, rounding up to count the weeks.loop through the weeks loop from 0-6 (1-7 respectively) for each day. subtract the current number from the day that first day is, any days not in the current month will be <=0, so you don't display those, only empty spaces. The database interaction in the tutorial i gave you i dont much like. I'd preffer timestamps and an increment value column, but you can choose whatever you like. obviously you'd need to add an hour/minute column if you'd like to stick with the syntax shown previously in the tutorial since this is an appointment kind of thing. Best of luck
  6. by adding an onclick event to the arrow's parent element (prefferably having it wrapped in a span tag), then setting a variable in that element to true/false for whether or not it should be clicked. Something along these lines: function toggle(el,toggle){ el = document.getElementById(el||el.id); toggle = document.getElementById(toggle||toggle.id); if(toggle.state==null || toggle.state==undefined) toggle.state='down'; if(toggle.state=='down'){ toggle.style.display='none'; toggle.state='up'; toggle.innerHTML="uparrow"; }else{ toggle.state='down'; toggle.style.display=''; toggle.innerHTML='downarrow'; } } It would be used like so: <span id="element" onclick="toggle(this.id,'toggle')">Down Arrow</span> Offline <div id="toggle"> billy bobby that one guy </div> Notice that the id 'toggle' is in quotes, and matches the ID of the div where the users are stored
  7. $_GET = good;$HTTP_VARS_GET = bad$HTTP_VARS_GET is from older installations of PHP. use $_GET n $_POST instead.
  8. It's entirely possible that I'm wrong, but from what i can gather it sounds like ur doing an AJAX request and you want to use it in the syncronis mode. If thats true, then all you have to do is this: var req = new XMLHttpRequest();//Screw IE;preq.open('yourPage.html','GET',false);// The arguments are page, method, async. Async can be true or false, if false, it loads syncronisly(sp?) and your code will be processed //in the usual line-by-line manner. If you're doing something else, then It's as Deidre's Dad said, there's really no sleep function that I am aware of in JS.
  9. think it might be called parseFloat in regular javascript. Not sure if its an object property or a global function though
  10. or the toFloat function i believe its called.
  11. jhecht

    If Statements

    You can't have the HTML outputted before a redirect You can try to use ob_start(), but i don't know if it'll work like that. You should download a template class to keep your PHP and HTML separate.
  12. jhecht

    If Statements

    $id = (isset($_GET['id'])) ? $_GET['id'] : false;//on some servers if id isn't in the query string, you'll get a "warning:undefind index," which gets really annoying.if(!is_numeric($id) || $id < mysql_num_rows($result) || $id < 1) header('location:notfound.php');I use is_numeric because i tried is_int awhile back numbers that were integers (1,2,3,4 etc) and everytime it would say that they weren't integers, however, is_numeric does it correctly. Maybe it'll be different for you, but i use is_numeric from past experiences. maybe it was a bug fix, I haven't tried it as of PHP5.
  13. Well then you could simply insert those ranks into the db, and if you learn enough about SQL you can realize that you can give more than one rank/title through the db set up i gave you.
  14. jhecht

    Apache and MySql

    is MySQL running on the system? That may be a good thing to look at.
  15. Well in MySQL the entire goal is to get rid of repetative natures in your database. What if you want to be able to more than 2 ranks(illogical, as i dont think you'd ever need more than 2 ranks, but you never know), or why have to check 2 position id's? That's not necessary.My structure, from what I can see of your table, would be CREATE TABLE sms_crew( crew_id int unique not null auto_increment, crew_firstname varchar(40) not null, crew_lastname varchar(50) not null, crew_rank_id int not null, crew_position_id int not null crew_active tinyint not null default 1);CREATE TABLE ranks( rank_id int unique not null auto_increment, rank_title varchar(50) not null);CREATE TABLE positions( position_id int unqiue not null auto_increment, position_name varchar(50) not null);INSERT INTO ranks(rank_title) VALUES ('Non-Comissioned'),('Junior'),('Senior'),('Flag');/* non-comissioned will have an ID of 1, junior officers will have an ID of 2, senior officers will have an ID of 3, Flag officers will have an ID of 4*///I don't know what the positions are for, since all the positions just reference 30 as a value...//I'm a junior officer, so i'll use a rankd_id of 2, and a flag officer with rank of 4INSERT INTO sms_crew(crew_firstname,crew_lastname,crew_rank_id,crew_position_id,crew_active) VALUES ('Jhecht','Falcon',2,(insert what the position id is supposed to be),1),('Jhecht','Falcon',4,(insert position id),1)//The crew_active column is either supposed to be 1 for active, or 0 for inactive. I'll leave you to figure out the SELECT DISTINCT count() syntax. If you don't like the DB i made, then you can just leave it alone.
  • Create New...