Jump to content

Rheves

Members
  • Posts

    45
  • Joined

  • Last visited

Everything posted by Rheves

  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.
  15. I never had two session start calls, sorry if I implied that somewhere. I was originally calling the session start within dbinfo.php and not on the calling page, but changed that during troubleshooting to remove dbinfo.php and call session start on the problematic page.
  16. This is what I get looking at the source code:
  17. We are not using a free host or have any content being inserted, that's just the file path on their server to our page I take it. FrenchTalkingDictionary.php is the problematic page.
  18. I've eliminated the included dbinfo.php for troubleshooting, it only had the db variables and session start call anyway. Here's my page up until the html begins: <?php session_start(); //DB Info $LoggedIn = "No"; if(isset($_SESSION['OK'])){ $LoggedIn = "Yes"; } //Mysql Queries ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> session_start() Is the first thing that happens, no output before it. I've made sure there's no spaces before it. The only other php code on the page is displaying the information gathered from the mysql queries.
  19. I changed the code to <?php //include_once("../members/dbinfo.php"); session_start(); //DBINFO HERE And now the error reads: I had included the session start call on that page because every page on the site needed it and the db connection string.
  20. I have several pages on my site using the exact same code at the very top, which works fine except for one page: <?php include_once("../members/dbinfo.php"); The top of dbinfo looks like this: <?php session_start(); And then the connection strings for the database However it is giving me this error on this one page: Now the session does actually start and doesn't prevent anything from working, I just get those messages. I'm at a loss as to why a different page with the exact same code, save for searching the database for a different product version would have this problem. I have had this code in place as well which works fine on other pages but doesn't help my problem at all: if(!isset($_SESSION['OK'])){ session_start(); } OK being a variable I set up during log in. I'm at a loss, is anyone able to help me out with this?
  21. When I create an excel file in php and try to open it I receive this error: "The file you are trying to open, "EmailUsers.xls", is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?" The data is all there as it should be but I do not want this error showing up. I've included the header code below and have tried changing the content type to application/x-msexcel and application/force-download but that didn't help any. Does anyone know what causes this? header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=EmailUsers.xls"); header("Pragma: no-cache"); header("Expires: 0");
  22. Thanks for the tips, he's decided the site should be a smaller width so I'll incorporate these changes when I make the switch over to the smaller site and see how it looks then.
  23. http://mike.otherskies.net/ I made this site for my friend, he provided a picture of what it should look like so I can't take credit for that. I made everything else and learned a bit of javascript in the process too. There is also a php backend to the site that allows him to add new pictures or remove them. Right now there are no concept art picture up but if he adds any to the database they will appear on the page. The #pictureName.jpg you get after clicking each picture is to provide a unique url for every picture, so art directors can click on one they like, and copy/paste whatever is in the address bar and it will automatically load picture that upon visiting the page. I'm not sure if this is where I'm supposed to ask but generally how much would a site like this cost for a client? I don't do freelance website work but it is something I might be interested in doing in the future.
×
×
  • 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.