Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by damiancds

  1. I recently set up a shared SSL for my site, and the pages that use the SSL don't link to my CSS or any of my images.my setup is thispage links to page (includes.html) via <?php require("/home/ledger6/public_html/resources/includes/includes.html"); ?>which, in turn links to my css via <link rel="stylesheet" type="text/css" href="/resources/includes/css/style.css" media="screen">and images in my css are referenced like this: background-image: url('/resources/images/system/backgrounds/back_005.jpg');I've read about not using certain types of links, but I'm not sure how to do it without changing everything.any help would be greatly appreciated.
  2. Unfortunately, it didn't work. I think that if I had the right permission, it would (I've been reading on a related matter, and I think I would have to have access to http.conf or something - which I can't find)Either way it results in an internal server error.It's really no big deal, i mean about the image thing, not the internal server error.
  3. I'm not sure if it can be done with .htaccess (not really sure what it's capable of or best used for), but I'd like to load an image by default and replace it with the expected image if it's found.basically load an image (a little square stating image not found) and if it finds the right one, load that over top of it.or only load the not found image when the normal image isn't found.Again, not really sure if .htaccess is meant for this sort of thing, and if not, what should I do it with?Thanks,
  4. I'm looking for reference books for web design.I'm thinking definitely a php/mysql bookmaybe just a css referenceand a JavaScript bookI have two books already, both something like web wizards guide or something for php and html (both were about 1/2 inch thick. The html one was descent, but it didn't really delve into things, and the php was horrible, I can say I didn't learn/remember anything from that book.but back to the original question, can anyone recommend a good book that covers php, and possibly mysql together (i'm looking for total php, not just mysql related php, so perhaps separate books would be better)-examples are great,-reference section would be nice-easy to follow, but doesn't skimp on details, and covers most everything (I'm a beginner but I don't want a beginner book and have to get an advanced book later onto give a little background, I'm handcoding my site, I don't like depending on something like dreamweaver or a wysiwyg editor, I like understanding the code I've arrived at.I go to New York City on the weekends for a farmer's market and there's a Barnes And Noble near there where I can get it. For now, I'm interested in only the php and mysql, I don't plan on using javascript very much at all and that can wait, and the css, I've got a pretty good grip on already, besides w3schools is great for that.
  5. is it possible to have a link to a page with a form on it and change one of the options in a select box from that link?ie<a href="page01.php" id(select_01).value(3)>blah</a>basically I have a contact form for every type of contact, and I have a link to submit a question, and if they click that link, I want the 3rd option of the select box to show instead of the first default optionis it possible?thanks,
  6. I AM SUCH A @%$!ing IDIOT...As it turns out, when I was requesting it, i used $num_ingd = $_REQUEST['build_ingd'];but when i did my comparing, output and form building, i used build_ingd as a variable not what I set it to.Now where's that dunce cap...again, thanks for the help and tolerance of stupidity...
  7. okay, a little background: The first part of the form asks how many ingredients there are, then takes that information to the second form and the second form is built with that many text boxes for however many ingredients. I'm not sure if my testing (if num > 1) actually test if it's longer(as in string length) or greater(higher in number)The first form submits to itself( as in the same page) where the basic logic is: if( num > 1){ Show part 2 of the form where they put in all the info (which has a for loop running to build the textboxes) and submit}else{ Show part 1 (just asking for number of ingredients} Also, at the end of all this, I plan on putting all the information into a text file (don't know if that matters, but I'll do that later, though I've already got that done, except for the user's inputs
  8. damiancds

    Awkward access

    thanks, I guess I wasn't really paying attention when I put it in there. Hopefully nothing else shows up in my error logs
  9. damiancds

    Awkward access

    It took me a while but I finally found the topic I started,I've put the php header(s) on the main page of my site, which appears to be working as it should, but I recently noticed this in my error logs[25-May-2010 08:15:15] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/ledger6/public_html/index.php:1) in /home/ledger6/public_html/index.php on line 1the actual php header code i've used is: <!-- <?php Header("Cache-Control: must-revalidate"); $offset = 60 * 60 * 24 * 1; $ExpStr = "Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT"; Header($ExpStr); ?> --> I'm wondering why I'm getting this error, if the caching seems to be working. (should i get rid of the html comments <!-- , --> )thanks,
  10. Sorry about that, I swear I checked it before I posted it.Anyway, it's back up
  11. sorry about taking so long to get back to you, finally got done some of the other things I was doing.On your suggestion, I removed all but the first requests, so they are only requested once. The curious part is that I have an input form, and then it gets submitted to itself, and if the values are greater than 1, it shows the next part, which works. It seems to lose the value. I'm really at a loss here.
  12. So, basically there's no way to know which will be faster, it will always depend on the individual user. (I doubt there's a way to grab the user's location, the servers location, and do the math, let alone if it's even worth trying)thanks, I might just copy the file over, that way I won't be dependent on another site, in case it goes down for whatever reason.
  13. I've been looking a scripts to tackle a few things, and on one of them, I'm requesting http://ajax.googleapis.com/ajax/libs/jquer...2/jquery.min.jsI was curious if it would be faster if that particular file was within my directories instead of on the ajax.googleapis.com site. It would also be helpful if what I'm talking about is even legal,thanks,
  14. Right now, I'm using the focus pseudo to change the text color from gray to black, but when it leaves the input and going to the next, it changes back from the black back to the gray. What i want is for it to stay black. I've tried using the :visited , which didn't work.EDIT:also, when i click on my buttons, the text color changes to black (from white) and it only changes back to white when i click somewhere else.If you wanted to look at it, here's my code:CSS: fieldset { background-color: #ffffff; /*#ccff99;*/margin: auto;padding-right: 10px;width: 470px;border: 3px ridge black;background-image: url('body-bg.jpg');background-position: bottom right;background-repeat: repeat-x;}legend {margin-left: 1em; color: #000000; font-weight: bold; border: 2px solid green;background-color: ivory;}label { max-width: 250px; min-width: 200px; height: 1.5em;line-height: 1.5em; margin: 5px 0px 0px 0px; padding-right: 10px;text-align: right; color: #ffffff;background-color: #007700;float: left;clear: left;}input.button {float: left;height: 2em; margin: auto;width: 150px; line-height: 1em; margin: 10px; text-align: center; color: #ffffff;border: 2px outset black;background-color: green;}input.button{border: 2px outset black;}input.button:hover{border: 2px inset black;}fieldset input.button{border: 2px outset white;}fieldset input.button:hover{border: 2px inset white;}input {float: left;width: 250px; height: 1.5em; line-height: 1.5em; margin: 5px 5px 0px 0px; text-align: left; color: #aaaaaa;border: 1px inset black;}input:focus{color: #000000;}input:visited{color: #000000;}select{ float: left; max-width: 300px; min-width: 250px; height: 2em;line-height: 1em;margin: 5px 5px 0px 0px; padding: 2px 0px 0px 2px; text-align: left; color: #aaaaaa;border: 1px inset black;}select:focus{color: #000000;}option{padding: 5px 0px 0px 5px;height: 2em;line-height: 1em;border-bottom: 1px dashed black;}textarea{ float: left; width: 250px; height: 200px; margin: 5px 5px 0px 0px; text-align: left; color: #aaaaaa;border: 1px inset black;}textarea:focus{color: #000000;} HTML: <form method='post' action='/system/contact.php'><fieldset><legend>Contact Ledge Rock Farm</legend><label for='email'>Email:</label> <input name='email' type='text' id='email' value="You@domain.com" onfocus="this.value=''; this.onfocus=null;"> <label for='subject'>Subject:</label> <select name='subject' id='subject'> <option value='None'>-- Please Select --</option> <option value='Feedback'>Comments/Feedback</option> <option value='Questions'>Questions</option> <option value='Order Inquiry'>Order Inquiry</option> <option value='Product Inquiry'>Product Inquiry</option> <option value='Other'>Other</option> </select> <label for='message'>Message:</label> <textarea name='message' rows='10' cols='40' id='message' onfocus="this.value=''; this.onfocus=null;">Your message here</textarea> <input class="button" type='reset' value="Clear Form" class="button"> </fieldset> <input type='submit' value='Send Message' class="button"> <input type='reset' value='Clear Form' class='button'> </form> EDIT: nevermind about the button problem, I had an input:focus overlapping my buttons, so I got that fixed
  15. I've been looking at other sites for form designs and found a few I liked, but when I went to tweak them a little I couldn't get where I wanted so I decided to start from scratch. My main problem is, I want to do a form without doing each line in an unordered list, which looking around is all i found how to do them aligned. I'm hoping i can do it with floating and clearing my labels.like<label>blah</label><input ...>with each label and it's respective input/textarea on its own line.it's just everywhere i look there nested in lists, that would mess with one of my javascript functions, besides it's more coding I'd rather not do. I've messed with floating and clearing, and haven't gotten them looking right.EDIT: Nevermind, I got it, I guess i didn't play enough with the floating and clearing, sorry.
  16. I'm working on a recipe submission form, and they best way I can think of doing this is to have a form, where they put in the their contact info, recipe name, but, when it comes to the ingredients, and in a two part form, i would ask how many ingredients, and the second part (submitted to itself, would have a for loop to echo out the form textboxes. and have the final part, after entered, create a text file with all the info, and possibly send me a message when something was submitted.my problems are:I can't seem to grab the info from the first part to the second (everything seems to check out,variables in question : build_ingd and build_prep (from the form in the else condition)Code: (echo's were there for debugging) <?php echo "<br> START"; $num_ingd = $_REQUEST['build_ingd']; $num_prep = $_REQUEST['build_prep']; echo "<br>num_ingd = ".$build_ingd; echo "<br>num_prep = ".$build_prep;if($num_ingd >= 1 && $num_prep >= 1){ echo "<br> IN IF"; $num_ingd = $_REQUEST['build_ingd']; $num_prep = $_REQUEST['build_prep']; echo "<br>num_ingd = ".$build_ingd; echo "<br>num_prep = ".$build_prep; echo " <form method='post' action='/recipes/submit.php'> <fieldset id='fieldset_contact_info'> <h3>Contact Information</h3> <label for='fname' id='fnamel'>First Name:</label><input type='text' size='40' name='firstname' value='' id='fname'> <label for='lname' id='lnamel'>Last Name:</label> <input type='text' size='40' name='lastname' value='' id='lname'> <label for='email' id='emaill'>Email:</label><input type='text' size='40' name='email' value='' id='email'> <input type='reset' value='Clear' class='button' id='reset1' onclick='return clear_fieldset('reset1')';> </fieldset> <fieldset id='fieldset_recipe_info'> <h3>Recipe Information</h3> <label for='rname'>Recipe Name:</label><input type='text' name='name' size='40' value='' id='rname'> <label for='serves'>Serves:</label><input type='text' name='servings' size='40' value='' id='serves'> <label for='prept'>Prep Time:</label><input type='text' name='prep_time' size='40' value='' id='prept'> <label for='cookt'>Cooking Time:</label><input type='text' name='cook_time' size='40' value='' id='cookt' value='If Applicable'> <label for='baket'>Baking Time:</label><input type='text' name='bake_time' size='40' value='' id='baket' value='If Applicable'> <input type='reset' value='Clear' class='button' id='reset2' onclick='return clear_fieldset('reset2')';> </fieldset> <fieldset id='fieldset_ingredients_info'> <h3>Ingredients</h3>"; $build_ingd = 59; for ( $x = 1; $x <= $build_ingd; $x++) { echo "<label for='i_".$x."'>Ingredient ".$x.":</label> <input type='text' size='50' value='' name='ingredient_".$x."' id='i_".$x."'>"; } echo " <label for='i_99'>Ingredient 99:</label> <input type='text' size='50' value='' name='ingredient_99' id='i_99'> <input type='reset' value='Clear' class='button' id='reset3' onclick='return clear_fieldset('reset3')';> </fieldset> <fieldset id='fieldset_prep_info'> <h3>Preparation</h3>"; for ( $y = 1; $y <= $build_prep; $y++) { echo "<label for='p_".$y."'>Preparation Step ".$y.":</label> <input type='text' size='50' value='' name='prep_".$y."' id='p_".$y."'>"; } echo " <label for='p_99'>Step 99:</label> <textarea rows='1' cols='50' id='p_99'></textarea> <input type='reset' value='Clear' class='button' id='reset4' onclick='return clear_fieldset('reset4')';> </fieldset> <fieldset id='fieldset_other_info'> <h3>Other Information</h3> <label for='other'>Other Information:</label><textarea rows='10' cols='50' id='other' title='Couldn't find where to put your other notes? Stick 'em in here, anything from what goes well with your recipe, to little tips about the recipe like substitutions or time-savers.'></textarea> <input type='reset' value='Clear' class='button' id='reset5' onclick='return clear_fieldset('reset5')';> </fieldset> <input type=Submit value='Submit Recipe' class='button'> <input type='reset' value='Clear' class='button'> </form> ";}else{ $num_ingd = $_REQUEST['build_ingd']; $num_prep = $_REQUEST['build_prep']; echo "<br> IN ELSE"; echo "<br>num_ingd = ".$build_ingd; echo "<br>num_prep = ".$build_prep; echo " <form method='post' action='/recipes/submit.php'> <fieldset id='fieldset_builder_info'> <h3>Contact Information</h3> <label for='fname' id='build_i'>Nubmer of Ingredients</label><input type='text' size='40' name='build_ingd' value='' id='build_i'> <label for='lname' id='build_p'>Number of Preparation Steps:</label> <input type='text' size='40' name='build_prep' value='' id='build_p'> </fieldset> <input type='submit' value='Continue' class='button'> <input type='reset' value='Clear' class='button' id='reset1'> </form> ";}?> If anyone has a better way of doing this (though without javascript because i don't like the idea of it only working when someone else want's it to), give a shout, I probably hadn't thought of it yet.I've also thought about having a file upload form where they just upload a text file (or word document/ open office, whatever) but I'm not really sure about having it be secure. Also, if i did the upload option, I'd want to upload two things at once, the image and the actual recipe.I planned either way, to take the information and then hand code it into a new page
  17. Well, i feel stupid.My problem was that I was checking the type for textarea after I assumed it was an input. I brought it out and checked for the nodeName and now it works perfecltyI really appreciate the help on my very first javascript function.
  18. Great advice, I honestly never thought about changing cases to compare strings in all the programming I've done, such a novel idea too.I've got everything running except for one issue, I don't know how to change the value of a text area, since that's not governed by a value attribute.
  19. I've got an old coding practice of outputting a lot for debugging and where the code stops, which seems to have helped here, only I can't find out why it's stopped function clear_fieldset(currentID){ alert("Function Entered"); var fieldset_id = document.getElementById(currentID).parentNode.id; alert("variable set"); if(document.getElementById(fieldset_id).hasChildNodes() == true) { alert("Fieldset with ID: " + fieldset_id + " has " + document.getElementById(fieldset_id).childNodes.length + " children."); ****************** this pops out saying it has 15 children.... for( var x = 0; x < document.getElementById(fieldset_id).childNodes.length; x++ ) { alert("FOR LOOP ITERATION " + x + "..."); ****************************************** THIS IS WHERE IT STOPS ************************************************* if(obj_fieldset.childNodes[x].nodeName == "INPUT") { alert("IF # A inside loop"); if(document.getElementById(fieldset_id).childNodes[x].type == "RESET" || document.getElementById(fieldset_id).childNodes[x].type == "SUBMIT") { alert("ISIDE IF # 1 INSIDE IF # A - if button"); break; } if(document.getElementById(fieldset_id).childNodes[x].type == "TEXT") { alert("ISIDE IF # 2 INSIDE IF # A - if text"); document.getElementById(fieldset_id).childNode[x].value = ""; } if(document.getElementById(fieldset_id).childNodes[x].type == "TEXTAREA") { alert("ISIDE IF # 3 INSIDE IF # A - if textarea"); document.getElementById(fieldset_id).childNode[x].value = ""; } if(document.getElementById(fieldset_id).childNodes[x].type == "RADIO") { alert("ISIDE IF # 4 INSIDE IF # A - if radio"); if (document.getElementById(fieldset_id).childNode[x].value == "default") { document.getElementById(fieldset_id).childNode[x].checked = true; } else { document.getElementById(fieldset_id).childNode[x].checked = false; } } if(document.getElementById(fieldset_id).childNodes[x].type == "CHECKBOX") { alert("ISIDE IF # 5 INSIDE IF # A - if checkbox"); document.getElementById(fieldset_id).childNode[x].checked = false; } } if(document.getElementById(fieldset_id).childNodes[x].tagName == "SELECT") { alert("ISIDE IF # 1 INSIDE IF # B - if select"); document.getElementById(fieldset_id).childNodes[x].selectedIndex = 0; } else { alert("INSIDE ELSE IN LOOP - catch all"); } alert("END of LOOP ITERATION " + x + "..."); } } else { alert("Fieldset with ID: " + fieldset_id + " has no children."); } alert("END"); return false; alert("should not see...");} it stops at the very first iteration (0) of the loop and i get no more alert boxes telling me if I've gone anywhere else, which my ifs/elses would have picked up.I'm gonna let this sit for tonight and check back with fresh eyes tomorrow, if you catch anything, for the love of all that is holy, please clue me in.anyway, I might get something tomorrow...
  20. after working a little bit on it and this is what I've come up with, let me know if I'm on the right track function clear_fieldset(currentID) //pass the buttons id so i can get the parent fieldset from it{ var obj_fieldset = document.body.getElementsByTagName(currentID).parentNode; //this gets me the fieldset and puts it into a variable for easier referencing, and I don't know if these are actual javascript comments but you get the idea for( var x = 0; x < obj_fieldset.childNodes.length; x++ ) // run through all the fieldsets elements { if(obj_fieldset.childNodes[x].nodeName == "INPUT") // only deals with inputs { if(obj_fieldset.childNodes[x].type == "TEXT") { obj_fieldset.childNode[x].value = ""; //reset them, but it would be better if I could get the default value instead of clearing it } if(obj_fieldset.childNodes[x].type == "TEXTAREA") { obj_fieldset.childNode[x].value = ""; } if(obj_fieldset.childNodes[x].type == "RADIO") // don't know how to reset radio or checkboxes, but right now i'm not using them { obj_fieldset.childNode[x].value = ""; } if(obj_fieldset.childNodes[x].type == "CHECKBOX") { obj_fieldset.childNode[x].value = ""; } if(obj_fieldset.childNodes[x].type == "BUTTON") // the clear button will always be the last element in the fieldset, so when it hits that it stops processing { break; } } // end input type testing if(obj_fieldset.childNodes[x].tagName == "SELECT") // again don't know how to set default value, probably have to go through the options in a loop to see which one has the selected attribute { // again don't know how to set default value, probably have to go through the options in a loop to see which one has the selected attribute } } //end for loop} EDIT:Also, how would i go about calling this from the input button?, just in an onclick event, leaving the regular reset stuff so it still works without javascript?
  21. What I'm looking to do is have a clear/reset button in each fieldset and have them clear only the fieldset they're in. By default, a reset button resets everything on the page even if it's in a fieldset.I suppose putting each fieldset in their independent form would solve the problem, but would make submitting the information much harder than the initial problem.I'm hoping I can do this without javascript, but if I'd have to, I would just have it so the javascript cleared the current fieldset's fields, and without, it would reset everything on the page (which it currently does).any pointers?
  22. Yeah, I went back and looked, because I couldn't figure out how to get the character at a certain position and noticed the strcmp. I thought it didn't deal with case sensitive but then i saw it would return a negative. After i put it in it works great.thanks,
  23. I've been looking around, and I can't find what I need. Recently, I made it easier to navigate by removing all case sensitivities from my urls. The problem is that I still get some misdirected attempts still going to the older case sensitive urls.On my 404 page, I'm trying to take the url they entered and give them back an all lower case url, Which is done, the thing is, I only want to give it out when there is upper case letters in the url. So, I'm basically asking if there is any way of testing a string to see if it has at least one upper case letter, then if it does print the URL in lower case. The only thing I came close to is ctype_upper() but, that only returns true if ALL of them are upper case, and I want to test if at least one character is upper case.If anyone has any quick ideas, let me know. Right now I'm going to start writing my own function that'll run through the string and test if each letter is in the ascii value of an upper case letter (i think is somewhere from 66 and up or so)thanks,
  24. I actually thought that you could hide/ unhide without javascript.I guess i'll try the with javascript and without + reload, and see how i like it.Otherwise, I might just do a text area and figure something out with that.thanks,
  25. I'm working on a form, and I'd like for people to add things in steps, where some people might only have three items to add, and some may have five and so on (either way a difference). I'd like a button that adds a text box dynamically without reloading the page so people can keep adding a new item. But, the main thing is I don't want to do it with JavaScript, because it wouldn't work for the people who have it turned off, and then the whole form would be pointless.I've toyed with the idea of having them hidden but then there's always the problem of someone reaching the limit of the boxes I've put in. I'd like to know if this is possible either with plain HTML, or something like PHP, basically where the form will work regardless of the users settings.thanks,
  • Create New...