Can you pass an array URL variable

Hi,
Doing a form which I want to validate, then re-display with
error messages and the keyed data still in place should there be
errors, or go onto a second form if all ok.
I have tried to use <form
action="<?=$_SERVER['PHP_SELF']?>" but as the various
outcomes result in different screens I can't see how to do it
without having reams of duplicate code - I couldn't make it work
satisfactorily anyway.
So I decided to do it in two stages - form (user screen) + a
separate validation routine which passes validation results back if
there are errors by calling the first screen but with URL variables
to trigger process variations or go onto screen 2 if all ok.
But I'm struggling with this .. two questions:
i) Ideally I would like to use a session variable to pass
actual error messages back to screen one in the event of errors but
if I undertand things correctly (which is by no means certain)
$S_Session is already an associatve array so it wouldn't be so easy
to just add a variable number of messages to it and then know what
you are unpacking elsewhere ... do you know what I mean?
Perhaps if I give you my second question it may help
illustrate what I'm going on about in part 1
ii) The way I have tried to do it is to set it up as an array
($ERRORS) in the validation module and then added a text string
each time I hit a specific error. The hope was that I could then
send this back via the URL for further process but I'm getting
syntax problem so maybe this is not possible .... a brief example
Input Form php:
$ERRORS = array();
$ERRORS = $_GET['errors']
if (sizeof($ERRORS) > 0) {
echo "<p class=\"val_err_hdr\"> *** Validation
error(s) - please correct the entries and try again ***
</p>";
blah blah
Validation php:
$ERRORS=array();
if(!$loginFoundUser) {
$ERRORS[] = "This e-mail address entered has already been
registered on our database - if you have already registered you
can"; }
header("Location: input.form.php?errors=$ERRORS");
When I run this I get a syntax error 'unexpected T_IF' on the
'sizeof'' function condition.
Any help much appreciated.

.oO(patricktr)
> Doing a form which I want to validate, then re-display
with error messages and
>the keyed data still in place should there be errors, or
go onto a second form
>if all ok.
OK, quite common.
> I have tried to use <form
action="<?=$_SERVER['PHP_SELF']?>"
Avoid short open tags, they are unreliable. Use "<?php
print " instead
of just "<?=" to be safe and independent from the server
configuration.
>but as the
>various outcomes result in different screens I can't see
how to do it without
>having reams of duplicate code - I couldn't make it work
satisfactorily anyway.
What's a "screen" in this case? Just another part of the form
or a
completely different page?
> So I decided to do it in two stages - form (user screen)
+ a separate
>validation routine which passes validation results back
if there are errors by
>calling the first screen but with URL variables to
trigger process variations
>or go onto screen 2 if all ok.
Don't use URL parameters in such a form processing scenario.
Use a
session instead, that's what they are for. The length of URLs
is limited
and there are things you simply don't want to pass between
pages, but
keep on the server instead.
> But I'm struggling with this .. two questions:
>
> i) Ideally I would like to use a session variable to
pass actual error
>messages back to screen one in the event of errors but if
I undertand things
>correctly (which is by no means certain) $S_Session is
already an associatve
>array so it wouldn't be so easy to just add a variable
number of messages to it
>and then know what you are unpacking elsewhere ... do you
know what I mean?
The $_SESSION array itself is strictly associative, the used
indexes
must be strings or the serialization of the session data will
fail.
But if course you can always do things like this:
$_SESSION['errors'] = array();
$_SESSION['errors'][] = 'something went wrong';
> Perhaps if I give you my second question it may help
illustrate what I'm going
>on about in part 1
> ii) The way I have tried to do it is to set it up as an
array ($ERRORS) in the
>validation module and then added a text string each time
I hit a specific
>error. The hope was that I could then send this back via
the URL for further
>process but I'm getting syntax problem so maybe this is
not possible .... a
>brief example ...
As said above - use the session instead.
> Input Form php:
> $ERRORS = array();
> $ERRORS = $_GET['errors']
There's a ';' missing at the EOL (this causes the error you
mentioned
below).
Just a naming hint: Variables should not be named all
uppercase (except
for the predefined superglobal arrays). Such names should be
reserved
for constants. The most common style looks like this:
myNiceFunction()
$myNiceVariable
MY_NICE_CONSTANT
> if (sizeof($ERRORS) > 0) {
if (!empty($_SESSION['errors'])) {
> header("Location: input.form.php?errors=$ERRORS");
The Location URI must be absolute including scheme and
hostname. This is
required by the HTTP spec:
header("Location:
http://$_SERVER[HTTP_HOST
But I'm still not sure why you would need this redirect. The
entire
handling of a form (validation, processing) can be done on a
single
page. Only if the processing succeeds, you might want to
redirect to
some result page.
Micha

Similar Messages

  • Can you pass more than on variable with getURL in flash form

    I needed to call another page from inside a form not with the submit button and fournd this piece of code
    <cfinput type="button" id="btEdit" name="btEdit" value="View" onClick="getURL('../../forms/Program_populate.cfm?<cfoutput>#SESSION.URLToken#</cfoutput> &Reference='+data.dataProvider[data.selectedIndex]['ID'],'_blank')" >
    "Reference" is passed in the URL, I have tried to tweek this to pass an additional field "ID" , Vendor_Number" , but have been unable to find the correct syntax.  If anyone can help that would be great.
    Thanks,
    Mike

    url variables are passed as follows
    after the file name a question mark (?) then,
    name=value with an ampersand (&) between name value pair
    You may be having problems with escaping the action script code.
    If the value is a coldfusion value just cfoutput the value as in your example.
    If the value is from a form element then you need to escape it as in the example
    remove the comments from below
    getURL('../../forms/Program_populate.cfm?
    <cfoutput>#SESSION.URLToken#< /cfoutput>
    &Reference='+data.dataProvider[data.selectedIndex]['ID']
    // need to add more info so put in the plus and add the text of the url variable name (let's assume the id is from CF)
    + '&ID=<cfoutput>#queryName.ID#</cfoutput>&Vendor_Number='
    //we have add the url variable name above, but let's assume it is coming from a form field
    // then we need to close the string, done above and add the value
    + data.dataProvider[data.selectedIndex]['Vendor_Number']
    ,'_blank')
    Hope this helps.
    If you still have problems, assing all this to a cf variable and output it so you can read what it is to debug it.
    Ken

  • Can i pass parameter or global variable in view from 6i form

    hi master
    sir can i pass parameter or global variable in view from 6i form
    i use view for some diff column calculation within the date then i use
    where date between data1 and date2
    in view but view not create
    please give me idea how i pass external value in view
    thank
    aamir

    Hi Antony!
    I feel it may not produce the right results if you
    dont include the where clause and using only group by
    in view.You felt? Please clear, logical thoughts put here, not feelings.
    (It may very well have all the Debit, Credit
    for all the Accid where as the user wants only for
    r some date range)Data range is determinated in Form by user, so if view should give final data set then you must back
    on Ranjana first question: How to pass parameter or global variable to view from 6i form?
    And also as Ranjit pointed out, If you have only
    accid, sum(debit), sum(credit) in View, wheres this
    enddate ??Of course, column entdate (or enddate?) must be included in view...
    Cheers!

  • Can you pass a hidden value along with your select option in the form selec

    Can you pass a hidden value along with your select option in the html form select

    Off topic. Locking.

  • Do you have an Adobe Reader for Unix/Solaris?  If so, can you provide me the URL?

    Do you have an Adobe Reader for Unix/Solaris?  If so, can you provide me the URL?

    The last Reader version issued for Unix is 9.5.5; you can download the appropriate files from ftp://ftp.adobe.com/pub/adobe/reader/unix/9.x/9.5.5/enu/

  • Can you tell me the URL of Uninstaller adobe cs3 web premium ?

    can you tell me the URL of Uninstaller adobe cs3 web premium
    ?

    Clean Script to Remove Adobe CS3 (read carefully)
    http://www.adobe.com/support/contact/cs3clean.html
    Also read here for CCleaner to remove applications
    http://windowssecrets.com/comp/080424
    Also Windows Installer Cleanup Utility
    http://support.microsoft.com/KB/290301

  • Can I pass an array as an input parameter for a stored procedure on SQL Server 2000

    I am trying to pass an array to a stored procedure residing on my SQL Server 2000 database server. Is this even possible? If it is possible, what is the syntax for this?
    Any help would be greatly appreciated.
    Thanks

    I have passed arrays to and from a database using SQL and ActiveX, including to and from stored procedures, but I cannot recall the precise method used to do so. If memory serves, everything is in the form of a string. You need to do a lot of parsing and 'unparsing' to get this data into your stored procedure.
    You are left with a couple of options to get your data to the stored procedure. I recommend using SQL in LabVIEW wherever possible as it saves the amount of external code calls (and believe me, calling ActiveX procedures developed by someone else in Visual Basic is NOT much fun at all...). You can either send the array and other data to the stored procedure (you will find the syntax in the SQL references in LabVIEW help under SQL), or you can send
    the array to the database, and have the database then act upon the array.
    I strongly recommend making routines (subVIs) to handle these operations.
    Sorry I don't have the syntax, I don't have SQL installed on this machine. If you can't find the syntax in the help, please post here again.
    -Mike Du'Lyea

  • How do you pass an array of characters using the DLL functions

    I have exported C code into my DLL and I want to know how to pass an array of characters using LabVIEW.

    Mont;
    If you want to pass a string from LabVIEW to your dll, and you do NOT change size of the string, you can use a C String pointer (CStr), which is equivalent to (unsigned) char *.
    If you do modify size of the string, pass string as a LabVIEW structure (LStrHandle).
    The example "Passing a Variety of Data Types from DLL to LabVIEW" is an excellent starting point. Also make sure you check the manual "Using External Code in LabVIEW".
    Regards;
    Enrique
    www.vartortech.com

  • How  can you load local server urls on application start?

    Background:
    I've been searching for close to two days for an answer to this question, it's full of gotchas and I can't quite get it figured out.
    I have an application which contains several web services. These services load up listeners when the services are invoked which makes them available for input. The user has the option of disabling automatic load of these services and invoking them manually by typing in the local url and starting the app. The can allow the autoload which uses a the or allowing the auto load to start. Currently the local url is hardcoded in a property file and this is how the services knows the local endpoint to envoke when it autostarts.
    <servlet id="AutoStart_01">
    <servlet-name>autoStart</servlet-name>
    <servlet-class>com.loadmy.StartupClass.Here</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    This works all fine and well until it's deployed onto a machine that runs a local weblogic cluster that has more than one jvm (and multiple ports) loading the application up.
    Problem
    The question is, how can you get the applicaton to recoginize the local url for the jvm that is running which can be on different ports? Here's what I've tried
    A - Using Inet.Address - This doesn't let you know what port your application is on
    B - Using the load servlet on start up ( Only the init() function is called and the request object hasn't been created and the request object is what contains ther protocol, server and port information)
    C - Loading a jsp page (READ... purposefully loading a jsp page) on application start. The thought here is that this contains a request object, but unfortunately on this doesn't work in my servlet container (currently tomcat 6 but the application is for a web logic machine)
    D - I thought about possibly using System.properties() but no luck there
    I'm at witts end on this one and I know there is something that can recoginze the local servlet container and extract the url and port from it.
    Any suggestions would be great.
    Flabergasted [sic]

    Hi,
    I had a simmilar requirement once, i also had to display some meaningful message with the busy mode icon, but i guess that comes directly from the WD Framework and is not possible to be changed. Refer the following thread, i raised that time.
    Web Dynpro ABAP
    Dont have much idea if somethig exists in portal for this.
    Regards,
    Runal

  • Migrating to Sharepoint 2013 from 2010 - Can you use the same URL for the Web Application without affecting the 2010 environment?

    Hi,
    I am currently trying to migrate our SharePoint 2010 environment to SharePoint 2013. The first thing I'm doing is creating a 2013 development environment to verify that this migration goes smoothly. I'm also doing this so that we will have a testing environment
    after the upgrade to 2013 is complete. 
    So here is my question: I have a 3 tier farm including; 1 app server, 1 wfe, and 1 sql server. I have made a copy of our SharePoint 2010 database and installed that on our sql server 2012 sever (This new environment is on 3 completely separate servers from
    our 2010 environment). I have also installed the prereqs and configured SharePoint 2013 on the App server and wfe servers, as well as configuring the necessary service applications (I have created a completely new 2013 database where I will migrate my 2010
    database content when I'm ready).
    I am now at the point where I need to create a new web application on the 2013 app server, where I will be migrating the copied 2010 database.  (Also note that we have a 2010 development site called https://[email protected])
    When I go to create a new web application in our 2013 dev environment, can I use the same url (https://[email protected]) to create this web app, or will this screw up our current 2010 dev environment?
    I'm new to SharePoint migrations, so I apologize if this is a stupid question.
    Thanks in advance for any insight you can share on this!
    Boe Barlage

    So, what you are recommending is that before I create a web application in my new 2013 environment, I need go into my hosts file on my 2013 app server and alter it to point to my 2013 wfe.
    Then after I do that, then I can create my new web application on my 2013 app server with the same url as my 2010 testing environment
    (https://[email protected]). 
    Then after that I should be able to access my new sharepoint 2013 environment at the same URL (https://[email protected])?
    I must be missing something.
    In your first reply, you told me to alter the host file on my 2010 app server and point it to my 2010
    wfe (I guess I thought it probably already is). You also told me to alter the host file on my 2013 app server and point it to my 2013 wfe. 
    so I am confused on after I do this, what url would I access my 2010 test environment, and what url would
    I access my 2013 test environment?
    I am fine with having my test environment as a different URL until I am totally ready to roll everything over and kill the 2010 site. But I want to make sure that when I migrate my database, none of the site links are broken.
    I also want to make sure that if I proceed this way, I want to be sure that I will be able to modify the URL to what my 2010 environment is (without a lot of headaches) when I am ready to kill the 2010 site.
    Thanks again for your help, it's much appreciated!
    Boe Barlage

  • Can you pass multiple files to Business Catalyst at the same time?

    I need to pass information from a client. The infromation is split into several files. I can not access the files to combine them to send as one document to BC. Can I send the two files over even though they do not full fill the necessity of all the user information. File 1 is the personal information and has no other details. When this fill crosses over BC accepts with no trouble. When the second file goes across the personal information is not there but the form details are and this file wipesout the DB. Going through debug when the first file executes I see the data on the BC side. When the second file executes the data is all gone. I cannot combine both files to create one document. Files do not have the same number of users so import of file with file helper would not work since it needs to meet certain requirements to process correctly everytime. By combining the two files would give a different number of tabs than what file helper is looking for and by that matter the data may not be in the correct order. Retrieving the data from the file also would not work since I would have to retrieve from both files at the same time and there would be issues if the user does not occur on both files.
    Please help.
    Thank you,
    Carlos

    Wilderness08 wrote:
    To save time with videos that are not critical, can you capture one video to Premiere Pro at the same time you are authoring to Encore a previously captured video?
    The short answer is yes.
    I have just done that and I am happy to report that it worked like a charm.
    I captured from a DVCAM tape via firewire using PPro CS6 while authoring a Blu-ray disk in Encore CS6.
    No frames were lost during capture and my test blu-ray project was completed without a hitch.

  • Can you pass parameters to the Dashboard in a URL?

    Hi,
    I'm trying to launch a dashboard from a weblink in a new window but I can't figure out how to pass any parameters into the dashboard. I would like to set the prompt or the presentation variable or anything that could be used to filter the results of the 4 reports running in the dashboard. Right now the dashboard comes up with all results from all accounts and I want just results from the account with the weblink.
    Is this possible?
    thanks

    Ok,
    I just tried that and it still doesn't pass anything to the prompt.
    I changed the prompt to an edit field and I made the following weblink but when i click the link from an account it doesn't put anything in the prompt and all data for all accounts is shown.
    This is the URL maybe I messed something up...
    https://secure-ausomx###.crmondemand.com/OnDemand/user/Dashboard?OMTHD=ShowDashboard&OMTGT=ReportIFrame&SelDashboardFrm.Dashboard Type=%2fshared%2fCompany_########_Shared_Folder%2f_portal%2f360+Report&Option=rfd&Action=Navigate&P0=1&P1=eq&P2=Account."Account Name"&P3=%%%Name%%%
    thanks

  • Can you pass a session variable in a CFC bind?

    I have a page (dsp_compReqSCM.cfm) that (via a session variable) displays an application value.  From this page (via a CFFORM) I would like to have that session variable passed along to a cfc(getDistinct.cfc).  I can't quite get the syntax correct and am hoping to get some assistance.  When I code #session.this_appl# in dsp_ReqComps.cfm, I get an error stating Element not found PTS (which is the value of session.this_appl) and that the bind cannot occur.  If I pass session.this_appl (NO ##) in dsp_ReqComps.cfm, I get an error stating Element not found session and that the bind cannot occur.   If I pass 'session.this_appl' or "session.this_appl" in dsp_ReqComps.cfm, I get an error stating Element not found 'session (or "session) and that the bind cannot occur.
    dsp_compReqSCM.cfm calls dsp_ReqComps.cfm via cfform
    <!---dsp_ReqComps.cfm--->
    <cfwindow initshow="true" center="true" width="430" height="340">
    <cfform>
         <cfgrid name="componentsGrid"
                 format="html"
                 pagesize=10
                 striperows="yes"
                 bind="cfc:distinctComponents.getDistinct({cfgridpage},{cfgridpagesize},{cfgridsortcolumn} ,{cfgridsortdirection},#session.this_appl#})"
                 selectmode="row" >
             <cfgridcolumn name="Component_type" header="Component Type" width="400">
         </cfgrid>
    </cfform>
    </cfwindow>
    <!---getDistinct.cfc--->
    <cfcomponent>
        <cffunction name="getDistinct" access="remote" returntype="struct">
            <cfargument name="page">
            <cfargument name="pageSize">
            <cfargument name="gridsortcolumn">
            <cfargument name="gridsortdir">
            <cfargument name="appl_in"  type="string" required="true">
      <cfset var Qcomponents = ''>
        <cfif gridsortcolumn EQ "">
       <cfset gridsortcolumn = "ASC">
      </cfif>
            <cfif gridsortdir EQ "">
       <cfset gridsortdir = "ASC">
      </cfif>
       <cfquery name="Qcomponents" datasource="Tax">
          select DISTINCT(component_type) from ctl_components 
         where app_abbrev = #appl_in#
       </cfquery>
        <cfreturn QueryConvertForGrid(Qcomponents, page, pageSize)>
      </cffunction>
    </cfcomponent>
    Any advice you can give is greatly appreciated!
    Libby H.

    @Libby H
    There are 2 things.
    1) The name of the component the grid binds to(distinctComponents) is different from the name of the CFC(getDistinct).
    2) Session variables are also available to components. There is therefore no need to pass them explicitly to a function. In any case, it is always advisable to test for the existence of a session variable before using it.
    Your code would then be something like
    <cfform>
         <cfgrid name="componentsGrid"
                 format="html"
                 pagesize=10
                 striperows="yes"
                 bind="cfc:distinctComponents.getDistinct({cfgridpage},{cfgridpagesize },{cfgridsortcolumn},{cfgridsortdirection})"
                 selectmode="row" >
             <cfgridcolumn name="Component_type" header="Component Type" width="400">
         </cfgrid>
    </cfform>
    </cfwindow>
    <!---distinctComponents.cfc--->
    <cfcomponent>
        <cffunction name="getDistinct" access="remote" returntype="struct">
            <cfargument name="page">
            <cfargument name="pageSize">
            <cfargument name="gridsortcolumn">
            <cfargument name="gridsortdir">
      <cfset var Qcomponents = ''>
        <cfif gridsortcolumn EQ "">
       <cfset gridsortcolumn = "ASC">
      </cfif>
            <cfif gridsortdir EQ "">
       <cfset gridsortdir = "ASC">
      </cfif>
    <cfparam name="session.this_appl" default="your_default_value">
       <cfquery name="Qcomponents" datasource="Tax">
          select DISTINCT(component_type) from ctl_components 
         where app_abbrev = #session.this_appl#
       </cfquery>
        <cfreturn QueryConvertForGrid(Qcomponents, page, pageSize)>
      </cffunction>
    </cfcomponent>

  • Can you pass url parameter to SampleVideoPlayer_FP?

    I'd like to send the name of the f4v file to the sample player, so that it loads straight away.
    Is there a way to do this?
    Many thanks,
    Kev

    Hi Kev,
    The sample video player we provide was authored using Adobe Flex Builder (now called Adobe Flash Builder), using Adobe's proprietary language ActionScript 3 (the language is pretty much an extension of Javascript).  The SDK Adobe provides is free to use, which means you can modify the code and rebuild the player as you see fit.  However, if instead of a basic text editor to write your code, you would like to use an IDE (built from Eclipse), which Adobe charges a fee.  But, you can download and use a trial of the app.
    Below are some tutorials to get you started.
    Flash Builder: http://www.adobe.com/products/flashbuilder/
    ActionScript 3 Developer's Guide: http://help.adobe.com/en_US/as3/dev/index.html
    ActionScript 3 Developer's Guide section specific to Flash Access: http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7ce3.html
    cheers,
    /Eric.

  • How Can You Tell if the URLRequest Variables Are Posted?

    Hi,
    This sounds really odd, because I happen to have three variables I am supposed to pass to an httpservice and have the results output to my Flex app.
    The problem is, I don't know how I can tell if a variable has been posted or not, because no matter what I do, it looks like my trace statement is accurate, but there is nothing shown on the screen.
    I tried changing it to GET, and then I get this IO Event Handler error, because my variables are so long.
    var loader:URLLoader = new URLLoader();
            var url:String = "http://localhost/generic.php";
            var variables:URLVariables = new URLVariables();
                variables.from= from_string;
                variables.state_colors = state_colors_string;
                variables.change = change_string;                       
            var encode:String= encodeURI(url);
            var pattern:RegExp = /#/g;
            var decode:String = encode.replace(pattern,"%23");
            var request:URLRequest = new URLRequest(decode);           
            request.method = URLRequestMethod.POST;          
    I am wondering if my variables have been passed correctly. Is there some other way other than using trace statements?
    Thanks for your help.

    Hi,
    Thanks for the tip, and I have just done that with my php code end. It turns out that the file was generated, and the file is blank after the code has finalized execution.
      So, I guess that my POST variables is definitely not posted.
    By the way, I have added a couple of lines for security and IO checks, like you suggested, and here is the almost complete code:
    public function changeMap():void{                        
            var url:String = "http://localhost/generic.php";
            var variables:URLVariables = new URLVariables();
                variables.from= from_string;
                variables.state_colors = state_colors_string;
                variables.change = change_string;
            var encode:String= encodeURI(url);
            var pattern:RegExp = /#/g;
            var decode:String = encode.replace(pattern,"%23");
            var request:URLRequest = new URLRequest(decode);           
            request.method = URLRequestMethod.POST;       
            var loader:URLLoader = new URLLoader();
            loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
            loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
            loader.addEventListener(Event.COMPLETE, onLoadComplete);   
            loader.load(request);                    
             private function onSecurityError(event:SecurityErrorEvent):void {
                trace("securityErrorHandler: " + event);
             private function onIOError(event:IOErrorEvent):void {
                trace("ioErrorHandler: " + event);
            public function onLoadComplete(event:Event):void {             //event output                             
    From the console, the error events returned nothing from the addEventListeners.
    When I used GET before, they worked with two passing variables, but since my variables are now more than 512 characters, I cannot put this on the url, which is why I am insisting on using POST here.
    Have I done anything else wrong here?
    Thanks for your help.

Maybe you are looking for