Jump to content

dotancohen

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dotancohen's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I was hopint that maybe someone would be familiar with Prototype. Any other libraries that you could recommend? I was thinking of maybe going with the Y! library, Dotan Cohen http://lyricslist.com
  2. Hi all, I've got a form that I'd like to run through AJAX, using the Prototype library. However, whenever I try to run the form through Form.serialize() it gets submitted to the page specified in it's action attribute. For instance: [code] function sendFeedback(e) {     // Update user interface     $('response').innerHTML = 'Adding email address...';     // Prepare query string and send AJAX request     var pars = Form.serialize(addressForm);     var myAjax = new Ajax.Updater('response', 'ajaxServer.php', {method: 'get', parameters: pars});   // Stop form from submitting when JavaScript is enabled     Event.stop(e); } [/code] Causes the form to get submitted. However, when I replace: [code]     var pars = Form.serialize(addressForm); [/code] with: [code]     var pars = 'address=' + escape($F('address'))+'&address2=' + escape($F('address2')); [/code] The form then gets processed via AJAX as I intend. Why is that, and what can I do about it? Thanks in advance. Dotan Cohen http://what-is-what.com/what_is/ajax.html
  3. Thanks. I didn't escape the period because I want the period to match _any_ character, including spaces!
  4. I'm parsing a body of text for tags that use square brackets to identify themselves, like BBCode. These tags may contain alphanumeric characters, spaces, apostrophes, underscores, dashes, basic punctuation, and pipes. The closest that I've been able to come up with is: [code] $text=preg_replace_callback('/\[([A-Za-z0-9\¦\'.-:underscore:]+)\]/i' , "findLinks", $text); [/code] However, this does not match spaces for some odd reason (the "." should match them, I think). I've added "\s", "\w", " ", and ":space:" to the regex (tried both before the A-Z and after the 0-9) but for whatever reason those spaces are not detected. Why? What must I do? I'm certain that what I think is a space is most certainly a space. str_replace(" ", "", $text); closes the spaces, so I know that php does in fact see it as a space. I'm on php 5.x if it's relevant. Thanks in advance for any assistance. Dotan Cohen http://what-is-what.com
  5. Thanks for the advice. The grey links on the left are just random answers. I'll label them a bit more clearly. As for the logo, I like the way it looks plain, but if you have any suggestions on how I can make it seem less detached, then I'd love to hear them. Thanks.
  6. Thanks. I did see that, but it specifically says that it is easily circumvented with javascript on the tags I leave (and convert to bbcode). Maybe I need a way of removing all tag attributes before I run it through this.
  7. This is a new project of mine: http://what-is-what.com Please let me know what you think about the idea, the content, and the site design/layout. Be rough on me, I really want to know what I can improve. All comments welcome, especially the bad ones. Thanks. Dotan Cohen
  8. For one thing, you've no doctype and no character encoding specified on the page. So, how would you like the browser to render it at all? Assuming HTML 4.1 and UTF-8, you've got 15 coding errors on the page. The site looks clean in Firefox2 on Ubuntu. Although I've never seen them before, the icons seem very familiar, like they came off some old operating system or something. Nice. Dotan Cohen http://what-is-what.com/what_is/firefox.html
  9. The logo makes me a bit dizzy. Get rid of the reflection. You might want to add some more colour to the site, and better explain why your hit counter differs from the hundreds of others floating around the 'net. You should also know that you've got almost 30 errors in your html code. Dotan Cohen http://what-is-what.com/what_is/xhtml.html
  10. Interestingly, although I can view the page, when I try to check the HTML with th W3C validator it complains about a 500 error: "500 Can't connect to www.dev-tips.org:80 (Bad hostname 'www.dev-tips.org')" Did you configure the server not to serve to the validator? Other than that, the site looks clean. The php tips are bookmarked! Kepp adding them. Dotan Cohen http://what-is-what.com
  11. I'm setting up a comments system on a site, with the comments stored in a mysql database. To prevent sql-injection, I run mysql_real_escape_string() on ingoing data. This should be enough to protect the database (tell me if otherwise), but I'd like to prevent people from posting Javascript and other malicious html. Basically, I'd like the comments to be bbcode and text only, using this bbcode parser: http://il.php.net/manual/en/fu....php#69398 How can I strip the remaining html, javascript, and whatnot from the posts? If somebody has already invented this wheel, then I'd rather not risk a security breach by trying to reinvent it myself. Thanks in advance. Dotan Cohen http://lyricslist.com
×
×
  • 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.