Get URL Variable
I have two relevant pages -
The first presents a list of choices in HTML, and allows the
user to select one. Upon selection, a variable is passed to the URL
for the second page. (?installer=foo)
The second page contains the Flash movie. How may I grab the
variable from the currently loaded page?
Thanks!
3cl3c71k0r
eclectikor,
> Thanks for the reply! I've checked out that link and a
few others.
> Still no luck. This seems to be a sticky topic for a lot
of folks.
FlashVars are a useful tool, and they were a tad easier to
use in prior
to AS3 ... simply because the passed-in variables were
available, like
magic, as main timeline variables. It's not much harder in
AS3, though,
once you see what's going on.
> simplified version I have right now:
>
> html:
>
> <script language="javascript">
> // code snipped ...
> 'flashvars', 'instID=kyle',
Good, there's your FlashVars variable, as passed to the
JavaScript. Not
sure if that needs to be FlashVars as opposed to flashvars,
but it may not
make a difference.
> // additional code snipped ...
> <param name="flashvars" value="instID=kyle" />
> // snipped again ...
> <embed src="/flash/fcGalleryPreloader.swf"
quality="high"
> bgcolor="##000000" flashvars="instID=kyle" ...
Okay, good. And there are your FlashVars again, passed
directly to the
SWF (in case this user doesn't have JavaScript enabled (note
this part is
inside a <noscript> tag). So far, so good.
> AS3:
>
> var extVars:Object =
LoaderInfo(this.root.loaderInfo).parameters;
> instID_txt.text = String(extVars["instID"]);
At this point, you've lost me, but it shouldn't be hard to
nail down. I
see you've got a text field with the instance name
instID_txt, and you'd
like to set its text property. To do that, just reference the
instID
variable in the parameters property of that LoaderInfo
instance:
instID_txt.text = root.loaderInfo.parameters.instID;
David Stiller
Adobe Community Expert
Dev blog,
http://www.quip.net/blog/
"Luck is the residue of good design."
Similar Messages
-
I've seen many posts about URL Variables, and I've tried implementing the solutions, but nothing seems to be working, so I'm hoping that someone out there might be able to help me with my situation.
I have built a JSP page in JDeveloper. The page must identify the visitor using an id (passed as a url variable) as well as an account_id entered by the user on the page. I've created a procedure in my ModuleImpl.java file that receives both the url variable and account_id and then calls a pl/sql transaction I've created in the database.
Thing is, if I take the procedure, which I've allowed to be shared to the Client interface, and plop it on my JSP Page, I get two inputs, one for the account_id and one for the url variable, meaning the user has to enter the url variable in the field for the procedure to work.
I've tried modifying the value of the field and setting it equal to #{param.id}, but when I run the page, the input becomes a display field and is not sent to my java procedure. I've also tried the FacesContext way of getting a url parameter, but I can't get that to work in my java file.
What I would like to have (or at least what my intensions were when I started this project) is to have the url variable field be hidden and automatically populated with the url variable so that when the customer enters their account_id and clicks submit, both the account_id and url variable are passed.
Any idea on how to implement something like this?You can try setting the value of the parameter in the
pagedef.xml file for your page directly using
expression language.Thanks for your reply! I did that, or at least I think I did. Here is the NameData tag in my pagedef.xml file:
<NamedData NDName="web_hash" NDType="java.lang.String"
NDValue="${bindings.save_new_password_web_hash}"/>
what I've tried doing, is changing the NDValue to the three values below, all of which didn't work (returned null):
NDValue ="${param.id}"
NDValue ="#{param.id}"
NDValue ="${facesContext.externalContext.requestParameterMap['id']}"
is there a different expression I should be using?
Also, I will take a look at the solution you likend to. -
Get URL variable in customer exit
Hi,
does anybody know how to process a variable value in a customer exit which was filled by an URL parameter? I have created an iView which calls a webtemplate via URL "http://<SERVER>/sap/bw/BEx?sap-language=EN&bsplanguage=EN&CMD=LDOC&TEMPLATE_ID=ZTEST&var_name_1=MyVAR&var_operator_1=EQ&var_sign_2=I&var_value_low_ext_1=12345".
When I execute the iView the value "12345" is correctly transported and stored in variable "MyVAR" and the result is also filtered on this value.
Now I would like to modify the value in a customer exit but it seams as the entry is not not stored in table i_t_var_range. Any ideas how I might get access on the URL parameter value?
Thanks, CarinaHi,
I have exactly the same problem. Have you solve this problem ?
It must exist a solution because SAP kowns how to get URL filters in standard, but I don't kown how!
Thanks in advance for any help.
Philippe -
How get URL variable and show picture?
I have a url, for example:
www.MyWebsite.com/Flash.html?Pic1=1.jpg&Pic2=2.jpg&Pic3=3.jpg
Flash.html has a Flash swf file in it.
In my FLA file I want to dynamically show (in 3 movie clips,
mc1, mc2 & mc3) the 3 pictures from the 3 URL arguments.
How do I do this?
Thanks!To clarify some requirements: I can only use a URL, a HTML
file and SWF (no scripts). AS is ok. Cant use code to create EMBED
params etc...
Also, this has to work in MX.
Any ideas? Thanks. -
Business Connector : get querystring variables in url
Hi;
I have a server service in Business Connector .
a client post a url like this
http://10.10.10.10:5555/invoke/MM/mm2sms?drug_code=905913&drug_desc=aaaaa
I have to get these variables drug_code,drung_desc and assing to a recordList..
Firstly Which methods do i have to use and how?
stringToDocument , documentToRecord?
Thanks.Just declare these parameter names as input variables of type String in the Business Connector service. Then you will have them in your pipeline automatically.
CSY -
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 -
Url variable doesn't work in IE
Hey guys, my page, www.powerhouse.com/Products/Inventory.php I have a bunch of links that reload the page with a url variable. If FF 3, this works fine, yet in IE 8 the page does not load. My error log has the following error:
script '/var/www/powerhouse/public_html/Products/inventory.php' not found or unable to stat
what stupid IE Hack do I need to get this to work?PHE Admin wrote:
My error log has the following error:
script '/var/www/powerhouse/public_html/Products/inventory.php' not found or unable to stat
what stupid IE Hack do I need to get this to work?
You don't need any IE hack. I have just tested the page in both FF and IE8. It works just fine in both.
However, it's very noticeable from your error log that it refers to inventory.php (all lowercase), whereas the actual page is Inventory.php (initial cap). The other thing that's noticeable is the path, which indicates your server is running on Linux, which is case-sensitive.
From this, I conclude that you originally coded the page using inventory.php, and later updated it. This suggests that IE8 is probably still using a cached version. Clear your cache, and the problem will probably go away. -
Parsing List in URL Variable for Query
Hi, I am sending a url variable as in the following example:
http://mypage.com/lookup.cfm?var=1001,1002,1003
I then need to query a database given the string
"1001,1002,1003" in #URL.VAR# to find all records that contain
those RecID numbers in my table. Has anyone done this before, and
if so what is the best way to accomplish this?
Thanks!i tried using the following code, but keep getting an error:
<cfif listLen(url.var) neq 0>
<cfquery name="lookup" datasource="#application.dsn#">
select *
from INVENTORY_CATEGORIES
where
<cfloop list="#url.var#" index="i">
<cfif isNumeric(i)>
CATEGORY_ID= <cfqueryparam cfsqltype="cf_sql_integer"
value="#i#">
and
</cfif>
1=1
</cfloop>
</cfquery>
<cfelse>
<cfset LOOKUP.recordcount=0>
</cfif>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
<td> </td>
</tr>
<cfoutput query="lookup">
<tr>
<td> </td>
<td>#row_id#</td>
</tr>
</cfoutput>
</table>
The error I am getting is:
Error Diagnostic Information
ODBC Error Code = 37000 (Syntax error or access violation)
[Microsoft][ODBC Microsoft Access Driver] Invalid use of '.',
'!', or '()'. in query expression 'CATEGORY_ID= Pa_RaM000 and 1=1
CATEGORY_ID= Pa_RaM001 and 1=1'.
The error occurred while processing an element with a general
identifier of (CFQUERY), occupying document position (2:1) to
(2:54).
Date/Time: 07/24/06 09:50:54
Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)
Remote Address: 127.0.0.1
Query String: var=2042,2045
Any ideas? Also, please keep in mind that the variables I
will send across th eurl may also have letters. For example,
var=m1001,1002,p30014. Thanks! -
Dynamic list to generate url variable
Hello, I am using a dynamic list to pull product codes from a
database. I then want to pass the code into a url variable when it
goes to the results page. This is so customers can chose which code
they want to go to a detail page about. I already have the dynamic
list working, I just can not figure out how to embed the selected
code into a url variable. For example I want it to do the
following:
sitename.com/search.php <--- here is where you start and
make the selection then it brings you to:
sitename.com/details.php?code=202 <---- code202 was
selected on previous page in dynamic list.
I know how to do it by pulling results from a database and
generating links for each one, but I need to do it from a dynamic
drop down list.
Here is the coding that I was trying to use:
Thank you for your assistance.Sorry, dumb error on my part. Used method=post rather then
get. -
URL Variables used to set the source property for the VIDEO COMP.
Can you take a url variable and have that variable be the value for the source parameter of the video playback component in flash CS4 or CS5?
Example:
the url with url variable: http://www.mydomain.com/videos/videoplayer.cfm?vplayer=videofile1
the actionscript 3.0
var videoFile:String = [who do I get the url variable's value here?]
myVideoPlayer.source = videoFile +".mp4"
in the end the file that should be playing in the video player is: videofile1.mp4
Thanks.Either
A) Using ExternalInterface, call a Javascript function that returns window.location.search
B) Use Javascript to create FlashVars from window.location.search -
Replacing "+" in url variable to spaces
Hello, thanks in advance for your help.
I want to pass a url variable as a title for a page. I want
to separate the words with a "+" in the url.. then when I output it
on the webpage, I want to "+" to get replaced with spaces. Is there
a function that will do that?
Thanks, SteveWhy bother using plus signs as word separators? Use blanks.
Before you put the title into the URL, use the function
URLEncodedFormat() to encode the spaces.
If that does not work for your application some reason (such
as the text is already delimited with plus signs when you get it),
you can use the Replace() function to change the plus signs to
spaces before you display the title. -
How to read url variable javascript problem
How to read the variable of latitude 1.22 and longitude 103.56.
This is my website: 127.0.0.1/1/map2.htm?latitude=1.22&longitude=103.56
function getUrl_Map()
//Get the variables in the URL
var vars = [], hash;
var latitude = getUrlVars()["latitude"];
//To get the second parameter
var longitude= getUrlVars()["longitude"];
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
alert('DEBUG: hashes= ' + hashes);
// read the file http://127.0.0.1/1/map2.htm
// read the file http://127.0.0.1/1/map2.htm? -->hashes
for(var i = 0; i < hashes.length; i++)
hash = hashes.split('=');
//alert('DEBUG: i= ' + i);
//i=0
alert('DEBUG: i= ' + i + 'hash = ' + hash );
vars.push(hash [0]);
vars[hash [0]] = hash [1];by the way you know that 127.0.0.1 is the address you use to get to your own computer right? It's the loopback address. so posting it doesn't really help anybody see the page, if that was what you were hoping.
-
PHP URL Variable from Insert Record Issue
I have a very simplistic forum style website I have put together. Everything is functionally properly except for one aspect. The basic structure is a page that lists the existing threads (ie: ThreadA, ThreadB, and ThreadC). I have the name of these threads stored in a MySQL database table that is used to generate a repeating dynamic table to grow as the number of threads increases. If the user clicks on one of these links they are taken to a page that displays all of the comments pertaining to that thread. All of the comments are stored in another MySQL database table. I perform a query on this comments page to filter the information in the comments database by the thread name which is passed over from the first page via a URL variable. The link attached to the name of the thread in the repeating table that generates the URL variable is "comments.php?thread=<?php echo $row_threads['threadName']; ?>" This works perfectly, If the user clicks on ThreadB they are taken to the comments page where only the comments pertaining to ThreadB have been filtered and displayed. After the user inserts a comment form ThreadB the comments page reloads displaying the newly created comment.
Also, on the first page, the user has the option to create a new thread; call it ThreadD. The name of this new thread has to be inserted into two tables; one in the master threads table and one in the comments page any time someone adds a comment. (I'm sure there is a better way to structure this, but this was all I could figure out and for my purposes at hand it is sufficient). When the user is taken to this new comment page I have a query set up to pull the last entry in the threads table from the logged in user, ie the newly created thread topic. I have dragged this query to the page to make sure it is pulling the correct thread heading, and it works just fine. What I'm wanting to have happen is after the user enters the first comment I'm wanting them to be redirected to the main comments page with their new comment listed; giving the illusion that the new comment and existing comments page are the same. I'm trying to pass the newly created thread name, ThreadD, in the URL to the main comments page just like I do if they select it from the existing threads page. Under the insert record wizard I click the 'browse' button to select the comments.php page. I then select 'parameters' to add the thread name query as the URL parameter. The generated code is "comments.php?thread=" . $row_threadName['threadName'] . "". The user does go to the main comments page but the URL variable is not coming with it. What I'm left with in the address bar is ..."/comments.php?thread=&" , but it should be ..."comments.php?thread=ThreadD". I tried copying and pasting the URL link from the existing threads page since that works perfectly, and when I do that the main comments page shows up blank after being redirected from the new comments page. If I hard code this, for testing purposes, into the redirect after insertion section (ie: "comments.php?thread=ThreadD") everything works perfectly and the URL in the address bar of the main comments page is "...comments.php?thread=ThreadD&" I noticed the extra "&", but didn't give it much thought since the site is giving me the behavior I'm looking for. My question is, how do I get this new comment page to pass the variable of the newly created thread name to the main comments page to behave like it does when the thread is selected from the list of existing threads? I know it has to do with how the URL variable is either being generated or built from my query, or how I have it listed in the redirect section of the insert wizard, but I can't figure out where I am going wrong. Please let me know if there are any questions or if I need to clarify any aspect. Any and all help is always appreciated. Thank you.Ok, so just to summarize so I am understanding this correctly. You have an ordering page for tires/wheels. A customer places an order for tires/wheels and the data is submitted successfully and this includes a symbol for measurement (in.). But on another summary page the symbol is returning a blank value.
If this is correct we need to see:
- First, the code that is inserting the symbol to the database table in question
- Second, the query and code where you are printing the data to the screen. -
I have this URL-variables: test.php?id=1&kw=lente. id and
cat_lev02 are dynamic placed.
Now I want to filter the content so only item id="1" with
cat_lev02 = "lente" are shown:
id and cat_lev02 are dynamic placed in the link above. How
can I do this? Look at the code I use to get id: How can I put
something like WHERE name_lev02 = %s AND cat_lev02 = %s... (because
this is not working)?
Thanks a lot for further help.Ullitasch wrote:
> Now I want to filter the content so only item id="1"
with cat_lev02 = "lente"
> are shown:
> id and cat_lev02 are dynamic placed in the link above.
How can I do this?
Build the SQL query in the Advanced mode of the Recordset
dialog box.
For each dynamic value, define a variable by clicking the
plus button
alongside Variables, and entering the details in the dialog
box.
For example, build the query like this:
SELECT * FROM ul_posts WHERE id = col1 AND cat_lev02 = col2
Define col1 like this:
Name: col1
Type: Integer (in older versions of Dreamweaver, this is
Numeric)
Default value: -1
Runtime value: $_GET['id']
Define col2 like this:
Name: col2
Type: Text
Default value: -1
Runtime value: $_GET['kw']
David Powers
Adobe Community Expert, Dreamweaver
http://foundationphp.com -
Why not add a custom URL variable to publishing options?
This program is great to animate with, but EXTREMELY FREAKIN' FRUSTRATING to implement. A lot of this could be alleviated if the "publish" options let me specify an URL at the host level (or better yet an FTP protocol that I could upload my work with, while I'm dreaming). This way, the code could reference the folder that I put it in on my existing website and save me the step of editing the javascript and declaring a variable and redirecting every asset to it EVERY SINGLE TIME I UPDATE the stupid thing, because in case you haven't been able to tell from MY ANGRY CAPITAL LETTERS I have been having issues with getting my Edge animations to display, and when they do they are HORRIBLY BROKEN (they work in the previews and no where else), and there doesn't seem to be a lot of support here for the problems I've been having.
Unless im missing some setting somewhere, this is a major oversight on adobes part. There should be a "push URL" and "preview location" settings for projects. Push url would be the root for your medias location in the site, say something like "//www.yoursite.com/media/project1/" (notice double slash, no httpxxx) then the preview location would be using the same folder structure in something local like "C:\Users\YourAccount\Documents\edge\project1", or something on a dev server like "http://dev.yoursite.com/test/edge/project1". The difference would be the "preview location" variable would be used during construction (to preview) whereas the "push URL" variable would replace it in scripts upon publishing the media.
Also to prevent source conflicts, and for speed, there should be CDN options for the edge library + use googles CDN for the extra jquery. No sense uploading multiple instances of libraries for every media project...this also doesnt take advantage of common client caching. Also prevent breaking sites and redundant calls, allow use of legacy jQuery.
As found on http://www.adobe.com/devnet-docs/edgeanimate/api/current/index.html#CDN-Hosting here is the Edge library:
<script type="text/javascript" charset="utf-8" src="http://download.adobe.com/pub/adobe/edge/animate/2.0.0/edge.2.0.0.min.js"></script>
As found on https://developers.google.com/speed/libraries/ here is the jQuery library:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
What would this prevent? Lots of things...but mostly manual fixes. For example lets say you have a media object/banner that resides on every page on the site. Under current "/" root mantra, it would function only on the homepage. As soon as you traverse to a new URL, it appends the media calls after that url. So it ends up looking for "https://www.yoursite.com/banannas-for-sale/project1" instead of "https://www.yoursite.com/media/project1/"
Hopefully someone at Adobe actually reads this and answers the hundreds of folks who have ran into this issue. Thanks.
Maybe you are looking for
-
Could not Restore the restricted-segment image
I was having a lot of problems with my G3 i-book. I ran Norton disk doctor, disk utility and apple hardware test. Hardware checked out fine but Norton could not fix the problem even from the start up disk. I decided to re-install original system soft
-
Saved Photos Sync - How to Sync the photos from iPod touch to Mac
How can one syncrhonize the "Saved Photos" on an iPod touch (or iPhone, for that matter) to Mac OS X? Certainly using iTunes the specified photos on Mac OS X are saved to the iPod touch, but I don't see how to get the "photos" (snapshots of the iPod
-
Flash script image not displayed correct size
I have a contact form image on my website at the bellow URL. this is not displaying at the correct size when viewed from any firefox web brouser, but is fine when viewed from other browsers like IE9, Chrome, etc. I wonder why this is and if there is
-
Hi Can any one send me the link for sap business workflow help. Thanks in Advance Satish
-
hi, I got succeeded while connecting to TAF service i.e my service name is CRM for TAF and I connected to sqlplus with the command SQL>connect system/mypassord@CRM and it got connected but now when I try to connect it again as I got disconnected, i g