Remove all url parameter in file:/// - html

I am developing a Cordova App, and I use a URL parameter to manipulate or control my pages. e.g.:
file:///App/www/index.html?goto=profile
What I am trying to do is to remove the goto parameter from the URL.
An example use case: the user login using a temporary password. When the user logged in successfully the app will point them to the "change password" page, which is represented by a parameter on the url - ?goto=profile. Now the url has this parameter.
The problem here is that two parameters are set; ?goto=profile and ?goto=messages (directed the user on his inbox page). So the url now would be file:///App/www/index.html?goto=profile?goto=messages.
How to remove the ?goto=profile in the url without reloading the page?

to add multiple search query parameters, concatenate them with an ampersand (&). e.g.:
file:///App/www/index.html?goto=profile&goto=messages
if you don't want multiple parameters (they have the same name, so i presume you only want to replace the goto parameter value), just overwrite it.
i don't know the implementation used for routing, as you did not specify it in your question, but with plain javascript, it'd be something like this:
location.search = 'goto=messages';

Related

How to access local webpage with parameters in vb?

I've scenario where i want open local web page (index.html) passing parameters in query which i can used in index.html but i'm having problem as it gives error as per below,
The system cannot find the file specified.
Vb.net Code
Dim url As String = ConfigurationManager.AppSettings("Url")
url = url & "?id=" & txtFilePath.Text
//Url example
"C:\Program Files\Products\Bella\index.html?id=232"
Process.Start(url)
i do not completely understand your question but i will try.
I do not know what the value of "Url" is, neither what the txtFilePath.text is supposed to be. but if you are trying to open a URL like
localhost/index.html?id=example
in a browser, you should use that as the first parameter.
Process.Start("IExplore.exe", url)
If you are trying to get the server to read the parameter you put into the URL, i do not know if you can make html-pages get parameters like that, maybe PHP or something else? But that should not make a difference at all for launching the browser and stuff, just a heads-up :)
But if you just want to open a static html file in a browser-window, you are, as far as i know, out of luck with passing parameters, but you SHOULD test for the existence of your file, so you are completely sure it exists in that path.
File.Exists(url)
EDIT:
Since your url is "C:\Program Files\Products\Bella\index.html?id=232" i do not believe you could pass parameters, i think it will try to find a file with the extension ".html?id=232", which obviously does not exist.
It seems there are two issues:
First:
I think the reason for the error is you need to have "file://" before the URL (as Mych mentioned in the comments) in order to access a local web page. Many browsers will automatically assume the URL should have "http://" unless you specify that it's a local file.
Depending on your browser it may add more forward slashes, but two should be sufficient to get Process.Start to recognize it.
So your URL should look like this:
"file://C:\Program Files\Products\Bella\index.html?id=232"
Second:
As far as passing a parameter to the URL the best way I have found (as jakobS suggested) you would have to use:
Process.Start("IExplore.exe", url)
'or
Process.Start("Chrome.exe", url)
or whichever browser you prefer.
So you could modify your code this way:
Dim url As String = ConfigurationManager.AppSettings("Url")
url = url & "?id=" & txtFilePath.Text
'Add "file://" to the beginning of the url.
url = "file://" & url
Process.Start("IExplore.exe", url)
That should get rid of your error and load the page with your parameters.
Hope it helps!

$_GET values being stripped by returnUrl (on an authentication server not under my control)

Issue:
An authentication server (not under my control) is stripping get values after the first from the returnUrl. Is there any way to work around this? (Or around the larger problem as a whole?)
e.g. http://authentication.corporate.com?returnUrl=http://localserver/addcomment.php?FirstName=Sally&SecondName=Sparrow redirects as http://authentication.corporate.com?returnUrl=http://localserver/addcomment.php?FirstName=Sally, stripping any subsequent $_GET values.
(I am led to believe through my research that the stripping of the $_GET values may be an issue with what the authentication server is doing, but I have no way of getting access to it. If this is the case, is there a workaround? If this is not the case, what am I doing wrong?)
Context:
I am writing part of a web application which is to allow users to add comments to documents. The web application must retrieve the user's (correct) corporate username, first name and last name.
I am updating a previous version of this web application which allowed users to add comments in a two-step process.
Step 1 After clicking an 'Add Comment' hyperlink, the user is authenticated and a returnUrl value directs them to a page where they may add their comment. http://authentication.corporate.com?returnUrl=http://localserver/addcomment.php
Step 2 In addcomment.php $_POST values have been retrieved (and confirmed as correct) from the authentication server. The user may then enter their comments in a textarea and submit them via action=post to a final page which inserts the comment and user information into a database.
I would like to reduce this to a one-step process where the user may type in a comment on the main page. The way I am attempting to do this is by passing the comment as a $_GET value to be returned via the authentication server. e.g. http://authentication.corporate.com?returnUrl=http://localserver/addcomment.php?FirstName=Sally&SecondName=Sparrow along with the $_POST values.

SSRS Url Access Specify Format Breaks Report When Parameter Page is Triggered

I am using SSRS (2008R2) Url Access to render reports in a web application. I need to specify the format of the report, and am able to successfully do so using the rs:Format= option, so long as the report doesn't have any required parameters that need to be specified.
If the report requires the user to enter a parameter, it fails. If I then remove the rs:Format option from the URL, the report's parameter page will come up fine and if I make selections, the report will render.
My URL Access URL looks like this:
https://www.imnottelling.com/ReportServer_SQL2008R2/Pages/ReportViewer.aspx?/AppReports/Cool+Report&rs:Command=Render&rc:LinkTarget=main
Note that the error message I receive when attempting this tells me that a parameter is missing, which varies, depending on the report that is attempted to run.
This leads me to believe that either (A) this is not supported or (B) I'm missing something in my URL.
Any help would be greatly appreciated.
This should be 'as designed' I believe as the 'rs:' portion of the url is saying 'RenderState(something)'. If the report has REQUIRED parameters you have three choices:
Set a default
Pass them to the Rest URI
Remove them if you want to autogenerate via Rest URI
Generally you just need to add the parameters to your rest uri like:
main root
http:// (servername)/ReportServer/Pages/ReportViewer.aspx?
directory (if you have one)
%2fTest%2f
itemname:
ComboWithParm
renderit:
&rs:Command=Render
parameters:
&Parm=HereIAmPassedInThroughAnUrl
All at once:
http:// (servername)/ReportServer/Pages/ReportViewer.aspx?%2fTest%2fComboWithParm&rs:Command=Render&Parm=HereIAm
If you are using a web application with .NET technologies and ASP.NET I believe you can use the report viewer object. Else you may be forced to deal with using the report url. I know I read a book by Brian Larson for SSRS 2008 and he had an example where you basically bind an HTML form and also use a select node in the form object to set properties of the service. If you were doing HTML natively this may be a good idea as well. It was similar to this:
<form id="frmRender" action="http:// (servername)/(pathtoreport)" method="post"
target="_self">
<H3>My Report Title</H3>
Render in the following format:<br/>
<Select ID="rs:Format" Name="rs.Format" size=1>
<Option Value="HTML4.0">HTML 4.0</Option>
<Option Value="IMAGE">TIFF IMAGE</Option>
</Select>
</form>

google analytics filter setting for cross domain tracking

Has everyone try to modify cross-domain profile with a filter to show the full domain in content reports? How long this changes will take effect?
I followed the following steps. But nothing change.
https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite
In the Profile Settings page, click the Add Filter link.
Choose Add New Filter and provide the filter a name.
Choose Custom Filter and select Advanced on the Filter type settings.
Under Advanced settings:
a. FieldA should be set to Hostname
b. FieldB should be set to Request URI
Set the values for both Field A and Field B to (.*), which is an expression that captures all characters.
Set the Output To --> Constructor option to Request URI and provide $A1$B1 as the value for that choice. Your reports will now show: — www.example.com/index.php — sub.example.com/more.php This will capture the www.example.com portion of your URL and include that at the beginning of your page URL in the content reports section.
Filters are not applied retroactively. All data in analytics is static. Once it goes in it can't be changed. If you setup the filter today it will start to add the hostname to the url from now on.
You can also setup a custom report that drill down from hostname to path or even one that shows both side by side. This should give you the same data, except that it is subjected to sampling if you have too much data, where the default reports are not subjected to sampling because they are pre-processed.
eg:
https://www.google.com/analytics/web/permalink?uid=c00k2_9TSNeLVakblonUZg

Oracle APEX - HTML Links Breaks Session and Requires New Login

Ok so here is what is happening:
I have a client that I am building an application for. My client has a flowchart that they would like posted on the front page of their application. Check. My client then wants this flowchart to be set up as an image map so that a user could click one of the boxes in this flowchart and be taken to a report in another part of the application. Check.
All of that is elementary and, in a technical sense, works. The issue is, and it is an issue I have encountered before with APEX, is that every time a user clicks one of these links it takes them to the login screen. It seems that linking directly to a page's URL breaks the session and requires you to login again, even if you are linking from one page in the application to another in the same application.
I have played with all of the authentication settings in a hopes of fixing this and tried to determine what is breaking the session exactly but with no luck.
Has anyone else had this problem and could share their method for fixing it? I really cant have users logging in every time they click a link and I also cannot simply remove the authentication on the pages. Thanks in advance.
You should pass on the session id in your links. If you don't, then apex will see this as a new session. You can tell from the url: take note of the session id in your url when you are on your image map. When you select an application, take another look at the session id part in the url. If they are different, then you are starting a new session each time.
/apex/f?p=190:90:1674713700462259:::::
190 -> application id
90 -> page id
1674713700462259 -> Session id
To pass on the session, it depends where you construct your links.
In PLSQL, you can find it through :SESSION or :APP_SESSION
For example, in a plsql dynamic region: htp.p('the session id is '||:SESSION);
In javascript code you can use $v("pInstance") to retrieve the value dynamically, or use &APP_SESSION. which will have the value substituted at runtime.
Small example:
function printsome(){
var d = $("<div></div>");
d.text('&APP_SESSION. = ' + $v("pInstance"));
$("body").append(d);
};
So you probably just need to alter the construction of your link somewhat to include the session!
I was assuming the binding variables will do the job. But they were helpless.
Best way is to pass the current session id to an item then use the item value in the link.
f?p=&APP_ID.:32:&P31_SESSION.:::P32_CUSTOMER_ID:#CUSTOMER_ID#