Jump to content

TRI0N

Members
  • Posts

    215
  • Joined

  • Last visited

Everything posted by TRI0N

  1. Okay lets say I have these 2 time values. time1 = 15:00:00 and time2 = 16:15:00 Now how would I go about getting the difference between the 2 so that I have a value of lets say 1.25 using the formula idea below: var time_diff = time2 - time1; Never worked with time differences in java yet so smack it to me.
  2. OMG! I can't believe I overlooked that. I was down to thinking it just had something to do with a limit on creating static text with dynamic form input. Thanks for point that out.. OMG.. (crawls under a rock to die)
  3. Well yes that will work but not what I need. alert('Date is: '+ step3.d_month.value ) ; //WORKS alert('Date is: '+ step3.d_month.value +' Month') ; //WORKS alert('Date is: '+ step3.d_month.value +'/'+ setp3.d_day.value +'/'+ step3.d_year.value) ; //DOES NOT WORK It should create an Alert that says: Date is: 05/22/2007
  4. Well knowing how to do this will be nice to know even for other aspects of things I will need to accomplish. alert('Date is: '+ step3.d_month.value +'/'+ setp3.d_day.value +'/'+ step3.d_year.value) ; Okay now why does this not work?
  5. Use something like the following: if (theForm.mark.value == 0 || theForm.mark.value == 100) { alert("Mark must be greater then 0 and less then 100."); theForm.mark.focus(); return(false); }
  6. Well I put that in and I get the following in order: step1 refers to a: [object] step1.sand_1 refers to a: [object] step1.sand_1.checked is: undefined step1.sand_1.value is: undefined I get those results even if I have sand_1 checked or unchecked. Should be saying the value is 5 when checked on the 5th object. The value is there once it passes thru to step 2 using: <?php $sand_1 = $_REQUEST["sand_1"]; echo $sand_1 ; ?> So I know the value is pass thru but the validation of the radio button is not returning results.
  7. Well I know the properties exist since I built the order form before adding in the validation script and know that if you don't select those options they will be null and if you selct one of the options it will be the number that its value is represented. But perhaps I'm being a bit too picky about having the first step with no default value. Using step1.sand_1.value == "" does not seem to catch it as NULL either and will proceed to step 2 if nothing is checked. Radio Buttons are still a pain in the butt compared to check boxes but simplify all the base scripting of writing either a inline java script that will uncheck one option if another option is selected in a series or using check boxes using the same idea. Was hoping there was a cure for the Radio Button problem with no default select button checked. I'll check back here but will begin to toy with other options on the matter. Thanks for your comments akitchin...
  8. Either everyone is out of town or my script is so far off that it kinda makes people fall off their chairs laughing.. J/K Seriously though. Trying to find the cure for checking if a Radio Button is selected onr not.
  9. No I was refering to more of what is passed thru using the Input Hidden. Bacause you can always view source of a setp to obtain the field names to possible get the values. I want to avoid that since the php code is not passive and will not give them the pleasure of seeing what is being passed thru.
  10. Okay trying to validate these 2 sets of buttons that each have 10 options that range from 1-10, sand_1 and sand_2 in a form with the id and name of "step1". <SCRIPT language="JavaScript"><!-- //script hider function form_validator(step1) { if(step1.sand_1.checked == false) { alert("<?php echo $txt_missing_sand_1 ; ?>"); step1.sand_1.focus(); return(false); } if(step1.sand_2.checked == false) { alert("<?php echo $txt_missing_sand_2 ; ?>"); step1.sand_2.focus(); return(false); } return (true); } // end script hiding --></SCRIPT> Something is not right...
  11. Is date in the database set for a Date Format? If so the date format for MySQL is Y-m-d (2007-05-19). Inserting anything that is not in that format will be messed up. Now if your Date row is varchar then you shouldn't have a problem using the format you have now. But if it is set for DATE you will have problems.
  12. Still catching up on more secure ways to do things via PHP 5 and want to start implimenting them into structures I have created in the past on older PHP systems for clients as I begin to upgrade them to PHP 5. Most important is the POST method using Input fields or hidden Input to pass thru to another step or portion of a website that forms use. My question would be is there now a safer way to post data using PHP when a form is submitted or is there atleast a way to pass thru that data without use of Input Hidden using PHP for multi stepped forms? Example would be lets say: Step 1: Asks for the users credit information Step 2: Asks for Personal Information and also continues to pass thru Credit Information Step 3: Custimize Options /collects information that is passed thru. Now I would not use this structure myself but as an example as to what I mean by not having the data be pass thru with Input Hidden in Step 2. I wouldn't ask for Credit Info until the last step before being processed but there are other senstive data in steps that I would rather not be passed thru via Input Hidden. Any suggestions would be great since I have a few ideas but want all aspects of possible solutions presented before I start making a new standard in scripting such.
  13. Well except don't put the mysql_close(); into the Loop.. Duh.. Just noticed that I did that.
  14. Okay here is the deal. Fist if somone selects ALL from the Recpient field of a memo form it will extract all the people in the employees database. $recpient = $_REQUEST['recpient'] ; $subject = $_REQUEST['subject'] ; $body = $_REQUEST['body'] ; $ip_record = $REMOTE_ADDR ; $from = $firstname." ".$lastname ; if ($recpient == 'ALL') { $result3 = mysql_query("SELECT distinct * FROM employees") ; while($row = mysql_fetch_row($result3)) { $recpient = $row[0] ; mysql_query("INSERT INTO memos VALUES('NULL','$date3','$time','$recpient','$from','$subject','$body','0','$ip_record')") OR die(mysql_error()); // Close Database Connection mysql_close(); } } Does this code look correct?
  15. This is a stored date in an existing database. Its in the Y-m-d format. Now since I'm pulling out more then just the date using a query but don't want to do a whole new query just for date. In terms will this work? $d_date = $row[21] ; $date = explode('-', $d_date) ; $date_y = $date[0] ; $date_m = $date[1] ; $date_d = $date[2] ; $disp_date = $date_m."/".$date_d."/".$date_y ; I would think this would work...
  16. I'm having a serious brain fart here. Use to know how to do this with explode. MySQL Date Field in format of "Y-m-d" and want to convert that to "m-d-Y" for display in a php page. Something like explode("-",$d_date) or something like that.. Or it had %'s in it to seperate each portion in 3 parts. I'm pulling my hair out trying to remember how it's done. Best regards, TRI0N
  17. Got question here about time out settings. @fsockopen ("IP", PORT, $errno, $errstr, .2) Is the .2 a timeout length? If so what are the limits on the value? ex: .1 - .9 Best regards, TRI0N
  18. Thank you so much for you help on this.. All is working Great!
  19. Okay lets see.. Now let me use a little bit of my code to make sure this is going to work: $month = date('m') ; $sql = "SELECT * FROM orders WHERE MONTH(d_date) = $month" ; The above orders is the database name and d_date is the row that the Due Date is stored. So if this correct it should work based on what was given above for an answer. Correct me if I'm wrong. The 7 day idea looks like it is only pulling the data out base on that week period rather then next 7 days. This is acceptable but is there a way to pick just the next 7 days?
  20. Okay I'm working with MySQL standard date format Y-m-d (2007-5-14). Now what I would like to do is the following with PHP. Extract only this weeks records (7 days): Extract only this months records: (All Records for the month of May 2007): Any help on making this work would be great. I tried searching the forums for "Query Date by Month" and got too much information that didn't even have what I was looking for. Best regards, TRI0N
  21. Yes I know about sessions and such usint PHP with MySQL to store that type of thing.. However this is a Intranet Based backend where Internet will not be used and those that will be using it are Managers of the corporation that who will be approving things and. The idea to track who changed a record would be more a need for me as admin not for the managers since I will be using such as a trouble shooting need. But if I cannot obtain the usernames from using a simple Dir Protection and grabbing the name used rather then writing a whole session routine that really isn't need.. However it seems that that will be my only choice at this point.. Thanks. TRI0N
  22. How are you logging these users in? Or is that your actual question? They will be logging in via the Password Protect Features of HTTP using htpasswd and htaccess under SSL. So once a user logs in I want to know who that user is. Example. John Doe logs in and is in the admin area.. He adds a record to an existing database. I want to know that John Doe was the one that added the addition to the database. Now I could use session logins but would like to use this approach. Would like to know the user name of the person that logged in. So in a easy example to give me would be how would I make it see the user and on the page beyond the login pop-up say "Greetings John Doe!". How do I find out what the username that was given to make that happen?
  23. Here is what I want to do. I have a password protected directory that has several users logins. Now what I want is to be able to detect what user is logged in with lets just say a simple "Hello <?php echo $username ; ?>!" though that is not the real purpose of my need since it's more on the need for tracking was users do. But the above example will answer all that I need to do to create. Also is it possible to create a user control panel that will allow them to change your passwrod once logged in? Thanks for any help on getting this into a working idea. Cheers! TRI0N
  24. Okay need to keep a array from being seen but needs to be pharsed so that it is included from within another php. <? php include "/dir/hidden.php?array1=Tadaa" ; ?> What happens is the include thinks the whole file name to include in everything that is inside the quotes and the array's are not pharsed and do not work. How would I go about making this work using the above example?
  25. Okay that was easy.. Pfft.. God can't even believe I didn't even see the dumb id code being built for it. It would never be the same ID.. Anyways on to a more problematic need for a fix. Now lets say the window is open and I click another link that uses that window to Focus on it since it is either minimized or not in view. Current Code: <!-- Begin function popUp(URL) { window.open(URL,"Window1", 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=520,height=400'); } // End --> Update: A simple: <body onload="self.focus();"> For the pages that are to load in the window does the trick.
×
×
  • 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.