Jump to content

jasper182

Members
  • Posts

    39
  • Joined

  • Last visited

    Never

Everything posted by jasper182

  1. Great, I was hoping there was a way to post them as an array. I'll try it out. Thanks!
  2. On my html form, I'm creating dynamic textboxes with javascript whenever the user selects an "Add New" button. However, when I post the page back to the server I am having problems deciding how to best parse the dynamic fields because I am unsure how many fields were created or if others that were previously created are now deleted. For example, when the data is posted back, I could have the textboxes "textbox1, textbox2, textbox3" or I could have "textbox3, textbox5, textbox6" if the user added fields and then deleted some of them. If anyone could help point me in the right direction, I would appreciate it. Also, if more information is needed, please let me know. Thanks.
  3. I am interested in doing my next side project using an agile methodology and I've read that unit testing is a big part of that. I have done some research on unit tests, but I'm still a little confused. I can see how it can be used for some cases, but I fail to see how to write good unit tests when you have functions with complicated output or when you are retrieving data from a database. Would I simply make very generic tests or is there something that I'm missing. If anyone cares to help shed some light on this topic for me, I'd be most appreciative. Thanks!
  4. I'm looking for some help in making an image uploader tool in ajax. The main thing I'd like it to do is allow for multiple files to be selected and uploaded at once. Also some drag and drop abilities may be handy too. If ajax can't handle this I can look into something else. However, I'd like to stay away from using java or flash to accomplish this if possible. Thanks.
  5. Thanks for the link, it looks like it will help a lot. One question though. Why would I not want to store images in a database? It seems to be fairly simple and its worked so far with no problems. Is there a potential problem with this that I'm unaware of? Thanks again for the help.
  6. Currently I have a form where people can upload images that are viewable from another page acting as a central image library. The images are all stored in a MySQL database. However, some of the images that are uploaded are very large, much larger then will ever be needed for my site. I was told by a friend to look into using the GD library to resize the images after they are uploaded but before they are stored to the database. Ideally it would be something like "The image is never more then 600 pixels wide and 800 pixels tall" or something like that. However, after doing some research, I'm still fairly confused. Does anyone have a good example of how this should be done or at least the main function(s) I will most likely be using? Thanks.
  7. So I've followed some of the oop tutorials for php and I am also currently a comp sci student, so I know at least the basics of oop, but I still would like to see more about the php side of this. The tutorials that I've seen never implement real sites with database connections or anything like that and I would like to see how other people have built their sites, even if its simply for very basic sites. Is there a book or a tutorial any of you can recommend? I've looked, but without a recommendation I don't really want to drop much money on a book and I have yet to find a tutorial that goes as deep as I'd like to into this subject. Thanks.
  8. I'd just like a basic guide to web servers. Things like building a site that will scale well, when/how to host a single site over several servers to increase speeds, just things like that. I don't have much experience with that stuff, so I was hoping some users here have experience with this stuff.
  9. Well I guess that answers my first question But where can I find out more about the actual hosting stuff needed to do this sort of thing? I've done quite a bit of coding, but my experience with servers and such is very limited I'm afraid.
  10. Hello. I am currently developing a web app in php. Its going well, but I was wondering how php scales. I'm not expecting a huge user base, at least at first, but if the app takes off, can php handle a large traffic load? Also, do you guys know any howto's or faq's about creating a web at and how to successfully host it for a large user base? Any advice you guys have on the subject would be much appreciated, seeing how I've never worked on anything like this before. Thanks.
  11. Hello, I just completed a basic prototype of an Ajax powered page that I would like to continue working on. However, I have just been using hardcoded JavaScript for all my Ajax calls, and I was wondering what you all thought about the different frameworks out there right now. Is there a benefit to switching to something like Google's or Yahoo's framework, or is it better just to hardcode everything myself like I have been doing? I don't know anyone who has used these frameworks, so any insight you can give me on them would be appreciated. Thanks.
  12. I'll give it a look.  Does anyone else know how to send passwords and such with Exec?  It seems like it would be a common need, but I could be mistaken.
  13. I am trying to use the exec command to run sftp from the command line and transfer a file using a php script.  However, I'm unsure how to send a password using exec when it is required.  Is there a way to handle this with the exec command, or is there something better I could use for this situation?  Thanks
  14. I'm working on a project for school and I am trying to use an FTP connection to upload/download files from a FTP server that isn't on the school's network.  Unfortunatly, our school's firewall blocks all incoming/outgoing FTP requests because they believe FTP is to insecure.  While this may or may not be true (I don't know much about the security of FTP transfers) I was told that I could use SFTP by our network's admin.  However, I have been unable to find any documentation on using SFTP with PHP.  Is this even possible?  If so, could you help point me in the right direction?  Thanks.
  15. I'm trying to show some php code in a textarea, and I'd really like it to have syntax highlighting.  I have found a function called highlight_string() that works fine for normal text, but it hasn't worked for me at all with textareas.  Is there something else that I can use to do this?  Thanks.
  16. Well, mainly I have functions such as this one var OLDhttpvar; var httpvar; function getUserList() { if(window.XMLHttpRequest){ httpvar = new XMLHttpRequest(); } else { httpvar = new ActiveXObject("Microsoft.XMLHTTP"); } var params; params = "username=Jasper&project=12" httpvar.open('POST', 'showUserList.php', true); httpvar.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); httpvar.setRequestHeader("Content-length", params.length); httpvar.setRequestHeader("Connection", "close"); httpvar.send(params); httpvar.onreadystatechange = function() { if (httpvar.readyState == 4) { if(OLDhttpvar != httpvar.responseText) { document.getElementById("memberList").innerHTML = (httpvar.responseText); OLDhttpvar = httpvar.responseText; } } }; delete params; } setInterval("getUserList()",250); I have about 6-7 of these going, all are updating between 250 and 5000 milliseconds, and thats really it. 
  17. I'm working with ftp'ing a file with my newest script, and I was wondering if there was a way to read the contents of a file from an ftp server without first downloading it to your server with ftp_get, reading it, then deleting it.  If not, I guess its not that big of a deal, I was just hoping.  Thanks
  18. I've recently been working with some javascript on a project and I am not very experienced with it.  Anyways, I'm working with doing some simple AJAX, but there is a memory leak somewhere in my page.  After 20 minutes or so FF gets extremely sluggish and needs to be restarted.  I make sure to delete all variables that are created inside of called functions, but other then that I was wondering what else I should look for to stop these memory leaks.  Thanks in advance for any help you can offer me.
  19. Right now I am working with a web app that makes numerous calls to a MySQL database and sends data back and forth constantly.  The data is all text, so it isn't very large, but it still have more of a delay then I would like.  I am looking for any tips/advice/references you can give me on optimizing AJAX code so that it will run faster and give the user a smoother experience.  I've worked with AJAX over the past year, so I have the basics down but now I'm hoping to get into it deeper to improve my skills.  Thanks.
  20. Ok, it looks like it is being sent, but like you said its not making it from my javascript to update.php.  Is there a way to send the Post variable as a string?  I tried putting it in quotes and that didn't work, it just added quotes around what I submitted.  Thanks for your assistance.
  21. I'm simply javascript to call the update.php page.  Here is my function: var OLDhttpvar4; var httpvar4; function getEditor() { if(window.XMLHttpRequest){ httpvar4 = new XMLHttpRequest(); } else { httpvar4 = new ActiveXObject("Microsoft.XMLHTTP"); } var params; params = "username=Jasper" if (document.getElementById('mainEditor') != null) { params = params + '&content=' + (document.getElementById('mainEditor').value); } httpvar4.open('POST', 'editorBox.php', true); httpvar4.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); httpvar4.setRequestHeader("Content-length", params.length); httpvar4.setRequestHeader("Connection", "close"); httpvar4.send(params); httpvar4.onreadystatechange = function() { if (httpvar4.readyState == 4) { if(OLDhttpvar4 != httpvar4.responseText && httpvar4.responseText != 'No Print') { document.getElementById("contentBox").innerHTML = (httpvar4.responseText); OLDhttpvar4 = httpvar4.responseText; } } }; Also, I looked at the values being sent and the +'s are all getting to update.php.  Thanks for helping me out.
  22. I am currently working on a simple AJAX page that reads the value of a textarea and then writes that to my MySQL database everytime the contents of the textarea changes.  For some reason though, every character is stored in the database fine except for the +.  Whenever I type that, then check the view page any + that I have typed are gone.  I checked the database and they are not stored there either.  I pass the contents of the textarea to my update.php page which reads the new value and updates the record in the database.  Basically, the code on the update.php page is : $newContent = addslashes($_POST['content']); $query="UPDATE files SET Content='$newContent' WHERE FileID='1'"; $result=mysql_query($query); The FileID=1 is just so I could test it by overwriting the same record.  The top line is the only time that I reference the data sent to update.php, so I don't know where it could be disappearing.  Is there something I'm missing?  Any direction would be greatly appreciated, and thanks in advance for sharing your knowledge with me.
  23. Nevermind, I just got an email from a friend and found out I was reading an incorrect variable then trying to print it.  Boy do I feel foolish  :-\
  24. I am currently working on a simple file uploader for a site I've been messing around with, and I'd like to read the information from the uploaded file immediately, [i][b]without [/b][/i]storing the uploaded file on my server.  However, after looking around I've been unable to find any real help on this.  I use a standard uploader: <form enctype="multipart/form-data" action="uploadFile.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="1000000" /> Choose a file to upload: <input name="uploadedfile" type="file" /><br /> <input type="submit" value="Upload File" /> </form> I can get the temp file name, but when I try to fopen it, it only prints out something like "Resourse id#3" or something like that.  If you could help me out or something I'd really appreciate it.
  25. Thats perfect, thank you very much.
×
×
  • 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.