Convert 'chr' php function in jsp

Hello everybody
I'll try to convert this php code in jsp but i've got several errors when using the "replaceAll" java function.
I aim to have an html editor to insert it in my website forum.
Can somebody help to solve this problem, otherwise, can anyone provide me an example of an html editor written in jsp.
$conceptRTEvalue = str_replace(chr(92).chr(34),chr(34),$conceptRTEvalue);
//convert all types of single quotes
   $tmpString = str_replace(chr(145), chr(39), $tmpString);
   $tmpString = str_replace(chr(146), chr(39), $tmpString);
   $tmpString = str_replace("'", "'", $tmpString);
   //convert all types of double quotes
   $tmpString = str_replace(chr(147), chr(34), $tmpString);
   $tmpString = str_replace(chr(148), chr(34), $tmpString);
   //replace carriage returns & line feeds
   $tmpString = str_replace(chr(10), " ", $tmpString);
   $tmpString = str_replace(chr(13), " ", $tmpString);

What are the errors?

Similar Messages

  • Same as PHP Functionality In JSP, HOw?

    Hi,
    I am a developer having experiance in PHP with Oracle, I recently have projects to develop in JSP, I want know does JSP also have the Variable in Variable functioanlity in as it's available in PHP?
    In php I stored my variable name in a PHP variable as
    $Asif='My Name is Asif';
    $a='Asif';
    Echo "Here we can get the result of variable Asif using variable a: ".$$a;
    in the above by using $$ it understand the inside value is the actual variable name whose value is to print..
    I need same functionality in JSP.....
    if Any one can help...
    THanks in Advance.
    Asif

    The same rule applies for textboxes as for checkboxes with the same name - indeed for any components accessed in the dom via javascript.
    If there is only one element of that name, it is accessed directly.
    If there is more than one element of that name, it reveals them as an array.
    so document.testForm.a_date would return an array of input fiels
    document.testForm.a_date[0], document.testForm.a_date[1] ... document.testForm.a_date[n]
    However the order of submission of parameters is NOT guarunteed, which is why people normally DON'T have fields in this manner - because you can't know for certain that a_date[1] matches with b_date[1] at the server end.
    The common practice is to give each field a unique name (numbered).

  • Convert from php to java

    Hello all,
    Can someone convert this code from php to java.
    <?php
    function bitbybit_crc32($str,$first_call=false){
    //reflection in 32 bits of crc32 polynomial 0x04C11DB7
    $poly_reflected=0xEDB88320;
    //=0xFFFFFFFF; //keep track of register value after each call
    static $reg=0xFFFFFFFF;
    //initialize register on first call
    if($first_call) $reg=0xFFFFFFFF;
    $n=strlen($str);
    $zeros=$n<4 ? $n : 4;
    //xor first $zeros=min(4,strlen($str)) bytes into the register
    for($i=0;$i<$zeros;$i++)
    $reg^=ord($str{$i})<<$i*8;
    //now for the rest of the string
    for($i=4;$i<$n;$i++){
    $next_char=ord($str{$i});
    for($j=0;$j<8;$j++)
    $reg=(($reg>>1&0x7FFFFFFF)|($next_char>>$j&1)<<0x1F)
    ^($reg&1)*$poly_reflected;
    //put in enough zeros at the end
    for($i=0;$i<$zeros*8;$i++)
    $reg=($reg>>1&0x7FFFFFFF)^($reg&1)*$poly_reflected;
    //xor the register with 0xFFFFFFFF
    return ~$reg;
    $str="123456789"; //whatever
    $blocksize=4; //whatever
    for($i=0;$i<strlen($str);$i+=$blocksize) $crc=bitbybit_crc32(substr($str,$i,$blocksize),!$i);
    ?>

    I am looking someone to help me w/o $.Go away.
    This reminds me of this one time. I had written this dice roller in PHP (still in use, actually) and someone who was using it thought it was nice and wanted a version of it for himself. Only he was running a different game system, some home brewn thing, so it had to be different in certain respects.
    First he just asked me if he could have the dice roller I wrote. I thought about it but eventually agreed. It wasn't much as code. Then he asked me to modify it for him, explaining that he could not do it himself. For some reason I was feeling generous that day, so I did not ask him for his physical address and send him a mail bomb. Instead I said that I would modify it for him if he explained what modifications he needed.
    Then he told me to go read his game system on his web site and figure it out for myself. I must have been in a saintly attitude that day because I actually went and looked at his site - which predictably, was totally disorganized and incomprehensible. I pointed this out and he told me that I would have to read through everything once or twice, and also, it wasn't done yet so I should check back periodically.
    This is a person who I had never met in my life, even online, and with whom my first contact was his request for my dice roller.
    Where do these people COME from?
    Drake

  • Can we call a php function into coldfusion coding?????????

    can we call a php function into coldfusion??
    if anybody knows that let me know....

    Nope, as IIS can only pass one page to one handler, so it gets passed to ColdFusion *or* PHP. The only way it would work is to have a page with an iFrame containing a PHP page, but that's not calling a PHP function from ColdFusion.
    Dare I ask what it is you're trying to achieve exactly? If it's an extremely complicated function that can't possibly be rewritten, you'd probably want to wrap it up in a webservice and call it from CF.

  • How to call java script function from JSP ?

    how to call java script function from JSP ?

    i have function created by java script lets say x and i want to call this function from jsp scriplet tag which is at the same page ..thanks

  • Access session variable in Java Function in JSP

    Hi Experts !!
    I am developing an application using STRUTS MVC...
    Very sorry if u have problem understanding my question, i ll try to improve... and sorry if i can't post codes here
    Basic question is ....
    I want to open a word document on pageLoad of JSP, the word document is not a single document, there is a form in which there is a "name" and "template" whenever user clicks on a button there is one action attached to it which creates a copy of that template in a different folder.. on the next page OnLoad i want to open that particular document. for that i have created a variable and also have set in the session, just want to access it in the below code.
    I have a formbean in which i have a variable, the scope is session, that variable i have put it in session also. but i want to access that variable in a "java function" in JSP so that "onLoad" page that function should work.
    JSP---
    <script type="text/javascript">
    function openDocument() {
    var w = new ActiveXObject("Word.Application");
    var docText;
    var obj;
    var a;
    if (w != null) {
    w.Visible = true;
    obj = w.Documents.Open(I HAVE TO ACCESS THAT VARIABLE HERE);
    </script>
    FORMBEAN----
    public class CreateSOWFormBean extends ActionForm {
    private String workflowName;
    private String comment;
    private String sowTemplate;
    private String sowFileCreated;
    public String getSowFileCreated() {
    return sowFileCreated;
    public void setSowFileCreated(String sowFileCreated) {
    this.sowFileCreated = sowFileCreated;
    sowFileCreated is the variable that i have accessed in session and that value i have to pass in that function in JSP....
    I am aware of something like
    obj = w.Documents.Open(<%'sowFileCreated'%>);
    but i m not sure how to write....
    Plz help.....

    If you're working under a framework like struts you should definitely be using JSTL tags rather than scriptlet code to access variables within the page. With JSTL code <% codes can be almost entirely avoided.
    To transfer a value from a Servlet to a JSP don't use a session variable, use a request attribute. Session variables should only be used when values have to survive from one transaction to another.
    You can write something like:
    obj = w.Documents.open('<c:out value="${openURL}"/>');in the Javascript portion of your JSP.
    Just beware of potential problems with quotes. The coresponding code in the Servlet would be like:
    request.setAttribute("openURL", openUrl);

  • PHP Function List in Dreamweaver?

    Does Dreamweaver MX 2004 (or later versions) have the
    capability of pulling up a list of PHP functions you've created in
    code view --- where you could click on a function name and your
    cursor or focus would be automatically directed to the start of the
    function? I know this capability is available in other text/code
    editors such as Notepad++, but I didn't know if this feature was
    somewhere available in Dreamweaver --- perhaps in a plug-in?
    Thanks,
    Ryan

    rkdiekhoff wrote:
    > Does Dreamweaver MX 2004 (or later versions) have the
    capability of pulling up
    > a list of PHP functions you've created in code view ---
    where you could click
    > on a function name and your cursor or focus would be
    automatically directed to
    > the start of the function?
    I don't know about MX 2004, but it's definitely available in
    CS3 and the
    beta of CS4. Right-click in Code view and select Functions
    from the
    context menu. It displays a full list of user defined
    functions. Click
    one of them, and you're taken directly to the function
    definition.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Enable data paging with parameters count() on new php function issue (BUG?)

    I've got my app prototyped quickly with the default settings in Flex Builder 4.  Now I'm going back and adding/modifying features to polish the app off.
    For this application I'm using PHP5 as the server side.
    The data paging is really cool and simple to call using the default settings.  However, I'm running into issues with customizing the data paging feature.
    This is the default header of the php function that was created for me:
    public function getTblbrowserrecord_paged($startIndex, $numItems){...}
    Instead of dumping all data back to the function I want to be able to search on certain fields so I created a new function called:
    getTblbrowserrecord_search_paged ($szName, $szIP, $szRule, $szURL, $szDateLow, $szDateHigh, $szCode, $startIndex, $numItems  ) {...}
    The new function is tested and operates as designed.
    I set the input types of the variables and return type (Tblbrowserrecord[]) of the new function then went to enable data paging.  The first screen came up and asked me for the key to use which I selected.  The next screen came up and asked me for the number of records which I set to 100 then went to select the count operation.
    I initially selected the automatically created count() function but it came up with the error " Count operation parameters should match the paged operation parameters list."
    So I created another function to match the search function's parameter's list:
    public function count_searched($szName, $szIP, $szRule, $szURL, $szDateLow, $szDateHigh, $szCode, $startIndex, $numItems)  {...}
    But I still ge the error "Count operation parameters should match the paged operation parameters list."
    But they DO match.  I looked at the default functions that were created by FB4 and noticed that the automatically generated function count() has no parameters and the paged function has the two functions $startIndex and $numItems which are not identical yet they work.  I tried removing those two fields from the count function but got the same results.
    What am I doing wrong?
    Thanks!

    Nevermind... For some reason my FB4 is not updating correctly.  After removing the two control fields at the end of the list AND exiting the app/re-entering everything worked ok.  I've been having this issue a lot lately and am thinking that is is a bug of some sort?

  • Are there different php functions for Oracle 8 and 9?

    Hi!
    Are there different php functions for Oracle 8 and 9?
    Thanks for your answer!

    You can use the oci8* functions for Oracle 8, 9 and 10.
    It is the most recent PHP interface to Oracle, and uses Oracle's most recent
    API.
    The name oci8 comes from the version number of Oracle - version 8 - when
    Oracle introduced a new C API. It succeeded the original OCI and got the
    common name OCI8. The original OCI now has the common name of OCI7.
    -- CJ

  • How to realize print function in JSP

    How to realize print function in JSP? I know use Javascript:window.print() can print,but it will print whole page,it don't fit me;Another method is to write JSP into Excel and then print it in Excel,but it don't fit me too,because it don't print directly. Anybody know how to print it directly?

    Many websites offer a "printer friendly" version of a certain page. That IMO is the only way to solve your problem, next to using CSS to use a different style for printer output. Here is a tutorial that covers this:
    http://www.alistapart.com/stories/goingtoprint/

  • How to write printing function using JSP?

    dear all,
    i want to add a printing function in my project but i do not know how to do it? could anyone teach me how to do it?
    thanks
    eric

    salut eric,
    you can do it this way :
    1 - create a html link in your code to this javascript
    function : (I am using Struts, but you can write it in
    pure html
    <html:link href="#bodyStart"
    onclick="openWindowForPrinting()"
    titleKey="msg.status.print">      <bean:message
    key='app.print' />
    <script language="JavaScript">
    <!--
    window.open = SymRealWinOpen;
    //-->
    </script>
    </html:link>
    >
    >
    2 - here is the javascript function : it open a window
    with the "print.jsp" page.
    function openWindowForPrinting(){
    window.open('/your_project/pages/common/print.jsp','',
    'left=150, top=150 , status=no, directories=no,
    toolbar=no, menubar=yes, location=no, scrollbars=yes,
    resizable=yes, dependant=yes');
    3 : here is the print.jsp page : You have only to
    create a session variable called
    "currentBodyRelativeLocation", which content the
    relative URL to the page you want to print (for
    example, the boby of the current page).
    <%@ taglib uri='/WEB-INF/tlds/perso.tld'
    prefix='perso' %>
    <html>
    <head>
    <perso:csslink page='${cssRelativeLocation}' />
    </head>
    <body onload="var SymTmpWinOpen = window.open; window.open = SymWinOpen; printPage();; window.open = SymTmpWinOpen;">
    <body>
    <jsp:include page="${currentBodyRelativeLocation}"/>
    </body>
    <script language="JavaScript">
    <!--
    window.open = SymRealWinOpen;
    //-->
    </script>
    </html>
    <script language='javascript'>
    function printPage(){
    window.print();
    window.close();
    </script>
    hai,
    i'm not very understand how is your code work. when i write html code, do i need to mind about this code: "msg.status.print" ? what is this code mean?
    i have too much question on this thing. would you mind to be further explain to me? or is it any reference for me to refer? i'm really new to write printing function on JSP.
    i never write this function before. i'm feel so lost.....:(
    thanks again
    eric

  • How to retrieve a string value from a PHP function call

    Should this string be the return value of the PHP function?
    Or should it be embedded in the response HTML? Any examples?

    This is what I got so far:
    footer.mxml in Flex Builder 3:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" creationComplete="ts_request()">
    <mx:Script>
    <![CDATA[
    public function ts_request():void {
    timestampRequest.send();
    ]]>
    </mx:Script>
    <mx:Canvas width="836" height="36"
    backgroundColor="#05075C">
    <mx:Label id="timestamp"
    text="{timestampRequest.lastResult.timestamp}" color="#FEFEFE"
    height="20" y="10" textAlign="left" width="221" x="10"/>
    </mx:Canvas>
    <mx:HTTPService id="timestampRequest" url="
    http://www.ABC.com/timestamp.php"
    useProxy="false" method="POST" />
    </mx:Application>
    Here is the timestamp.php on the www.ABC.com web server. I
    have tested the php by directly access it with
    "www.ABC.com/timestamp.php" and it shows the timestamp correctly:
    <?php
    putenv($timezone);
    $Return = "<timestamp>".date("m/d/Y H:i:s", time())."
    CST"."</timestamp>";
    print($Return);
    ?>
    When I run footer.mxml in Flex 3 Builder, I got an error:
    This file cannot be launched.
    Where did I do wrong?

  • How to call a php function from java...

    helllo fellow java developers!
    Im trying to figure out how I can call a php function from my java code.
    I know it sounds a bit unintiutive, seeing how java is a rich programming language, BUT java simply cannot do the task that the php script can do. It simply acts differently.
    So I am trying to call a php function, that returns a string object, and capture that string object....
    is this possible?
    something like....
    String strMyString = phpFunction( strVariable )
    ???????/ any ideaS?

    idea #1 - come up with a better plan that doesn't involve invoking php from java.
    Give one example of something php can do that java can't.
    idea #2 - forget java, and just write it in php.
    Involving multiple frameworks/languages/runtime environments is a recipe for an overcomplicated solution that will be impossible to maintain.
    I'd say keep it simple and stupid, and stick with one language.
    If you're still hooked on the idea, maybe try [this link|http://www.infoq.com/news/2007/10/php-java-stack]

  • Php function list autocomplete in CS6

    Hi all, i have a problem in CS6 when i push Ctrl + Space the Php function list is not showing in code hint panel.
    For example usually when y write, "mysql_f" and then press Ctrl + Space, mysql_fecth_array and mysql_fetch_row, was show in code hint panel.
    Now in CS6 this not work, or i don't know how do it.
    ¿How i can fix this?
    P.d: I read that disable JQuery hints in preference options make that "$_" global var show; but function list no.
    Thanks in advance.

    Moved to the Developing server-side applications with Dreamweaver forum.
    I have just tested Ctr+Space in Dreamweaver CS6 in both Windows 7 and Mac OS X 10.8. It works without problem on both systems.
    Make sure you're using a PHP page, and that you're in a PHP code block. Also, code hints stop working if you have a syntax error earlier in your code.
    Sometimes, if you experience strange behaviour with Dreamweaver, it helps to delete the cache file or even the whole of your configuration folder. See http://forums.adobe.com/thread/494811 for details.

  • Passing values to JavaBean function using jsp scriplet

    Hi,
    I have a JavaBean funtion that is SaveData(parameters)
    which save the values from HTML form.
    Now i want a code for pass the values from HTML form to SaveData() function using jsp scriptlet.
    I used the code
    <jsp:useBean id="JDBC" class="bean.JDBCBean" scope="application"></jsp:useBean>
    <%=JDBC.saveData(phonenumber,manufacturer,model,email,country,newsletter)%>
    Here
    JDBCBean -> Bean Name
    phonenumber,manufacturer,model,email,country,newsletter ->HTML form's text values
    But it didnt work properly.
    Anyone help me to correct this.

    Hi,
    i have the same code like above
    I have to pass the parameters with form name under the following code.
    <jsp:useBean id="JDBC" class="bean.JDBCBean" scope="application"></jsp:useBean>
    <%=JDBC.saveData(registration.phonenumber.value,id_type.value,id_style.value,registration.email.value,registration.scountry.value,player_type.values)%>
    Here
    registration -> HTML form name
    But i got the error for
    package registration does not exist
    out.print(JDBC.saveData(registration.phonenumber.value,id_type.value,id_style.value,registration.email.value,registration.scountry.value,player_type.values));
    How to i correct this?
    Anyone help me......

Maybe you are looking for

  • Opening a response PDF in Acrobat Reader 9 or 10

    I am very new to LC ES3.  I just created a fillable form and distributed it and when I tested the Submit button I did get the responses in my response folder, but after trying to open it in Adobe Reader 9 and X it did not automatically check for new

  • Error reading node property?

    I'm using Premiere Pro CS6, editing a 10 minute sequence using H.264 clips in .MOV containers. This morning I have been applying the Fast colour corrector, warp stabiliser and highlight/shadow adjustment to the clips. A small red box with a white X h

  • KDE 4 Krash

    hm! First KDE 4 snapshot. I think many people want to try it!

  • Jrickit 8.1 not running in SuSE Pro v8.1

    Hello: When trying to execute java -version in my just installed JRockit 8.1 on SuSE 8.1 Pro, I receive an error messaging related to a missing libbfd.so shared file, mentioning that there is no suuport for pthreads on this distribution. What can I d

  • Error package loading ODT.2005

    run from command prompt devenv /resetskippkgs after i install the package i get the following error message on the .net output screen.