PHP Server-side typing of returned object

My PHP service returns an object. Is server-side typing of it's properties possible?

I know I'm late to the party, but in case it helps anyone else:
Despite being a PHP developer, I use iweb occasionally when I need something that looks good, fast!
however, not being able to use simple php scripts was a pain until I discovered that it's possible to make apache parse php within files with a .html extension.
This means that you don't have to change all your filenames to .php and you don't have to mess around every time you change something in iweb and republish.
You need to add a couple of lines as a directive to your apache config file. (You can also use a .htaccess file if you prefer, but I'd rather have a bunch of directives in the config file).
<Directory "/var/www/html/youriwebdirectory/">
AddType application/x-httpd-php .html
php_value shortopentag 0
</Directory>
The "addtype" directive tells php to parse html files for php code. You probably wouldn't want this for your whole server, so it's good to be able to do it only for the required directory where you have your iweb site.
The line "php_value shortopentag 0" may or may not be needed for you. If you have php set up to use short opening tags ( <? instead of <?php ) then this will cause a problem when you tell php to parse all the .html files made by iweb, as they have an XML declaration as the first line, which begins <?xml...
When you've done this, restart apache and you can then place php in your pages as an html snippet.
Of course, this only applies to apache on Linux, I have no clue what you'd do on a Windows box, or using a different webserver, but it worked for me, so it may help someone else :o)

Similar Messages

  • PLEASE help with server-side form validation using PHP!!!

    I feel like im going round and round in circles with this, after looking into all sorts of server-side advice i've come to the conclusion that i want to validate my form using server-side validation with PHP.
    So my form has several drop down menu's and  textareas  (not all of them need validation). For the part of my form i would like to validate, all i want is the drop downs to have to be changed/selected. So just a simple message like "You must select an option" if customers haven't done so. For the textareas, they just need to be filled out, so a message like "Information required" to come up if customers haven't done so.
    I believe i need to create a PHP page say for example 'error.php' place  the validation code in there and set this part of the the form to -
    <form name="product"form action="error.php" method="post" class="product_form">
    BUT im getting really confused with creating the code for the error.php. Please please can anyone help me with this!!!???
    Here are the drop down menu's i need validation on, error message being "You must select an option",
    "figurine"
    "engraving"
    "font"
    and here are the textareas that need validating, error message "Information required",
    "test"
    "Name"
    "house"
    "line_1"
    "line_2"
    "county"
    "postcode"
    "tel"
    www.milesmemorials.com/product-GK1.html
    I'd really appreciate any help!!!

    Ness_quick wrote:
    Great thats good enough for me. In that case, would you please be able to help me create the javascript for the above validation?? If you could just help me create it for this page i can amend it for all the other pages. I'd really really appreciate it!!!
    Can you follow the below example?? Obviously AFTER validation has been successful you need to collect the information from the form and send it to the recipient email address...that's where you can use php. I'll check back tomorrow and see how you are doing.
    <!DOCTYPE HTML>
    <html><head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Form validation</title>
    <!-- VALIDATE ORDER FORM  -->
    <script type="text/javascript">
    <!--
    function RequiredFormFields() {
        // inform customer to provide figurine choice
    var figurine = document.forms.product.figurine.value;
    if (figurine == "-- Select figurine --")
    alert("Please provide figurine choice");
    return false;
    // inform customer to provide engraving choice
    var engraving = document.forms.product.engraving.value;
    if (engraving == "-- Select engraving --")
    alert("Please provide engraving choice");
    return false;
    // inform customer to provide font choice
        var font = document.forms.product.font.value;
    if (font == "-- Select style --")
    alert("Please select font style");
    return false;
    // inform customer to provide their name
    var Name = document.forms.product.Name.value;
    if (Name == null || Name == "")
    alert("Please provide your name");
    return false;
    // inform customer to provide their house number/name
    var house = document.forms.product.house.value;
    if (house == null || house == "")
    alert("Please provide your house number/name");
    return false;
    } // end function
    -->
    </script>
    </head>
    <body>
    <form name="product" form action="processForm.php" method="post" class="product_form" onsubmit="return RequiredFormFields()">
    <p class="product_form_options">Choice of Figurine<br>
    <select name="figurine" class="productButton" id="figurine" onChange="Recalculate()">
    <option selected>-- Select figurine --</option>
    <option value="7031">Tropical Green Granite with bronze sacred heart figurine as pictured(&pound;7031)</option>
    <option value="5216">Tropical Green Granite with bronze effect sacred heart figurine (&pound;5216)</option>
    <option value="5216">Tropical Green Granite with reconstituded figurine MF122(&pound;5216)</option>
    </select>
    </p>
    <p class="product_form_options">Engraved Lettering<br>
    <select name="engraving" class="productButton" id="engraving" onChange="Recalculate()">
            <option selected>-- Select engraving --</option>
            <option value="2.30">Sandblast and enamel painted (&pound;2.30/letter)</option>
            <option value="2.80">Sandblast and guilded (&pound;2.80/letter)</option>
            <option value="2.20">Maintenance free (&pound;2.20/letter)</option>
            <option value="3.73">Traditionally hand cut and enamel painted (&pound;3.73/letter)</option>
            <option value="3.98">Traditionally hand cut and gilded (&pound;3.98/letter)</option>
            <option value="4.34">Raised lead and enamel painted (&pound;4.34/letter)</option>
            <option value="4.59">Raised lead and gilded (&pound;4.59/letter)</option>
          </select>
    </p>
    <p class="product_form_options">Letter/Font Style<br>    
          <select name="font" class="productButton" id="font" >
               <option selected>-- Select style --</option>
               <option value="Maintenance free">Maintenance free </option>
               <option value="White painted block">White painted block</option>
               <option value="White painted roman">White painted roman</option>
               <option value="White painted Script">White painted Script</option>
               <option value="White painted Celtic">White painted Celtic</option>
               <option value="White painted Nova">White painted Nova</option>
               <option value="Sliver painted block">Sliver painted block</option>
               <option value="Sliver painted roman">Sliver painted roman</option>
               <option value="Sliver painted Script">Sliver painted Script</option>
               <option value="Sliver painted Celtic">Sliver painted Celtic</option>
               <option value="Sliver painted Nova">Sliver painted Nova</option>
               <option value="Gold leaf painted block">Gold leaf painted block</option>
               <option value="Gold leaf painted roman">Gold leaf painted roman</option>
               <option value="Gold leaf painted Script">Gold leaf painted Script</option>
               <option value="Gold leaf painted Celtic">Gold leaf painted Celtic</option>
               <option value="Gold leaf painted Nova">Gold leaf painted Nova</option>
               <option value="Gold leaf painted Old English">Gold leaf painted Old English</option>
             </select>
             </p>
             <p>
    <p>Name<br>
    <input name="Name" type="text" id="Name" value="">
    </p>
    <p>House name or number:<br>
    <input name="house" type="text" id="house" size="67">
    </p>
    <p>
    <input name="submit" type="submit" class="place_order" id="submit" value="Place order">
    </p>  
    </form>
    </body>
    </html>

  • Web service proxy - how to use server side in/out objects

    We have logic in oracle database. We have pl/sql api with oracle object types as in/out parameters. On server side we have pojo classes with method to convert from/to sql structs, arrays.
    pl/sql apis are exposed as web services.
    When I create web service proxy, all required pojo classes are created from wsdl on client side.
    Currently we are also writting client part of the code(where we also have oracle database and we want to reuse server pojos). Server pojo classes are in separate jar file and used also on a client side.
    Is it possible to tell jdeveloper when creating web service proxy, to not create client side pojos, exception classes, ... , but use those from jar file.
    Currently I just copy server pojo over generated client ones, make some modifications and it works. But each time I regenerate web service proxy I have to do this step manually.
    Edited by: zgrega on Sep 24, 2010 7:43 AM
    Edited by: zgrega on Sep 24, 2010 7:47 AM

    best is to wrap the generated WS proxy in a JavaBean. This way you can create the exception handling once and apply it to all uses of the WS proxy by overriding the generated code
    Frank

  • RE: Server side objects-if attributes/methods are addedis

    Hi Richard,
    in addition to Peter Sham's mail you might have a
    look at tech note N 11545. The subject is different
    but you will see how to implement 'anchored'
    objects(use proxies) or reference partitions. If your
    server object project is a supplier plan to the
    client I am afraid you have to redeploy client
    whenever you change something on server. So probably
    you have to change the way client and server
    interact. One or two months ago there was discussion
    of how to separate client from server. The subject
    was something like how to avoid "bloated clients".
    Regards,
    Rumen
    Hi,
    You can deploy your server-side objects as server
    using "Configure As"
    in
    Forte Workshop. Then all your client can >use"Reference Partition" to
    reference your SO's on the server. Any change onthe >server-side logic
    won't
    require you re-deploy your clients.
    But if there is object which will pass from serverto >client and no
    matter
    what the change is, you will need to re-deploymentof >your client
    otherwise,
    you will get a "deserialization" error. Bear inmind >that Forte deploy
    all
    the code ( like object structure, logic, etc ) to
    your client during
    deployment, only the data get passes through. Hence, >if there is any
    change
    in an object that will copy from server to client,
    you have to update
    the
    "code" in your client too, that means, re-deploying
    your client. The
    only
    way to get arround this is to "anchore" your object?>to the server, so
    that
    your client only gets a proxy of the object. Aslong >as you are adding
    in
    new things, I guess it ok. But there is a lot of
    issues following
    "archored"
    object.
    Hope this help.
    Regards,
    Peter Sham.
    "Robinson, Richard" wrote:
    Subject says is all. We have a situation wherewe'd like to avoid
    rebuilding/redeploying the client side when aserver object is changed
    (i.e., a new method or attribute is changed) or anobject that is
    passed
    from the server to a client is changed but theclient won't use the
    new
    methods/attributes.
    Thanks in advance_________________________________________________________
    DO YOU YAHOO!?
    Get your free @yahoo.com address at http://mail.yahoo.com

    Hi,
    You can deploy your server-side objects as server using "Configure As" in
    Forte Workshop. Then all your client can use "Reference Partition" to
    reference your SO's on the server. Any change on the server-side logic won't
    require you re-deploy your clients.
    But if there is object which will pass from server to client and no matter
    what the change is, you will need to re-deployment of your client otherwise,
    you will get a "deserialization" error. Bear in mind that Forte deploy all
    the code ( like object structure, logic, etc ) to your client during
    deployment, only the data get passes through. Hence, if there is any change
    in an object that will copy from server to client, you have to update the
    "code" in your client too, that means, re-deploying your client. The only
    way to get arround this is to "anchore" your object to the server, so that
    your client only gets a proxy of the object. As long as you are adding in
    new things, I guess it ok. But there is a lot of issues following "archored"
    object.
    Hope this help.
    Regards,
    Peter Sham.
    "Robinson, Richard" wrote:
    Subject says is all. We have a situation where we'd like to avoid
    rebuilding/redeploying the client side when a server object is changed
    (i.e., a new method or attribute is changed) or an object that is passed
    from the server to a client is changed but the client won't use the new
    methods/attributes.
    Thanks in advance
    For the archives, go to: http://lists.sageit.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: [email protected]

  • Problem when using object array as parameter of server-side event

    Hi Friends,
        I had defined an event in component interface of Component A, with object array as its parameter. but when I define event-handler for this event in Component B, the type of parameter in generated event-handler method is just the class itself instead of an array.
       It's a bug or array parameter is not support by server-side event in WD4J?
       Thanks in advanced.

    I think you are trying to do the editing of parameter from the java editor.
    Do it via the controller editer. Go the methods tab. Select the actionhandler.
    In the parameter section edit the paramter. Change the dimensions here.
    Regards,
    Ashwani Kr Sharma

  • Local SWF vs Server Side SWF and PHP

    I am having the strangest problem... I have a form in Flash
    where I use the sendAndLoad () function to communicate with a PHP
    file, that then sends an email with the loaded data. The action
    works fine when I run the SWF from my Mac to the server side PHP
    file using an absolute address. But it doesn't work when the SWF is
    on the server, again running an absolute path to the PHP file.
    Has anyone experienced this issue before? Is it a problem
    with security?
    Thanks,
    g

    Hi David
    If an online converter suits you, try Flabaco - www.flash-banner-converter.com
    It converts SWF to Video, generating three formats - MP4, OGG and WebM.
    Kayo

  • How to create an object alive all the time on a server side

    Hi,
    I work on an Intranet with J2EE technologies. I need an object to do several tasks in background on the server side. Like start scheduled processes on a database and files, stocked on the server. What is the way to do this. I thought to use the JNDI by declaring the object in the Deployement Descriptor, and to manage a timer within.
    I don't know if this works.
    Anyway, my question is how to create an object on the server that is ALIVE ALL THE TIME and visible by the other objects running in the same VM.
    Thank's.

    This may not be the correct design, but I had success doing the following:
    1. Create an Stateless EJB that does a task, i.e. update a database table.
    2. Create a subclass of java.util.TimerTask to call the EJB methods.
    3. Kick off the TimerTask from a servlet.init method.
    Seems to work pretty well to do scheduled tasks, such as refreshing lookup tables. I would imagine the same could be done with an MBean, but I haven't had time to fully understand JMX yet. (It's on the list).
    As for event driven procedures, that can be done through a servlet interface.
    You may also wish to review a scheduler here: http://www.part.net/quartz.html. Note, I have NOT even looked at it yet, so I have no clue if it's any good. But, it is on my list of tools to evaluate (that's a long list) someday when my head's above water. Have a look, and caveat emptor.
    Hope this helps,
    Perry Tew

  • Implementation Options: Server Side Object Model & Client Side Object Model

    Hi All, I'm design a custom web application and it will be deploy on SharePoint 2010/2013 (to be confirmed) server, and I found some aritical as follows:
    http://consultingblogs.emc.com/sanjaypatel/archive/2011/09/17/comparison-between-server-side-object-model-client-object-model-rest-api-s-and-decision-matrix-on-what-to-use-when.aspx
    May I ask ask your advice for following items?
    1) Is the above URL still valid? e.g. Vice Versa for SharePoint 2013?
    2) Microsoft has a phase out plan for server side object model or not? (e.g. MOSS 202X)
    3) For programmatcally update of SharePoint permission: should I call client-side OM instead of server-side OM even I will deploy the web application to SharePoint server?
    Thank you very much.
    .NET Beginner 3.5

    In sharepoint 2013 I don't think this link is
    http://consultingblogs.emc.com/sanjaypatel/archive/2011/09/17/comparison-between-server-side-object-model-client-object-model-rest-api-s-and-decision-matrix-on-what-to-use-when.aspxis reliable at all.
    what is your say?
    ====================================================
     Hi All, I'm design a custom web application and it will be deploy on SharePoint 2010/2013 (to be confirmed) server, and I found some aritical as follows:
    http://consultingblogs.emc.com/sanjaypatel/archive/2011/09/17/comparison-between-server-side-object-model-client-object-model-rest-api-s-and-decision-matrix-on-what-to-use-when.aspx
    May I ask ask your advice for following items?
    1) Is the above URL still valid? e.g. Vice Versa for SharePoint 2013?
    2) Microsoft has a phase out plan for server side object model or not? (e.g. MOSS 202X)
    3) For programmatcally update of SharePoint permission: should I call client-side OM instead of server-side OM even I will deploy the web application to SharePoint server?
    Thank you very much.
    .NET Beginner 3.5

  • What server side objects to pin in shared pool?

    On the first invocation of Java-based image.process(...), processing can take up to 30 seconds. Second run takes less than a second, but a final invocation a few hours later is back to 30 seconds. My DBA suspects that the server side objects are cached in the shared pool by the time of the second invocation, and then flushed out by the time the code is run a few hours later.
    We tried "pinning" ORDSYS.OrdImage pl/sql package in the shared pool using dbsm_shared_pool.keep , but no success. What are the the Java server-side objects referred to the Intermedia Java Client that really does the work when the client-side image.process(..) is executed?
    Thanks,
    Brandon

    hi Mr.kesavan!
    i tried .but i am getting some error.
    when i give lookup (jndi) that time it is giving some error.
    for example :
    ic.lookup("Bean2");exactly this line i am getting some unmarshalling error.
    Can u give me some sample code.?
    thank u...
    Shalinipriya.

  • Problem to update Swing components from RMI object at server side

    Greetings, I have a RMI client/server application, both client and server have a Swing GUI. But at the server side, it appears to me that I can't pass object or make function call to my server GUI class. Because I can't have GUI instance or reference in my Remote object. (java.rmi.MarshalExceptio, java.io.NotSerializableException, blar blar ...)
    My problem is, if a client does something, I want to reflect the changes on the server side GUI. How can I do this except using a spin query?
    Any help would be greatly appreciated.
    Thanks.
    John
    Edited by: zgliang on Sep 13, 2007 3:30 AM

    I'd like to suggest you read the topic "Questions RMI & Swing & SwingWorker", which is similar to yours.

  • ICustomRouter interface CSOM or Server Side Object model

    Hi!
    We are looking into a custom document route, and I know about the ICustomRouter interface.
    Can it be used in CSOM?
    The ICustomeRouter example here:
    http://msdn.microsoft.com/en-us/library/microsoft.office.recordsmanagement.recordsrepository.icustomrouter.aspx
    references:
    using Microsoft.SharePoint;
    ...which leans towards the Server Side Object model.
    I don't see anything for "routing" or "records" here for the 2013 API:
    http://msdn.microsoft.com/en-us/library/office/dn268594(v=office.15).aspx
    Thank you!

    The only thing available from CSOM is the following namespace:
    Microsoft.Office.RecordsManagement.InformationPolicy.ProjectPolicy
    Some of the methods available are below:
    IsProjectClosed
    PostPoneProject
    GetProjectPolicies
    Blog | SharePoint Field Notes Dev Tools |
    SPFastDeploy | SPRemoteAPIExplorer

  • Pb Server-Sides inludes  + Dynamic List Wizard with PHP 5.2

    Hi
    I include some Dynamic Lists in a master page with Server Side Include beahavior.
    It was Ok in PHP 5.1 with any number of items (50 items per page).
    But there is problem with PHP 5.2, it's OK with 20 items per page, nothing is displayed with 50 items per pages.
    I've seen that there is a new memory manager for the Zend Engine with PHP 5.2...
    SO I modified some parameters in php.ini (memory_limit...) with no result.
    Is there somebody have the same problem, an idea ?
    Thank you
    Marie

    Hi Marie,
    I´m running PHP 5.2.2 with the Zend Memory Manager enabled as well, and so far I didn´t encounter such issues -- maybe you´ll just need to increase the currently defined "max_execution_time" value ?
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • Server Side Includes and php

    I have php forms on a site update.  I want to use a server side include to keep the dynamic menu off the template.  The include works on the home page and other .shtm pages, but not on the php.  This can't be impossible.  What's the hint?  I can't (or can I) save the php as .shtm. and the thread will not allow any of the file types to be attached.  Ergo ... the link:http://shrhabitat.org/index09.shtm, the include: http://shrhabitat.org/includes/hfhshrmenu.lbw, the contact form: http://shrhabitat.org/contactus.php
    don Carlos de la Playa

    Alrighty then,  What I did was add both html and php include code to the template.  It seems to work without duplication.  For the experts in the crowd, will this blow up in my face someday?  As near as I can tell, I just need to ensure that any changes are made to both files which, after all, clones of one another.
    Ya'll have a fine Virginia day, now. Y'hear?
    don Carlos de la playa

  • How can I convert client-side Shared Object in server-side Shared Object?

    Hello world....
    I have a problem...
    I have a program that uses client-side shared Object, like the Example "Ball" il the FMS 3.5 guide: I can move a ball around the stage...
    I need to convert this program so I can use server side shared object. This is because I can load the .swf to another .swf and I must to be able to reset, or delete, the properties of my shared object. With client-side sahred object I can't delete or reset the shared object after I loaded my external .swf....
    My script is:
    private var pointer1_so:SharedObject;
    nc=new NetConnection  ;
    nc.connect (rtmpNow);
    nc.addEventListener (NetStatusEvent.NET_STATUS,doSO);
    Cerchio=new cerchio ;
    addChild (Cerchio);
    Cerchio.x=220;
    Cerchio.y=280;
    Cerchio.addEventListener (MouseEvent.MOUSE_DOWN,beginDrag1);
    Cerchio.addEventListener (MouseEvent.MOUSE_UP,endDrag1);
    private function doSO (e:NetStatusEvent):void
                 good=e.info.code == "NetConnection.Connect.Success";
                 if (good)
                       //Shared object
                       pointer1_so=SharedObject.getRemote("point1",nc.uri,false);
                       pointer1_so.connect (nc);
                       pointer1_so.addEventListener (SyncEvent.SYNC,doUpdate1);
    private function doUpdate1 (se:SyncEvent):void
                 for (var cl1:uint; cl1 < se.changeList.length; cl1++)
                       trace(se.changeList[cl1].code);
                       if (se.changeList[cl1].code == "change")
                            switch (se.changeList[cl1].name)
                                 case "xpos" :
                                       Cerchio.x=pointer1_so.data.xpos;
                                       break;
                                 case "ypos" :
                                       Cerchio.y=pointer1_so.data.ypos;
                                       break;
    private function beginDrag1 (e:MouseEvent)
                     Cerchio.addEventListener (MouseEvent.MOUSE_MOVE,moveMc1);
                     Cerchio.startDrag (false,Rect1);
    private function endDrag1 (e:MouseEvent)
                     Cerchio.stopDrag ();
    private function moveMc1 (e:MouseEvent)
                e.updateAfterEvent ();
                   pointer1_so.setProperty ("xpos",Cerchio.x);
                   pointer1_so.setProperty ("ypos",Cerchio.y);
    Can someone helps me?
    I know I need of a server side script but...
    Please...
    Emiliano.

    ResultSet is not serializable. It is an active connection. If you wish to serialize the info, then read it into an ArrayList in your serializable class and pass the Data that way.

  • When php is the server side language...

    Can SQL injection happen to a flash website which uses php as the server side language?
    (Highly appreciate your input)

    you're welcome.
    and, it's easy to prevent using mysql_real_escape_string():  http://www.tizag.com/mysqlTutorial/mysql-php-sql-injection.php
    i always use a for-loop to convert all the variables to php variables and while i'm at it, prevent injection:
    foreach ($_POST as $key => $value) {
       $$key = $value;
       $$key = mysql_real_escape_string($$key);

Maybe you are looking for

  • Attached document not opening in FB03.

    Hi , I am using an error while checking uploaded attchment in the transaction FB03. When any file(ex. pdf) is uploaded from presentation server, it is uploaded successfully and able to see the content . But when the same file is downloaded on the app

  • Updating hr infotype pa0305 with 'HR_INFOTYPE_OPERATION'

    Hi everyone i'm trying to update hr infotype pa0305 using fm HR_INFOTYPE_OPERATION but it doesn't work  maybe using in worng way. Maybe someone knows how can i use the second structure q0305 passing trough the parameter called "secondary records". Th

  • Blog photo transfer for Mac

    On the Google blog site there is offered a free download enabling transfer of photos to a URL, from which it can then be placed in a blog. As per usual, it works for Windows only. Does anybody know if there is such a "service" offered anywhere for bl

  • NAV 2013 download page not available

    Sorry for posting in the CRM forum, there is no NAV forum listed. I have just tried to get the latest build (39665) of NAV 2013, as well as build 38800. Yesterday the download webpage itself was unavailable. Today, I can get to the following page, si

  • Instantiating an Array declared in a class from another class

    Hi Guys, I am working on a project for University and I'm stuck with this thins, which I'm sure is pretty easy when you know how... I have a first class "Courses" in which I declare my Array, here is the code: import java.util.*; public class Courses