Escape /unescape oddity in arrays

HI,
i have a data array that im breaking up correctly for what i
need, but ive started adding smaller arrays 'escaped' into this
array so that when i break it up i can unescape the sub arrays for
my purposes.
eg:
dataarray=1,2,f,2,4,%20ghgj%kglf,2,3 ( the escaped %% bit
altho not proper escaped is just to show as example where it
stands)
so when i extract the %20ghgj%kglf from the data array i can
unescape it into a further array of
subarray=20,ghgj,kglf
now this seems to work fine on testing but on publishing
doesnt work and by deduction sems to be the problem, ( if i remove
the escaped section of the array and replace with a normal variable
things work)
are there any known problems with escape/unescape in arrays
that i am missing?
many thanks for your time
shane

I don't understand what you're doing. Are you trying to
represent complex data in flashvars or external textfiles - e.g for
LoadVars?
If you are trying to represent an array as text so you can
recreate it in flash then you can do it with different delimiters.
So top level could be a comma and elements that are arrays
could be delimited with whatever you want e.g. a pipe character (|)
or maybe 2 pipe characters (||)
That way you just use String.split at each level as required.
But you can't easily specify the type of data.
For a more generic way of representing complex data in
flashvars or in loaded config files (i.e. from external text files
) you could try using a JSON implementation - check this out if so:
http://tinyurl.com/2a55z6

Similar Messages

  • Escape, unescape strings

    JavaScript have escape(), unescape() functions.
    How i can in JDeveloper make unescape()?

    In Java?
    The Java equivalent to these Javascript functions is:
    import java.net.URLEncoder;
    import java.net.URLDecoder;
    String unescapedString = URLEncoder.encode(
      "The string ü@foo-bar
    String escapedString = URLDecoder.decode(
      "The+string+%C3%BC%40foo-bar"
    );If you're using Java 1.4, you should specify an encoding like this:
    import java.net.URLEncoder;
    import java.net.URLDecoder;
    String unescapedString = URLEncoder.encode(
      "The string ü@foo-bar", "UTF-8"
    String escapedString = URLDecoder.decode(
      "The+string+%C3%BC%40foo-bar", "UTF-8"
    );

  • XML Diff escape/unescape

    When performing a diff between two xml files that may contain an escaped character i.e.
    <FIELD>This &amp; That</FIELD>
    The resulting xsl does not leave the & escaped producing invalid xml.
    <FIELD>This & That</FIELD>
    Is there some way to instruct the method to escape reserved characters or is the only solution to parse through resulting xsl and escape characters after the fact.

    Hi,
    You might want to try CDATA or the attribute <disable-output-escaping="yes"/>.
    Thanks,
    rajat

  • Bug report - Escaping list targets

    http://screencast.com/t/0WsRfR7nH192
    Minor nit - With all the security related changes in APEX 4.1 and 4.2, the Builder itself has missed a few places to properly escape/unescape stuff. See above. The Edit (List) Region page (4000:4651) shows the target page links escaped.
    Thanks

    Christian - Thanks. Would this cover the situation I pointed out recently in Apex 4.2 - App name escaped ?

  • Missing Javascript menu items on Acrobat 9 Standard

    I've been trying to get into some more advanced JS coding within Acrobat for forms, and I'm running into a bit of a roadblock in accessing the javascript tools.  Specifically, I keep seeing references to Javascript menu items under the Advanced menu, but my Acrobat doesn't seem to have these at all.  I also can't open the JS Debugger/console with Ctrl-J, but it will open if i put in a syntactically incorrect javascript statement and try to execute it (from a form field, etc).
    Anyone have any ideas how to correct this?  I found references online to this being an issue if Acrobat Reader is also installed on the same machine (it was), so i removed that, but the problem persists.  I can enter javascript into an individual field, but i can't add a document-level script at all.
    thanks

    Sweet! I got it working.   My function reads in the contents of a range (30+) of combo boxes and text boxes, does a little editing and then sorts, and then puts them back in the same range of boxes but with the blanks filtered out and in alpha order.  I  used a nested array and it worked pretty well. 
    The only thing i'm still stymied on is that it works perfectly for everything except if the textbox field is a number with a '+' in front of it (like +1 or +2200).  It strips the + sign out, I'm assuming that's because of javascript special characters, but the escape/unescape function did not fix it.  Doesn't matter if there are plus signs in the rest of the field, only at the beginning (and minus signs don't cause the same issue).  I'm going to try manually escaping with quotes before reading into the array I think, but if you have seen this sort of thing before please let me know.

  • Posting contact form to variable email address PHP

    Hi all, another one!
    I want the email address to be the hidden variable in the form below - variable higlighted in Red. What would I put for "$to ="?
    Any help would be appreciated.
    Tom
    <?php
    if (array_key_exists('send' , $_POST)) {
              // mail processing script
              // remove escape characters from POST array
    if (PHP_VERSION < 6 && get_magic_quotes_gpc()) {
      function stripslashes_deep($value) {
        $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
        return $value;
      $_POST = array_map('stripslashes_deep', $_POST);
    $to = '';
              $subject = '';
              //list expected fields
              $expected = array('name', 'email', 'comments');
              //set required fields
              $required = array('name', 'comments');
              //create empty array for any missing fields
              $missing = array();
              // assume that there is nothing suspect
              $suspect = false;
              // create a pattern to locate suspect phrases
              $pattern = '/Content-Type:|Bcc:|Cc:/i';
                // function to check for suspect phrases
      function isSuspect($val, $pattern, &$suspect) {
        // if the variable is an array, loop through each element
              // and pass it recursively back to the same function
              if (is_array($val)) {
          foreach ($val as $item) {
                  isSuspect($item, $pattern, $suspect);
                } else {
          // if one of the suspect phrases is found, set Boolean to true
                if (preg_match($pattern, $val)) {
            $suspect = true;
              // check  the $_POST array and any subarrays for suspect content
              isSuspect($_POST, $pattern, $suspect);
              if ($suspect) {
                        $mailSent = false;
                        unset($missing);
              } else {
              //proces the $_POST Variables
              foreach ($_POST as $key => $value) {
                        //assign temporary variable and strip whitespace if not an array
                        $temp = is_array($value) ? $value: trim($value);
                        //if empty and required, add to $missing array
                        if (empty($temp) && in_array($key, $required)) {
                                  array_push($missing, $key);
                        } elseif (in_array($key, $expected)) {
                                  //otherwise, assign to a variable of the same name as $key
                                  ${$key} = $temp;
              // validate the email address
      if (!empty($email)) {
        // regex to identify illegal characters in email address
        $checkEmail = '/^[^@]+@[^\s\r\n\'";,@%]+$/';
              // reject the email address if it doesn't match
        if (!preg_match($checkEmail, $email)) {
          $suspect = true;
          $mailSent = false;
          unset($missing);
              //go ahead ONLY if not suspect and all required fields OK
              if (!$suspect && empty($missing)) {
              // build the message
              $message = "Name: $name\r\n\r\n";
              $message .= "Email: $email\r\n\r\n";
              $message .= "Message: $comments\r\n\r\n";
              //limit line length to 70 characters
              $message = wordwrap($message, 70);
              //Create aditional headers
              $headers = "From: Website Enquiry\r\n";
              $headers .= 'Content-Type: text/plain; charset=utf-8';
              if (!empty($email)) {
              $headers .= "\r\nReply-To: $email";
              //send it
              $mailSent = mail($to, $subject, $message, $headers);
              if ($mailSent) {
                        //$missing is no longer needed if the email is sent, so unset it
                        unset($missing);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <?php
    if ($_POST && $mailSent) { ?>
    <META HTTP-EQUIV="Refresh" CONTENT="5;URL=index.php">
    <?php } ?>
    <title></title>
    <meta name="description" content="" />
    <meta name="keywords" content="" />
    <link href="style/style.css" rel="stylesheet" type="text/css" />
    <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-11804201-5']);
      _gaq.push(['_trackPageview']);
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    </script>
    </head>
    <body<?php if ($_POST && $mailSent){ ?> onLoad="redirect()"<?php } ?>>
    <img src="images/photography/background.jpg" alt="Jack Wilesmith Furniture Design" class="bg" id="bg" />
    <div id="container">
      <div id="Header">
      </div>
      <div id="content">
    <?php
    if ($_POST && isset($missing) && !empty($missing)) {
              ?>
        <p class="warning"><strong>Please complete the missing item(s) indicated.</strong></p><br />
        <?php
    } elseif ($_POST && !$mailSent) {
              ?>
        <p class="warning"><strong>Sorry, there was a problem sending your message, please try again later. </strong></p><br />
              <?php
    } elseif ($_POST && $mailSent) {
              ?>
        <p><strong>Your Message has been sent succesfully - <strong>You will be redirected in 5 seconds</strong></strong></p><br />
    <SCRIPT LANGUAGE="JavaScript"><!--
    function redirect () { setTimeout("go_now()",5000); }
    function go_now ()   { window.location.href = "index.php"; }
    //--></SCRIPT>
        <?php } ?>
        <form id="form1" name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
        <p>
          <label for="name">Name:</label><br />
          <input name="name" type="text" class="textInput" id="name"
          <?php if (isset($missing)) {
    echo 'value="' . htmlentities($_POST['name'], ENT_COMPAT, 'UTF-8') . '"';
    ?>
          /> <?php
                if (isset($missing) && in_array('name', $missing)) {?> <span class="warning">Please enter your name</span><?php } ?>
        </p><br />
        <p>
          <label for="email">Email:</label><br />
          <span id="sprytextfield1">
          <input name="email" type="text" class="textInput" id="email"
          <?php if (isset($missing)) {
    echo 'value="' . htmlentities($_POST['email'], ENT_COMPAT, 'UTF-8') . '"';
    ?>
          />
    <span class="textfieldInvalidFormatMsg">Invalid format.</span></span>
          <?php
                if (isset($missing) && in_array('email', $missing)) {?> <span class="warning">Please enter your Email Address</span><?php } ?>
        </p><br />
        <legend></legend>
        <p>
          <label for="comments">Message:</label><br />
          <textarea name="comments" id="comments" cols="45" rows="5"><?php if (isset($missing)) {
                        echo htmlentities($_POST['comments'], ENT_COMPAT, 'UTF-8');
                } ?></textarea><?php
                if (isset($missing) && in_array('comments', $missing)) {?> <span class="warning">Please enter a Message</span><?php } ?>
        </p><br />
        <p class="clearIt">
          <input name="send" type="submit" id="send" value="Send message" />
        </p>
         <input name="email" type="hidden" id="email" value="[email protected]" />
    </form>
    </div>
    </div>
    <script type="text/javascript">
    <!--
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "email", {isRequired:false, hint:"[email protected]"});
    //-->
    </script>
    </body>
    </html>

    Lovely, simple but beautiful!
    Thanks for that.
    T

  • Convert PHP Email Code to Using SMTP Authentication

    One of my contact forms no longer is able to send (it used to until some server updates were made), for it keeps posting the following error:
    Warning:  mail() [function.mail]: SMTP server response: 501 5.1.7 Invalid address in C:\contact.php on line 71
    This form does work on three other servers, so obviously the form is in working order but not on this particular server.
    I was recommended to "set the PHP script up to log in to       the SMTP server" using this example:
    http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm
    I've only gotten this far and cannot figure out how to actually create it to SEND:
    <?php
    // set flag to indicate whether mail has been sent
    $mailSent = false;
    if (array_key_exists('eList', $_POST)) {
        // mail processing script
        // remove escape characters from POST array
        if (get_magic_quotes_gpc()) {
        function stripslashes_deep($value) {
        $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
        return $value;
          $_POST = array_map('stripslashes_deep', $_POST);
    $email = $_POST['email'];
            // check for valid email address
        $pattern = '/^[^@]+@[^\s\r\n\'";,@%]+$/';
        if (!preg_match($pattern, trim($email))) {
        $error['email'] = 'Please enter a valid email address';
    // validate the input, beginning with name
        $name = trim($_POST['name']);
        if (empty($name)) {
            $error['name'] = 'Please enter your First Name';
        $lname = trim($_POST['lname']);
        if (empty($lname)) {
            $error['lname'] = 'Please enter your Last Name';
        $department = $_POST['department'];
        if ($_POST['department'] == '') {
        $error['department'] = 'Please select a Department';
    //     check the content of the text area
            $messageBody = trim($_POST['message']);
            if (empty($messageBody)) {
            $error['message'] = 'Please enter your message';
        // initialize variables
        if (!empty($_POST['url'])) {
        $to = '[email protected]';//
        $subject = 'Suspected as SPAM';
        $host = 'smptout.serverserver.net';
        $username = 'username';
        $password = 'password';
        } else {
        $to = '[email protected]';//
        $subject = 'Here we are';
        $host = 'smptout.serverserver.net';
        $username = 'username';
        $password = 'password';
            $SpamErrorMessage = "No URLs permitted";
        if (preg_match("/http/i", "$name")) {echo "$SpamErrorMessage"; exit();}
        if (preg_match("/http/i", "$lname")) {echo "$SpamErrorMessage"; exit();}
        if (preg_match("/http/i", "$email")) {echo "$SpamErrorMessage"; exit();}
        if (preg_match("/http/i", "$messageBody")) {echo "$SpamErrorMessage"; exit();} // check for spam
        //build the message
        $smtp = Mail::factory('smtp',
                                                                                                array('host' => $host,
                                                                                                                        'auth' => true,
                                                                                                                        'username' => $username,
                                                                                                                        'password' => $password));
        $message = "To: $department\r\n\r\n";
        $message .= "From: $name $lname\r\n";
        $message .= "$email\r\n\r\n";
        $message .= "Question/Comment: $messageBody";
        //build the additional headers
        $additionalHeaders = "From: Contact <[email protected]>\r\n";
        $additionalHeaders .= "Reply-To: $email";
    //send the email if there are not errors
        if (!isset($error)) {
        $mailSent = mail($to, $subject, $message, $additionalHeaders);
        // check that the mail was sent successfully
        if (!$mailSent) {
            $error['notSent'] = 'Sorry, there was a problem sending your mail. Please try later.';
    ?>
    Thank you for your help!

    Anyone?

  • Remote Desktop Services Single SSL Cert with multiple hosts

    I am trying to use a single SSL Cert from a third party issuer.  I have 3 servers in my deployement all are 2012R2.  One contains the RD Web Access role, RD Gateway role, RD Licensing role, and RD Connection Broker role.  The other 2 are
    RD Session Hosts.  I have the SSL cert for the server that has the Gateway and other roles.  My deployement is primarily focused on deploying RemoteApp to Windows 8 Thin clients with GPO through the default URL.  It works currently with the
    exception that the user gets a certificate mismatch error because it is seeing the cert for the gateway server but is connecting to the host servers so the names don't match.  Is anyone else using a similar setup and had success with it?  I am trying
    to avoid buying an expensive wildcard cert to cover all of them.

    Hi,
    Please verify that the .rdp file embedded in the RDWeb IE page matches the same one from RADC.  To do this, log on to RD Web Access using IE, right-click and choose View Source.  Find the goRDP function for the icon you want to examine and copy
    the text between the ' marks.  Next paste this into the escape text box the below page:
    http://www.web-code.org/coding-tools/javascript-escape-unescape-converter-tool.html
    Click complete unescape to get the plain text version.  After that you can select all of the text in the clear text box, paste it into a blank Notepad window, then save as a .rdp file.  Once you have the .rdp file created you can compare
    it to the other ones and see if any of the names are different, see if it gets the certificate error as well when you double-click it, etc.
    Do you have any proxy or other non-default network configuration on your Windows 8 embedded clients?
    Thanks.
    -TP

  • Problems using a php include file with an Add-on Domain.

    Hello,
    I am having an issue getting a php include file to work with a new add-on domain I am working on getting up and running.
    This include file is one that supplies the rest of the php code to a contact form page.  It works as it should for my original domain, same file no difference.  I made sure that the files hosted on the remote server had all read, write, execute permissions turned on.
    I have tried putting the include file in several different locations as a test, such as:
    I don't remember the exact name of the include file at the moment, as I'm at work so I will designate it below as 'includefile.php'.
    file path for add-on domain - ../public_html/lorentzpainting/includes/includefile.php
    alternatives I tried moving the file to - ../public_html/lorentzpainting/includefile.php
    When none of those options worked, I tried just pointing the path towards other places on the server that have the include file such as:
    ../public_html/includes/includefile.php
    ../public_html/includefile.php
    What can I do here?  Should I just give up on using the include and put all the code back in the page?  Doesn't seem like it should be this complicated, it works perfectly fine for my other site.. and still does.
    Thanks ahead of time to those who may assist me.

    here is the contents of the include file:
    <?php
    if (isset($_SERVER['SCRIPT_NAME']) && strpos($_SERVER['SCRIPT_NAME'],
    '.inc.php')) exit;
    // remove escape characters from POST array
    if (PHP_VERSION < 6 && get_magic_quotes_gpc()) {
      function stripslashes_deep($value) {
        $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
        return $value;
      $_POST = array_map('stripslashes_deep', $_POST);
      // assume that there is nothing suspect
        $suspect = false;
        // create a pattern to locate suspect phrases
        $pattern = '/Content-Type:|Bcc:|Cc:/i';
          // function to check for suspect phrases
      function isSuspect($val, $pattern, &$suspect) {
        // if the variable is an array, loop through each element
        // and pass it recursively back to the same function
        if (is_array($val)) {
          foreach ($val as $item) {
            isSuspect($item, $pattern, $suspect);
        else {
          // if one of the suspect phrases is found, set Boolean to true
          if (preg_match($pattern, $val)) {
            $suspect = true;
    //check the $_POST array and any subarrays for suspect content
    isSuspect($_POST, $pattern, $suspect);
        if (!empty($_POST['url'])) {
            $suspect = true;
        if ($suspect) {
            $mailSent = false;
            unset($missing);
        } else {
        //process the $_POST variables
        foreach ($_POST as $key => $value) {
            // assign to temporary variable and strip whitespace if not an array
            $temp = is_array($value) ? $value : trim($value);
            // if empty and required, add to $missing array
            if (empty($temp) && in_array($key, $required)) {
                array_push($missing, $key);
            } elseif (in_array($key, $expected)) {
                // otherwise, assign to a variable of the same name as $key
                ${$key} = $temp;
        //validate the email address
        if (!empty($email)) {
            // regex to identify illegal characters in email address
    $checkEmail = '/^[^@]+@[^\s\r\n\'";,@%]+$/';
    //reject the email address if it doesn't match
    if (!preg_match($checkEmail, $email)) {
        $suspect = true;
        $mailSent = false;
        unset($missing);
    //go ahead only if all required fields OK
        if (!$suspect && empty($missing)) {
    //initialize the $message variable
            $message = '';
    // loop through the $expected array
            foreach($expected as $item) {
    // assign the value of the current item to $val
                if (isset(${$item}) && !empty(${$item})) {
                    $val = ${$item};
                } else {
    // if it has no value, assign 'Not selected'
                    $val = 'Not selected';
    // if an array, expand as comma-sparated string
                if (is_array($val)) {
                    $val = implode(',', $val);
    // add label and value to the message body
      $message .= ucfirst($item).": $val\r\n\r\n";
    //limit line length to 70 characters
        $message = wordwrap($message, 70);
    //create Reply-To header
        if (!empty($email)) {
            $headers .= "\r\nReply-To: $email";
    // send it
        $mailSent = mail($to, $subject, $message, $headers);
        if ($mailSent) {
    // $missing is no longer needed if the email is sent, so unset it
            unset($missing); echo('Thank you for contacting Common Wealth Web Solutions');
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    </body>
    </html>

  • PHP form strange behaviors

    I have a very basic PHP form coded and whenever I look at it in Live View the bottom third of the processing code appears at the top of the webpage. Uploaded the code does not appear on the webpage and the form works fine, except that the dropdown initial values I have set are ignored.
    The form URL:  http://affordableroofingcontractors.com/contact-us.php
    The dropdown code: (I want "select one" displayed but the form shows "Re-roofing" instead!?)
    <select name="service" id="service">
                <option value="0" selected="selected"
                <?php if (!$_POST ||$_POST['service'] =='0') {
        echo 'selected="selected"'; }?>>--select one--</option>
                <option value="Proactive Roof Maintenance"
                <?php if (!$_POST ||$_POST['service'] =='Proactive Roof Maintenance') {
        echo 'selected="selected"'; }?>>Proactive Roof Maintenance</option>
                <option value="Roof Repairs"
                 <?php if (!$_POST ||$_POST['service'] =='Roof Repairs') {
        echo 'selected="selected"'; }?>>Roof Repairs</option>
                <option value="Re-roofing"
                 <?php if (!$_POST ||$_POST['service'] =='Re-roofing') {
        echo 'selected="selected"'; }?>>Re-roofing</option>
              </select>
    The processing code:
    <?php
    if (array_key_exists('submit', $_POST)){
    //mail processing script
    // remove escape characters from POST array
    if (PHP_VERSION < 6 && get_magic_quotes_gpc()) {
      function stripslashes_deep($value) {
        $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
        return $value;
      $_POST = array_map('stripslashes_deep', $_POST);
    if (!empty($_POST['area'])) {
      $to = '[email protected]';
      $subject = 'SUSPECTED BOT SUBMISSION from ACI quote form';
    } else {
    $to = '[email protected]';
    $subject = 'ACI CONTACT FORM';
    //list expected fields
    $expected = array('name','company','phone','email','service','building','comments');
    //set required fields
    $required = array('name','email','phone');
    //create empty array for any missing fields
    $missing = array();
    //assume there is nothing suspect
    $suspect = false;
    //create a pattern to locate suspect phrases
    $pattern = '/Content-Type:|Bcc:|Cc:/i';
       // function to check for suspect phrases
      function isSuspect($val, $pattern, &$suspect) {
      // if the variable is an array, loop through each element and pass it recursively back to the same function
    if (is_array($val)) {
          foreach ($val as $item) {
         isSuspect($item, $pattern, $suspect);
        else {
          // if one of the suspect phrases is found, set Boolean to true
       if (preg_match($pattern, $val)) {
            $suspect = true;
    //check the Post array and any subarrays for suspect content
    isSuspect($_POST, $pattern, $suspect);
    if ($suspect) {
    $mailSent = false;
    unset($missing);
    } else {
    //process POST variables
    foreach ($_POST as $key => $value){
    //assign to temporary variable and strip whitespace if not an array
    $temp = is_array($value) ? $value : trim($value);
    //if empty and required, add to $missing array
    if (empty($temp) && in_array($key, $required)) {
      array_push($missing, $key);
    } elseif (in_array($key, $expected)) {
    //otherwise, assign to a variable of the same name as $key
      ${$key} = $temp;
    //validate the email address
    if (!empty($email)) {
    // regex to identify illegal characters in email address
    $checkEmail = '/^[^@]+@[^\s\r\n\'";,@%]+$/';
    //reject the email address if it doesn't match
    if (!preg_match($checkEmail, $email)){
      $suspect = true;
      $mailSent = false;
      unset($missing);
    //go ahead only if not suspect and all required fields OK
    if (!$suspect && empty($missing)) {
    //build the message
    $message = "Name: $name\r\n\r\n";
    $message .= "Company: $company\r\n\r\n";
    $message .= "Phone: $phone\r\n\r\n";
    $message .= "Email: $email\r\n\r\n";
    $message .= "Service Needed: $service\r\n\r\n";
    $message .= "Type of Building: $building\r\n\r\n";
    $message .= "Comments: $comments";
    //limit line length to 70 characters
    $message = wordwrap($message, 70);
    //create additional headers
    $headers = "From: $email>\r\n";
    $headers .= 'Content-Type: text/plain; charset=utf-8';
    if (!empty($email)) {
      $headers .= "\r\nReply-To: $email";
    //send it
    $mailSent = mail($to, $subject, $message, $headers);
    if ($mailSent) {
    //$missing is no longer needed if email is sent, so unset it
    unset($missing);
    ?>

    Hi!
    To select php form you should create a  menu,  fill out the type of "choice of one item of many" or "Select multiple  items from the many." Must be inside FORM element and have at the start  or end tags. It contains several elements OPTION, otherwise it makes no  sense.
    Example:
    <HTML> <body>
    <form method='post' action='all.php'>
         Color Scheme: <br>
        <SELECT NAME="color">
          <OPTION VALUE="Standard" SELECTED> </ OPTION>
          <OPTION VALUE='Brick'> Brick </ OPTION>
          <OPTION VALUE='Gray Mouse'> Gray Mouse </ OPTION>
          <OPTION VALUE='Ship Bottom'> Ship Bottom </ OPTION>
          <OPTION VALUE='Black Night'> Black Night </ OPTION>
          <OPTION VALUE='White Light'> White Light </ OPTION>
          <OPTION VALUE='Yellow List'> Yellow List </ OPTION>
          <OPTION VALUE='Pink Myth'> Pink Myth </ OPTION>
          <OPTION VALUE='Green USD'> Green USD </ OPTION>
          <OPTION VALUE='Standard'> Standard </ OPTION>
        </ SELECT>
    <input type='submit' name='submit' value='go'>
    </ form>
    </ body> </ HTML>2

  • URL Encode and Decode

    Hi Experts,
    My Oracle Version:
    BANNER                                                                         
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production         
    PL/SQL Release 11.1.0.7.0 - Production                                         
    CORE     11.1.0.7.0     Production                                                     
    TNS for 32-bit Windows: Version 11.1.0.7.0 - Production                        
    NLSRTL Version 11.1.0.7.0 - Production                                         
    5 rows selected.I got the requirement to check any URL encode and decode methods available in common for O racle and PHP,
    Since URL will be encoded in database at the time of retreiving data from database but it will be decoded in PHP without db connection.
    Hope my scenario will be clear to you, is any common function available in oracle and php for this process?

    but escape, unescape just adds %20 for empty space in the URLwell it does a bit more: it escapes all special characters that should not be in a URL, e.g.
    SQL> select utl_url.escape('#^|%µ ') escaped_url from dual
    ESCAPED_URL                                                                    
    %23%5E%7C%25%B5%20                                                             
    1 row selected.Can you give an example of how you want a completely converted url, and why?

  • I have adapted a php contact form of David Powers tut

    Hi I have slowly changed according to my research etc. I am
    worried that since changing things that I have left some important
    error checking.
    Well here is the error checking and the form:
    <h2><span class="black">contact us :
    </span></h2>
    <span class="errmsg1">
    <?php
    if ($error) {
    echo 'Please complete the missing item(s) indicated.';
    // remove escape characters from POST array
    if (get_magic_quotes_gpc()) {
    function stripslashes_deep($value) {
    $value = is_array($value) ? array_map('stripslashes_deep',
    $value) : stripslashes($value);
    return $value;
    $_POST = array_map('stripslashes_deep', $_POST);
    ?>
    </span>
    <form name="option" id="option" method="post"
    action="<?php $_SERVER['PHP_SELF']; ?>">
    <label> </label>
    <table width="70%" border="0" cellspacing="0"
    cellpadding="0">
    <tr>
    <td>Your Name</td>
    <td><input name="name" type="text" class="search"
    id="name" value="<?php if (isset($_POST['name'])) {
    echo htmlentities($_POST['name']);} ?>" size="30"
    maxlength="50" /></td>
    </tr>
    <tr>
    <td> </td>
    <td><?php if (isset($error['name'])) { ?>
    <span class="errmsg1"><?php echo $error['name'];
    ?></span>
    <?php } ?> </td>
    </tr>
    <tr>
    <td><span class="subheader">Your Email
    Address</span></td>
    <td><span class="subheader">
    <input name="email" type="text" id="email"
    value="<?php if (isset($_POST['email'])) {
    echo htmlentities($_POST['email']);} ?>" size="30"
    maxlength="80" />
    </span></td>
    </tr>
    <tr>
    <td> </td>
    <td><?php if (isset($error['email'])) { ?>
    <span class="errmsg1"><?php echo $error['email'];
    ?></span>
    <?php } ?> </td>
    </tr>
    <tr>
    <td>Reason For Enquiry </td>
    <td><label>
    <select name="option">
    <option value="">Please Select Option</option>
    <option value="complaint"<?php
    if (isset($error) && $_POST['option'] ==
    'complaint') { ?>
    selected="selected"
    <?php } ?>>Complaints</option>
    <option value="listbusiness"<?php
    if (isset($error) && $_POST['option'] ==
    'listbusiness') { ?>
    selected="selected"
    <?php } ?>>List My Business </option>
    <option value="removelisting"<?php
    if (isset($error) && $_POST['option'] ==
    'removelisting') { ?>
    selected="selected"
    <?php } ?>>Remove My Listing</option>
    <option value="upgradelisting"<?php
    if (isset($error) && $_POST['option'] ==
    'upgradelisting') { ?>
    selected="selected"
    <?php } ?>>Upgrade Listing</option>
    <option value="banner"<?php
    if (isset($error) && $_POST['option'] == 'banner') {
    ?>
    selected="selected"
    <?php } ?>>Banner Advertising</option>
    <option value="agentenquiry"<?php
    if (isset($error) && $_POST['option'] ==
    'agentenquiry') { ?>
    selected="selected"
    <?php } ?>>Become An Agent</option>
    <option value="other"<?php
    if (isset($error) && $_POST['option'] == 'other') {
    ?>
    selected="selected"
    <?php } ?>>Other</option>
    </select>
    </label></td>
    </tr>
    <tr>
    <td> </td>
    <td><?php if (isset($error['option'])) { ?>
    <span class="errmsg1"><?php echo $error['option'];
    ?></span>
    <?php } ?> </td>
    </tr>
    <tr>
    <td>Message</td>
    <td><label>
    <textarea name="message" cols="30" rows="3"
    id="message"><?php if(isset($error)) {echo $messageBody;}
    ?>
    </textarea>
    </label></td>
    </tr>
    <tr>
    <td> </td>
    <td><?php if (isset($error['message'])) { ?>
    <span class="errmsg1"><?php echo $error['message'];
    ?></span>
    <?php } ?> </td>
    </tr>
    <tr>
    <td> </td>
    <td><label>
    <input name="send" type="submit" class="searchbutton"
    id="send" value="Enquiry" />
    </label></td>
    </tr>
    </table>
    <label> </label>
    <p><span class="subheader">
    <label> </label>
    </span></p>
    </form>

    jjjhbj111 wrote:
    > Hi I have slowly changed according to my research etc. I
    am worried that since
    > changing things that I have left some important error
    checking.
    I haven't gone through your script with a fine-tooth comb,
    but your
    email check uses a POSIX regular expression, which won't work
    with
    preg_match(). You could use eregi() instead, but there are
    plans to
    remove the ereg_ functions from PHP 6, so you would be better
    advised to
    stick with Perl-compatible regular expressions (PCRE).
    David Powers, Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Flash unescape vs. php urlencode

    Hi, the thing is more or less like this: i am sending from some flash app some text to be stored in a database. before i keep it in the database, in the server side, i escape (or in this case i urlencode, the server script is in php). it stores the escaped or url encoded string before attaching it to a sql sentence, hopefully without "s or 's. now to retrieve it, i get it inside an xml node, so it comes just as it was kept in the database (if i have gotten it in a urlvar it would have come unescaped). when i unescape it ant display it, the spaces are replaced by '+'. i have tried trhis page:
    http://meyerweb.com/eric/tools/dencoder/
    it seems to get it right either in php format (with +), or with flash (with %20), seems to be equivalent. how do i set them to agree, between the flash and php escapes? are there any alternative ways either in flash or in php to url-encode, or does any of those receive parameters?
    tnx

    decided to implement my own 'flash_compatible_encode' php escape.
    var _array_con:String = "$_conv = array(";
    var _cont:Number = 0;
    var _char:String;
    while (_cont<255) {
        _char = String.fromCharCode(_cont);
        _array_con += "\"" + escape(_char) + "\", ";
        _cont += 1;
    _array_con += ");";
    trace(_array_con);
    // remove the last comma, then use 'ord' in php as search index

  • How to escape the single quote from email value?

    Hi,
    Is there any way to escape the special character single quote from the email value.
           String ownerQry = "Select Id, email from User where email in('0000'";
            for(int i=0; i<accountData.length; i++)
                ownerQry += ",'" + accountData.TEAM_EMAIL+"'";
    ownerQry += ")";
    QueryResult qrTeam = sfdcCtrl.query(ownerQry);
    When i tried to set the email value on a custom object, its throwing the error as below  and failed to update. <xml-fragment xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><faultcode>sf:MALFORMED_QUERY</faultcode><faultstring>MALFORMED_QUERY:
    '[email protected]','brenden.o'[email protected]','[email protected]'
    ^ ERROR at Row:1:Column:963 expecting a right parentheses, found 'connor'</faultstring><detail><sf:fault xsi:type="sf:MalformedQueryFault" xmlns:sf="urn:fault.enterprise.soap.sforce.com"><sf:exceptionCode xmlns:sf="urn:fault.enterprise.soap.sforce.com">MALFORMED_QUERY</sf:exceptionCode><sf:exceptionMessage xmlns:sf="urn:fault.enterprise.soap.sforce.com">
    '[email protected]','brenden.o'[email protected]','[email protected]'
    ^ ERROR at Row:1:Column:963 expecting a right parentheses, found 'connor'</sf:exceptionMessage><sf:row xmlns:sf="urn:fault.enterprise.soap.sforce.com">1</sf:row><sf:column xmlns:sf="urn:fault.enterprise.soap.sforce.com">963</sf:column></sf:fault></detail></xml-fragment>

    Thanks Dr.Clap.
    I think its very tricky to implement this.
    Here is the SOQL query. i am passing all the email values.
    Select Id, email from User where email in('0000','o\'[email protected]','[email protected]')
    These values are coming from oracle DB table in the form of array accountData[].TEAM_EMAIL
            String ownerQry = "Select Id, email from User where email in('0000'";
            for(int i=0; i<accountData.length; i++)
               ownerQry += ",'" + accountData.TEAM_EMAIL+"'";
    ownerQry += ")";the array value may contain the email with single quote before @gmail.com which i need to ignore. :-( i think this is very tricky. who knows the solution for this?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • XML escaping issue in ABAP during XML file transfer to App. Server.

    Hello Partners:
    I was going through some work of XML integration of SAP with a third-party. But came across an issue:
    The text descriptions we are sending within an XML tag has certain special characters like '&'. But the XML parser is not escaping it. Hence its replacing '&' with "&amp;" in the XML data string. So now I need to understand how can we implement escaping via ABAP for generated XML strings? Can you all please help me to understand which methods to use and how?
    It will be much appreciated.
    Thanks in advance.
    Vivek Singh.

    Hello SAP Friends!
    I'm facing the same problem concerning special chars in XML. I've tried to unescape the '&' sign with methods of if_ixml_ostream
       l_ostream->set_ignore_escaping( ignore_escaping = '&' ).
    the character is set and can be called by
      l_str = l_ostream->get_ignore_escaping( ).
    After the rendering was done and the download has finished the xml document can be loaded in EXCEL but the special characters are replaced by & a m p;
    Has anybody found a method to avoid the behaviour?
    My original problem is, the the data have to be in one cell in excel. I know at present no method to download data (text including line feeds) from SAP to excel into one cell.
    Maybe you have found a way to use  ignore_escaping in correct way!
    Thanks a lot in advance!!!

Maybe you are looking for