Jump to content

Don E

Members
  • Posts

    996
  • Joined

  • Last visited

Everything posted by Don E

  1. Looks like you miss spelled removeChild in each of the functions.
  2. Don E

    HELP!

    For a second there... I thought I was checking out a thread started by eduardlid .... either that or he hacked Foxy's account and posted under it
  3. To the if condition, add: && streamCont.childNodes[x].id != "newStream" to it, to not have it be updated. if(streamCont.childNodes[x].nodeName == 'DIV' && streamCont.childNodes[x].id != "newStream" )
  4. It's pretty late and I was writing an explanation on one way to do it on what I think you're trying to do but noticed the explanation was getting too much so I figured heck with that and just demonstrate via code what I was trying to explain. Anyhow, here it is. I added some background colors for visual reasons. To see how it works, go into firebug or whatever web dev tool you use and go to the HTML tab/section to see the changes taking place when closing each section; meaning the divs being re-ordered when they are removed/closed.. In the example below, to close a div(section), just click on it. Hopefully something you're looking for. (Below is just an example; I dont recommend inline styling and setting inline event handlers) <!doctype html> <html><head><meta charset="UTF-8"><title>Remove/Reset Divs</title> <script type="text/javascript"> function removeStream(id) { var streamCont = document.getElementById('streamContainer'); for(var i = 0; i < streamCont.childNodes.length; i++) { if(streamCont.childNodes[i].id == id) { streamCont.removeChild(streamCont.childNodes[i]); } } // reset divs var count = 1; for(var x = 0; x < streamCont.childNodes.length; x++) { if(streamCont.childNodes[x].nodeName == 'DIV') { streamCont.childNodes[x].id = "stream"+count; count++; } } } </script></head> <body><div id="streamContainer"> <div id="stream1" onclick="removeStream(this.id)" style="background-color: red;">Stream here</div> <div id="stream2" onclick="removeStream(this.id)" style="background-color: blue;">Stream here</div> <div id="stream3" onclick="removeStream(this.id)" style="background-color: yellow;">Stream here</div> <div id="stream4" onclick="removeStream(this.id)" style="background-color: orange;">Stream here</div></div> </body></html>
  5. Don E

    update sql table

    Check out this link and scroll down to where it says SQL UPDATE warning to see why most likely what you're experiencing when trying to UPDATE the table: http://www.w3schools.../sql_update.asp You can do it all on the same page as well like the following: <?php if(isset($_POST['submit'])) { //code to update table } ?><!doctype html><html><head></head> <body> <form action="set action to the current web page here" method="make sure method is post"> <p><label class="field">1st:</label><input type="text" name="one"></p> <p><input type="submit" name="submit"/></p> <!-- make sure you give input submit button attribute name a value like I did: name="submit" --> </form></body> </html>
  6. Thanks birbal, have better understanding now!
  7. Don E

    Video via youtube link

    This can get you started: http://www.w3schools.com/html/html_youtube.asp
  8. Don E

    move_uploaded_file

    You can move the image to your desired location/directory using move_upload_file but to store in the database table, you can store the image names themselves like mypic.jpg and then when you want to display the images on a webpage, you can retrieve the image names from the database table and set them to <img> tag to be displayed on the webpage. You can also store the actual image(s) itself in the database too but personally I prefer the above method.
  9. For this: inputs[j].class == 'c2', try instead: if(inputs[j].className == 'c2')
  10. I was wondering if anyone can provide some information on shared hosting and dedicated hosting. I know what they are but I wanted to know basically if there is an actual performance difference between the two? I am sure there is but how much exactly? My current website is on shared hosting and I am considering maybe in the not so distant future to move over to dedicated hosting because since my website allows users to do image manipulations etc, especially soon on the edit page I'm currently putting together which will have a lot of ajax calls, it will require a lot of system resources and if many users at once are using the site, it can perhaps slow things down a bit and discourage the user resulting in them going elsewhere. I'm not entirely sure if that can/will be the case but better to know if anything. Thank you! Edit: Yes I did it but I like to know the opinions of my fellow w3schoolers!
  11. Try removing value="Test postCode". Then whatever the user enters in that input field, the value then should be retrievable by having: var pcode = document.getElementById('postCode').value
  12. May or may not be the issue but it looks like you're missing a closing brace } for either the first if statement block:if(isset($_POST['submit'])) or this one: if ($fetch_status['STATUS'] =="closed").
  13. boen, so basically I have to insert into the httpd.conf file somewhere(example)? SetEnv SPECIAL_PATH /foo/bin
  14. Have you tried something like: $image = $handle->file_new_name_body . $id; // concat the image file name to the user id and set it to $image. But this can probably produce something like: mypic.jpg24. So you might want to try: $image = $id . '-' . $handle->file_new_name_body; // this can look like: 24-mypic.jpg; remove the '-' if you want but figured be a good idea if you ever have to explode the image file name where you can use the '-' as a dilimiter to extract the user id or just the image name for example. I would change the picture name before uploading/moving it to your upload directory. If you want to rename after, you might have to use the rename() function
  15. Have you checked out wintoflash? http://wintoflash.com/home/en/
  16. I thought it was getting it from the OS too but the OS environment PATH is different than what phpinfo() displays in the Apache Environment section.I looked for "SetEnv" in httpd.conf, wasn't able to find anything to do with that.. Thanks.
  17. Hello everyone, I was wondering if anyone would know why in MAMP when I view the phpinfo(), the PATH info under Apache Environment is different than what I specify in the Apache 'envvars' file. Apache seems to be getting the PATH info from somewhere else and I can't quite figure out where. I am using just MAMP; not the pro version. Any help is greatly appreciated. Thank you!
  18. Or if software really isn't an option for you, you can go to http://editthis.net/resize and resize there. You can enter your desired width and height. You can also resize many images at once.
  19. This is a pretty good link: http://www.regular-expressions.info/
  20. One option would be to use the settype() function: $number = 11;settype($number, "string"); // $number will become "11" (string)
  21. Hey Jess, general forum might be the proper place.
  22. Don E

    PHP Copy function

    I managed to figure out what the problem was. There was an issue with the upload. Thanks everyone for their input.Nice to see DD around again!
  23. Don E

    PHP Copy function

    Thanks for the input guys. Unfortunately the following examples didn't work either: $origImg = "uploads/" . $this->pic_name;$origImg = "uploads/{$this->pic_name}"; I echoed out the variables to see if they contain the proper values and they do as well. I even tried to cast them to strings like the following and still get fail on copy: $imgToCopy = (string)"uploads/$this->pic_name";$setAsOrig = (string)"uploads/$this->pic_name" . ".orig"; It works though when setting the variables like the following: $imgToCopy = "uploads/sfsGDFDmyimage.jpg";$setAsOrig = "uploads/sfsGDFDmyimage.jpg" . ".orig";
  24. Don E

    PHP Copy function

    I meant more along the lines of the following example. $origImg = "uploads/$this->pic_name";$copyImg = "uploads/$this->pic_name" . "orig";copy($origImg, $copyImg);When using the above without quotes I thought why the copy failed but doing the above with double quotes fails as well.
×
×
  • Create New...