Jump to content

Rheves

Members
  • Posts

    45
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Rheves's Achievements

Member

Member (2/5)

0

Reputation

  1. I have a page that I let the user edit with contentEditable=true and then I want to save those changes. The first thing I tried was grabbing the contents of 'document.documentElement.innerHTML' but that adds a nasty mess at the top of the page for computed styling it seems. Second attempt is to use ajax to grab the current page off the server and then swap in the div that the user will be editing, I can't seem to do that. Once I grab the file off the server I have the contents of the html document in the format I expect, same as if I'm looking at it notepad. The save event of the editor I'm using passes me the edited content for the div I want to update. I just don't know how to connect the two. Original html looks something like the following and is my 'origPage' variable: And the updated value I get back from the editor looks like this and is my 'e.html' variable: The life of an idiot is a hard one, and I cannot find out how to merge the two. My 'e.html' variable is simple text and available to me from thr get go, and my 'origPage' variable is plain text as well, I populate it like this: I thought I could parse the origPage text into a jquery object and access the innerHTML that way since I am familiar with that method but I always get errors like "TypeError: undefined is not a function" or "TypeError: Cannot read property 'getElementById' of undefined". My attempts looked like this, editor being the div ID that was being edited: I don't know javascript very well and this seems like such a simple thing to do but I just can't get it to do what I want, can anyone help?
  2. I have an FTP server set up in our office, and would like to be able to connect to it all the time (At the office, and at home) using a no-ip.org domain I set up to point to it's external IP. Works great outside the office, but we need to use the internal IP whenever we are in the office as expected. What I wanted to do was set up a php script as index.php on the wamp server I just threw on there which looks like this: <?php $LocalIP = $_SERVER['SERVER_ADDR']; $IncomingIP = $_SERVER['REMOTE_ADDR']; if ($LocalIP == $IncomingIP){ header('Location: 192.168.2.200'); }else{ header('Location: ***.no-ip.org:21'); } ?> It...doesn't work. I'm trying to connect using the no-ip domain and port 80 in my ftp client. Is this flawed from the start or would I be able to get this working? Locally I get this error: And outside the office I get this: Any help in getting this working or letting me know if it's impossible would be appreciated!
  3. I was getting that error when I called it like this: if (SendIt(&$FileCheck)){ //Worked }else{ //Didn't } But removing that & and changing the declare function to read this instead: function SendIt(&$EM){ [...] }//I changed it to EM within the function Fixed it.
  4. I saw your post before you edited it and passing it by reference fixed it, even though I had $FileCheck declared at the very top of my script, Though I am now getting the following error: But I can work from there, thank you! I'll try to post more of my source code if I need any help in the future too, I kind of made a mess by only posting a little bit. Edit: The above was caused by my putting the & in front of where I called SendIt instead of where I declare the function.
  5. Sorry, they are valid in my script, I was just removing the actual url being used: if (SendIt()){//The function above //Worked $MessageToSend .= "\n Uploaded File: (URL)/" . $_FILES["filename"]["name"]; $FileCheck = "<tr><td>File Upload:</td> <td>Success!</td></tr>"; }else{ //Didn't echo "send it returned false, FileCheck is: " . $FileCheck; } Is what it should be, the problem isn't there.
  6. I was checking the value of $FileCheck afterwards to check if the code had been executed, but it was always empty. I threw in some echoes and my mistake that code is being evaluated properly, but $FileCheck isn't being set properly. My code that calls the function is as follows and $FileCheck is always empty: if (SendIt()){//The function above //Worked $MessageToSend .= "\n Uploaded File: "(URL)/" . $_FILES["filename"]["name"]; $FileCheck = "<tr><td>File Upload:</td> <td>Success!</td></tr>"; }else{ //Didn't echo "send it returned false, FileCheck is: " . $FileCheck; }
  7. I'm working on a file upload script and have the following code: if ($_FILES["filename"]["error"] > 0){ if ($_FILES["filename"]["error"] == 1){ $FileCheck = "Failure, file size too large."; } echo "Error: " . $_FILES["filename"]["error"] . "<br />"; return false; }else{ //Do upload return true; } The line checking that error = 1 never evaluates to true, but the following echo statement spits out 1. I tried doing a "$_FILES["filename"]["error"] * 1" to force it to be an int but that didn't help. This seems very simple but I can't figure out why it isn't comparing properly?
  8. We are releasing a physical device to work with android/blackberry phones, not sure if I can say any details right now, but when we are ready to release we would like to have developers create some apps that take advantage of this device, maybe offering an early developer discount or something. Does anyone know of a good place to make such an offer or get developer interest?
  9. I opened it in notepad++ and set the encoding to ANSI, that's finally worked. Thanks a lot. I've been using dreamweaver for awhile now and not encountered this on any other pages. I don't see ANSI in the list of other encodings, I'll have to remember this workaround for any time it pops up in the future :/
  10. When I save the page I have the option to set the Unicode Normalization Form, for which I chose none. There is also a "Include Unicode Signature (BOM)" checkmark, which I made sure was unchecked. The same error remained. In my code I check the session for the users ID, and execute my sql queries using that. The queries are executing properly and displaying non-default information, so I must be grabbing my ID properly.....right?
  11. Since my code executes fine despite the warnings, would I be a bad man to just use error_reporting(0)?
  12. Thanks, I took care of that code halfway through the body, I'm forced to use dreamweaver for contribute functionality, it has bugged out and done things like that before. I read that topic and checked out the page in notepad, there doesn't seem to be anything before the <php, if there was would notepad pick it up or would I have to upload it outside of dreamweaver? I've also made sure UserID is set before using
  13. Yeah, once I realized the error that was spit out gave the url it was too late to modify the post. That's not encountered if you're logged in, a bit of laziness on my part.. no one should be seeing that.
  14. Line 1 is now <?php session_start(); I tried that to avoid any possible whitespace between line 1 and 2. E: Also I have checked for a space behind <php, there is nothing there.
×
×
  • 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.