Jump to content
  • Advertisement

Brainx7

Member
  • Content Count

    58
  • Joined

  • Last visited

Community Reputation

144 Neutral

About Brainx7

  • Rank
    Member
  1.  I'm working on a college assignment, attached are the instructions, I don't want anyone to write code for me or anything like that, I just want to know how would you doing, what coding techniques would you use. This is what I have so far http://pastebin.com/cr1akF40 if you can give me some sugestions on how you would build up on what I have, that would also be great. Thanks   The part in the instructions about writing in assembly is optional, so I'm not planning on doing that
  2. SQL = "INSERT INTO zdCathCleaningStatus (SS_Event_Cath_ID)" _ & " SELECT Event_Cath.SS_Event_Cath_ID" _ & " FROM zdCathCleaningStatus RIGHT JOIN Event_Cath ON zdCathCleaningStatus.SS_Event_Cath_ID = Event_Cath.SS_Event_Cath_ID" _ & " WHERE zdCathCleaningStatus.SS_Event_Cath_ID Is Null" _
  3. Brainx7

    SQL, Ms Acess Question

    That's exactly what it is, I don't have the code with me right now, but in the select statement, that third variable is after an AND, but I still don't understand why it does not work with Null or empty string, I'm a noob with SQL/programming in general, so I apologize if I'm being dumb or something
  4. I have a function written in vb  that passes 3 arguments, these three arguments, are being used in a SELECT statement within the function   In Ms access I have a query that calls this vb function, but for some reason, instead of passing 3 arguments I want to pass 2 of the arguments, for the third argument if I try passing an empty string or null I get an error, saying that I'm missing arguments, so instead I passed a number like 1 or negative 1(any positive or negative number works) and the query runs correctly, but I don't know why is this? can somebody tell me please?
  5. I have an interview for this position http://washingtondc.craigslist.org/mld/sof/4833700652.html and i'm fairly entry level
  6. so I have a form written using coldfusion, when the user clicks submit I display the information in your typical confirmation page, display all the information. so something like this:   page 1: <cfFORM style="margin-left:100px;" name="myForm" action="page2.cfm" id="myform" method="post" > <input type="text" name = "whatever">  <input type="submit" value="Preview " > </cfform> page 2: <cfoutput> your name is #form.whatever# </cfoutput> So my question is, from page 2, how could I display those variables yet in another page, say page 3. The only way I can think of is passing the variables through the URL, just like in php you use the get method, do the same here but, is there another way
  7. so I know by using these headers at the top <cfcontent type="application/msword; cht=utf-8"> <cfheader name="Content-Type" value="application/msword"> <cfheader name="Content-Disposition" value="attachment; filename=Staff-List.doc"> the site opens in a word document, but I want to have the site open normally and then if I click a button, for example "donwload as word" then it downloads, but I can't find anywhere the syntax to do even something similar, how could I do it?
  8. I tried with 2 seconds to test it, and the cookies stays, as if it wouldn't make difference. I think I can change it on this part of the code too sExpires = vEnd === ""? "; expires=": "; max-age=" + vEnd; I think I would have to type something inside expires ":" but again I don't know the syntax, if you want to test it too, here is the jsfiddle http://jsfiddle.net/onury/PJbye/   In that fiddle they have sExpires = vEnd === Infinity ? "; expires=Tue, 19 Jan 2038 03:14:07 GMT" : "; max-age=" + vEnd;  how do I change it to 30 minutes
  9. <script type='text/javascript'>//<![CDATA[ /* Caches the user-input data from the targeted form, stores it in the cookies * and fetches back to the form when requested or needed. */ var formCache = (function() { var _form = null, _formData = [], _strFormElements = "input[type='text']," + "input[type='checkbox']," + "input[type='radio']," + //"input[type='password']," + //leave password field out "input[type='hidden']," + //"input[type='image']," + "input[type='file']," + "select," + "textarea"; function _warn() { console.log('formCache is not initialized.'); } return { /* Initializes the formCache with a target form (id). * You can pass any container id for the formId parameter, formCache will * still look for form elements inside the given container. If no form id * is passed, it will target the first <form> element in the DOM. */ init: function(formId) { var f = (typeof(formId) === 'undefined' || formId === null || $.trim(formId) === '') ? $('form').first() : $('#' + formId); _form = f.length > 0 ? f : null; console.log(_form); }, /* Saves form data to cookies. */ save: function() { if (_form === null) { _warn(); return; } _form .find(_strFormElements) .each(function() { _formData.push( $(this).attr('id') + ':' + formCache.getFieldValue($(this)) ); }); docCookies.setItem('formData', _formData.join(), 31536e3 ); //1 year expiration (persistent) console.log('Cached form data:', _formData); }, /* Fills out the form elements from the data previously stored in the cookies. */ fetch: function() { if (_form === null) { _warn(); return; } if (!docCookies.hasItem('formData')) return; var fd = _formData.length < 1 ? docCookies.getItem('formData').split(',') : _formData; $.each(fd, function(i, item) { var s = item.split(':'); var elem = $('#' + s[0]); formCache.setFieldValue(elem, s[1]); }); }, /* Sets the value of the specified form field from previously stored data. */ setFieldValue: function(elem, value) { if (_form === null) { _warn(); return; } if (elem.is('input:text') || elem.is('input:hidden') || elem.is('input:image') || elem.is('input:file') || elem.is('textarea')) { elem.val(value); } else if (elem.is('input:checkbox') || elem.is('input:radio')) { elem.prop('checked', value); } else if (elem.is('select')) { elem.prop('selectedIndex', value); } }, /* Gets the previously stored value of the specified form field. */ getFieldValue: function(elem) { if (_form === null) { _warn(); return; } if (elem.is('input:text') || elem.is('input:hidden') || elem.is('input:image') || elem.is('input:file') || elem.is('textarea')) { return elem.val(); } else if (elem.is('input:checkbox') || elem.is('input:radio')) { return elem.prop('checked'); } else if (elem.is('select')) { return elem.prop('selectedIndex'); } else return null; }, /* Clears the cache and removes the previously stored form data from cookies. */ clear: function() { _formData = []; docCookies.removeItem('formData'); }, /* Clears all the form fields. * This is different from form.reset() which only re-sets the fields * to their initial values. */ clearForm: function() { _form .find(_strFormElements) .each(function() { var elem = $(this); if (elem.is('input:text') || elem.is('input:password') || elem.is('input:hidden') || elem.is('input:image') || elem.is('input:file') || elem.is('textarea')) { elem.val(''); } else if (elem.is('input:checkbox') || elem.is('input:radio')) { elem.prop('checked', false); } else if (elem.is('select')) { elem.prop('selectedIndex', -1); } }); } }; })(); //Initialize and fetch form data (if exists) when we load the form-page back $(document).ready(function() { $("form").submit(function () { return false; }); // prevent form submit $('.btnCache').click(function() { formCache.save(); }); $('#btnFetch').click(function() { formCache.fetch(); }); $('#btnClearCache').click(function() { formCache.clear(); }); $('#btnClearForm').click(function() { formCache.clearForm(); }); formCache.init(); formCache.fetch(); }); //Save form data right before we unload the form-page $(window).bind('beforeunload', function() { formCache.save(); //return false; }); //From Mozilla (https://developer.mozilla.org/en-US/docs/DOM/document.cookie) var docCookies = { getItem: function (sKey) { if (!sKey || !this.hasItem(sKey)) { return null; } return unescape(document.cookie.replace(new RegExp("(?:^|.*;\\s*)" + escape(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*"), "$1")); }, setItem: function (sKey, sValue, vEnd, sPath, sDomain, bSecure) { if (!sKey || /^(?:expires|max\-age|path|domain|secure)$/i.test(sKey)) { return; } var sExpires = ""; if (vEnd) { switch (vEnd.constructor) { case Number: sExpires = vEnd === ""? "; expires=": "; max-age=" + vEnd; break; case String: sExpires = "; expires=" + vEnd; break; case Date: sExpires = "; expires=" + vEnd.toGMTString(); break; } } document.cookie = escape(sKey) + "=" + escape(sValue) + sExpires + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "") + (bSecure ? "; secure" : ""); }, removeItem: function (sKey, sPath) { if (!sKey || !this.hasItem(sKey)) { return; } document.cookie = escape(sKey) + "=; expires=" + (sPath ? "; path=" + sPath : ""); }, hasItem: function (sKey) { return (new RegExp("(?:^|;\\s*)" + escape(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=")).test(document.cookie); }, keys: /* optional method: you can safely remove it! */ function () { var aKeys = document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g, "").split(/\s*(?:\=[^;]*)?;\s*/); for (var nIdx = 0; nIdx < aKeys.length; nIdx++) { aKeys[nIdx] = unescape(aKeys[nIdx]); } return aKeys; } }; //]]> </script> As you can see, it is set to a year, but I would like to change it to 30 minutes, but I don't know the syntax
  10. So basically, I have a form that when the user finishes it, and clicks submit the information is stored in the database, so I'm trying to make it so , when they open the form, the information retrieved is their corresponding information and not the one from the last person who filled the form and stored in the database. A friend of mine try to explain to me that all I have to do is something like, assign the session id to the user filling the form and store that in the database and then retrieve based on that id? im not sure if that's right, im very new to this topic so I apologize if I sound retarded, ive made some research about it but I don't clearly understand the process of how to do this, if someone could help me id really appreciate it.
  11.     This form, is one of those government forms in which the user really needs to read a bunch of text about rules and permissions before/while completing it, so yeah I guess breaking it into pages then would  be best in this case
  12. So I have a very long form in which the user has to scroll down quite a bit to complete it , so I thinking of having something similar to wikipedias index or maybe divide the form by section and at the end of each section have links to the other serctions lik 1 2 3 4 5, but what are other ways besides these? Could you provide some example?
  13. I have a form that uses method GET, to process the information, but then in the process.php  the URL it shows all the variables, How can I remove this from the URL, don't tell me to use the POST method because I can't because of other reasons, I tried some solutions that I found online but none of them work, if you are going to give an example of how you solve this, don't show it in pseudo code, give me a real example   Or maybe hiding instead of removing?   The reason why I cant use post is because on process.php I have a button that exports the site to a word document, if I use post the input is not shown in the word document because the browser cannot make a request twice
  14. Apparently nobody is allowed to have persistant session cookies on the server for security reasons, is there any other way to do this?
  15. So I have a form that uses session variables , and so I would like that when I close the browser and reopen it, the session is still alive   // This is suppose to keep the session even if I close the browser but is not working //It works locally but not on the server, How can I fix this? ini_set('session.cookie_lifetime', 60 * 60 * 24 * 365); ini_set('session.gc-maxlifetime', 60 * 60 * 24 * 365);   session_start();     function input_val($key, $remember = true) {         //use input_val('nameofinputfield')as value to be able to store in session    $value='';     if(isset($_REQUEST[$key])) {        $value = $_REQUEST[$key];        //Store value in session if remember = true        if($remember) {          $_SESSION[$key] = $value;        }                       return $value;     }else{       //Return session data       return isset($_SESSION[$key]) ? $_SESSION[$key] : $value;     } }
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!