Jump to content

dijona

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dijona's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. well I'm travelling so I don't have the whole code. I really thought the sample would be more than sufficient to let people know basically what's going on. The basic question, again, is: If I populate a form field with a session variable - submit the page - everything works great. BUT, if the form fails validation and reloads so user can enter/correct data - why does the field containing the session variable data disappear, and what can I do about it?
  2. yes, as I said it's just a snippet of code. the form displays fine with all the session variables - it's only when form validation fails (i.e. user didn't enter the email-to: field) and the form reloads that the session variables are lost.
  3. Well that's not actually that helpful. I know I'm a noob and all but... Well, i've managed to work out a few things, but I'm still stuck. Ok, here's the thing. I've got the form in PHP. some of the values are pre-populated text fields that use session variables and variables to hold the content. i.e. (PHP is just jotted down as an example..i know there are errors) snip... $myMSG = $_SESSION['Book']." ".$_SESSION['Chapter']; echo "<form...>"; (form stuff...) echo"<textarea name='message'>$myMSG</textarea>"; etc... <input type=\"submit\" value=\"Send Message\"> echo "</form>"; I've got some basic error-checking that validates the form. If it fails, It prompts the user to enter the missing/incorrect data. The problem is - when the form reloads, $myMSG is gone. So is this because my session data is being deleted on the submit? Is there any way I can have the form reload and still keep the value in $myMSG? thanks in advance!
  4. I'm wondering if anyone has any tips for saving a form state on reload? I know it can be done with JavaScript and cookies but I've got a hierselect element (2nd dropdown is dependent on selection from 1st dropdown) that seems to throw a wrench in things. Is there something built into quickform? anyone done something like this?
  5. Thanks so much for your help, that's just what I needed. Now, if it's not too much trouble.. how would i write the rule for the band 50/50 where obviously the problem is the slash (this time an actual slash, not the html code!!) I really need to write letters to all bands and ask them to use plain ol' vanilla characters. Once I figure that out (how to escape slashes) I think I can follow through to other examples on my own.
  6. yes, actually the xml file (the input) has the & and not & - I wasn't sure which regex to use - how would I allow & in my search forms?
  7. thanks beta0x64 - I'm still new to this but I was just using echo & the bunnymen as an example - not something to specifically escape. There are lots of bands that use an & in their name so I'm trying for a somewhat more global solution. I'd like to stick with preg_replace rather than htmlentities() or htmlspecialchars() because this function is already being used for most of my safe-search duties and working fine.
  8. I've got a php function that tries to make searches safer by stripping most non-essential characters. but I wanted to keep a character in there- specifically, the & sign. originally I had my regex pattern as: $patterns = '/[^a-zA-Z0-9\s]/'; but when I searched for Echo & the Bunnymen (for example) it returned search results for Echo. then I thought I'd add the & like so: $patterns = '/[^a-zA-Z0-9&\s]/'; \\added the & but that still doesn't do it. so how can I make sure users search for the whole string 'Echo & the Bunnymen'?
×
×
  • 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.