Jump to content

zachninme

Members
  • Posts

    12
  • Joined

  • Last visited

Posts posted by zachninme

  1. Argh! I tested it, and thought it worked, but I guess I didn't test it thoughly enough. I might have to make up the string.Figured a solution that seems to work, escaping & to "%2526". The PHP decodes some stuff anyway, so this fit right in.

  2. That won't work either.I might have to make up a string that I can hope no users use by accident.This is really puzzling :)EDIT: Haha, found the problem.1. I used the JS function encodeURI, which doesn't encode &'s2. I then used "content = content.replace(/&/, "%26");", in which I forgot the g (/&/g)Sorry :)

  3. I don't think you understand...I guess this is on the wrong board, now that I think about it, but what happens is I'm sending the POST string, and in it, are escaped &'s. PHP takes this, and thinks its the next item in the $_POST array.So when I send "blah<span id='hey'>yeah</span>", the < and > ito <, and >, respecively.When it sends it as "blah<span id='hey..." It has "blah" as one item, then $_POST['lt;span id='] = "'hey...";

  4. I have a site where I am using a WYSIWYG editor, and I am saving the documents using AJAX methods, sending the data through javascript to a PHP page. There are some things that I have to encode, for instance "<", into "<". When I want to save, I get the HTML, then use the JS function urlencode(), and then send it to a PHP in a POST string.After wondering why it was always incomplete, I found that the encoded & tricked PHP into thinking that it was another parameter.Thanks to anyone who can figure this out!

  5. Hello.I am working on something where I want my users to be able to vote on numerous submitted items. I also want to make sure that no one votes twice or anything.How should I set up my tables to disallow users from voting more than once on each item?Thanks in advanced!

  6. Hello!I have a site where I am trying to get data from a DB, using a PHP script, but then I want to be able to access that data by calling a JS function, and have the data returned.The PHP script works fine, and the data is always returned within a second or so, but I can't figure out how to merge the following two functions (adapted from the tutorial)

    var myScorefunction loadScores(){xmlHttp=GetXmlHttpObject()if (xmlHttp==null)  {  alert ("Browser does not support HTTP Request")  return  } var url="getscore.php"xmlHttp.onreadystatechange=stateChangedxmlHttp.open("GET",url,true)xmlHttp.send(null)//while(myScore==undefined)//{}//return myScore}function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") {  myScore=xmlHttp.responseText  } }

    I tried doing something like what is commented out, but it went into a loop and never came out.TIA!

×
×
  • Create New...