w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Click many links, in one page, with a Greasemonkey script?
var all = document.getElementsByClassName("delete"); for(var i=0; i<all.length; i++) { var deleteUrl = all[i].href; var ifr = document.createElement("IFRAME"); document.body.appendChild(ifr); ifr.src = deleteUrl; } You could run a simple script like the above in the browser's JavaScript console or make it a bookmarklet.

Categories : Javascript

Reponse.Redirect doesn't work immediately C#
You cannot redirect in a Try-Catch because a ThreadAbortedException is thrown. You need to pass false to Response.Redirect to do so. Boolean Indicates whether execution of the current page should terminate. So either save the redirect location and redirect after the try-catch or use Response.Redirect(url, false). string ProfileID, UserID, redirectUrl; try { ProfileID = Request.QueryString["ProfileID"].ToString(); string SelectQuery; DataSet ds; try { UserID = Session["UserID"].ToString(); if (ProfileID == UserID) { redirectUrl = "user/Default.aspx"; } else { //some code here } } finally { //some code here } } catch { redirectUrl = "DoesNotExists.aspx"; }

Categories : C#

Beforeunload is not working to redirect user to another page, how can I redirect user to another page/url when he attempts to close a window/tab?
*Don't do it* But it is possible with the user's permission; you can achieve something like this (took me a while to find a website that was happy in a frame) window.onbeforeunload = function () { window.setTimeout(function () { // escape function context window.location = 'http://bbc.co.uk'; }, 0); window.onbeforeunload = null; // necessary to prevent infinite loop // that kills your browser return 'Press "Stay On Page" to go to BBC website!'; // pressing leave will still leave, but the GET may be fired first anyway } Demo

Categories : Javascript

Router and redirect special
This re-write rule might help you.. This rewrites every request that come to site.com/(anything) to site.com/holiday/(anything): RewriteEngine on RewriteRule ^([a-zA-Z]+)/?$ /holiday/$1 Just put this in your .htaccess and it will do it's job. If you want only the site.com/christmas to be redirected try this: RewriteRule ^christmas/?$ /holiday/christmas

Categories : PHP

How to redirect /page/index page to /page (and /page to /page/) in Ruby on Rails?
If you don't want to cause a full reload of the page, then you should not use "redirect" in your routes, as that simply issues a browser redirect. That would cause Rails to issue a 301 "Moved Permanently". That essentially means "there is a /page/index route but it's a mistake, we don't use it anymore, please go to /page instead and never come back here." If that is the case then that is what you want to do. If you're using Passenger and will continue to use Passenger, it would be more efficient to put an Apache redirect rule in the htaccess file. It also seems strange that this is even an issue. How have /page/index, /page, and /page/ emerged in the wild as URLs that all point to the same index#index action? What is this index controller? The usual thing is to have, say, a PagesControlle

Categories : Ruby On Rails

SSIS 2012 - Redirect Rows with Special Characters
I'd look at adding a Script Component into your data flow and have it validate your data. Add a column called HasJunkData to the output of type boolean (DT_BOOL). If you have multiple things to validate, depending on the level of granularity required, you might want a flag per input column or simply decide at the row level whether its good or bad. Inside the script itself, I'd use something like How to recognize if a string contains unicode chars? to identify the presence of bad characters or potentially a regular expression depending on what "special characters" means to you.

Categories : SQL

Why is a "redirect" (that is, `return "redirect:/myPage"`) not working for my Tiles page definition?
Thanks to hints left by Sotirios' comments, I discovered that my inability to "redirect" to "myPage" had nothing whatever to do with Tiles. Rather, after a harder look, I realized that it was the configuration of the controller associated with "myPage". I had to add the following "public ModelAndView myPage(HttpSession session)" method to the Controller (see snippet, below), in order to perform a successful redirect (i.e., from another controller)...i.e., using return new ModelAndView("redirect:/myPage"); The problem was that the "myPage" controller did not contain an "public ModelAndView myPage(HttpSession session)" method...(thanks again, Sotirius). Below, is the "public ModelAndView myPage(HttpSession session)" method - code snippet) @Controller @Scope("session") @

Categories : Java

Redirect an URL by default, and show the original page when ?redirect=false is shown
Well... you actually need to test for that query parameter. something like: if ((Request.QueryString["redirect"] == null) || (Request.QueryString["redirect"] != 'false')) Response.Redirect("NEW URL"); } base.OnLoad(e); The test for null is there in case the redirect parameter wasn't passed in.

Categories : Asp Net

JSF commanbutton refreshes the page and popup menu disappears immediately
<h:commandButton> has a default button type submit which submits enclosing h:form when it is clicked. That is why the page refreshes when you click. <h:button> should be used for java script usage.In addition, <h:commandButton> becomes <h:button> if type attribute is set to button. <h:button onclick="if (#{moneyTransferManager.showPopup()}) #{rich:component('popup')}.show();" value="Devam"/> Or <h:commandButton type="button" onclick="if (#{moneyTransferManager.showPopup()}) #{rich:component('popup')}.show();" value="Devam" > See Also : Difference between h:button and h:commandButton

Categories : JSF

How to gracefully tell client the transmission is finished so the browser will display the page immediately?
On IIS you cannot break the connection before the fastcgi finishes. You need to use fascgi_finish_request()^ to manually force the finish of the current CGI. On Apache you can use the Content-Length: 0 redirect trick^ which works great but does not work on IIS (at least not in my experience). PS: And make sure you do the ignore_user_abort(true) and extend the runtime limit set_time_limit(0)(infinte) before any of these to prevent PHP from closing when connection is closed by client. PPS: Tasks run after page is sent should go into cronjobs. It's the cleaner way to do things.

Categories : PHP

Jquery hide all but last four digits in text field on page load / immediately
Transferring a user's SSN between forms on the client side presents security concerns. You should look into storing the SSN on the server and having the server return something like *****1234 to load into other forms.

Categories : Jquery

What is the best way in jQuery Mobile to change to another page (inside the same HTML file) immediately after browsing to a URL?
Try binding to the pagebeforechange event which is the most suited for handling changes in the navigation, you just need to set the value of data.toPage to the page you want to show: $(document).on("pagebeforechange", myns.initialize); myns.initialize = function(e, data) { getContextFromURL(); // Populate context object // If the parameters in the hash do not specify an action, // go to the "menu" (list of actions) if (context.action) { // Populate contents of default page (for specific action) setAction(context.action); } else { data.toPage = $('#menu'); } } Note: If yo

Categories : Jquery

Submit form to php page and carry over POST data to redirect page
Simply, put your sending email code in your submitted.php code and using sessions prevent user from duplicating his input by pressing F5 or refreshing submitted.php as follows: in form.php session_start(); $_SESSION['submit'] = true; in submited.php session_start(); if (isset($_SESSION['submit']) && $_SESSION['submit']){ /* * do your code */ $_SESSION['submit'] = false; } else{ echo 'some error'; }

Categories : PHP

Urldecode bug: after adding a simple product to shopping cart on search page and redirect to current page
In this fle appcodecoreMageCoreHelperAbstract.php public function escapeUrl($data) this function is responsible for weird url. It use htmlspecialchars function of php whic replace & with '&amp;' see here http://php.net/manual/en/function.htmlspecialchars.php So what I do is comment this line $this->getResponse()->setRedirect($returnUrl); in my CartController _goBack method insrtead of I used my custom redirect method.

Categories : Magento

Can't redirect users to log in page when attempting to access a members only page
Turns out I was on the right track. All I needed to do was modify the authentication module from: <authentication mode="Forms"> <forms name=".ASPXFORMSAUTH" loginUrl="~/Account/Login" defaultUrl="~/" /> </authentication> to: <authentication mode="Forms"> <forms name=".ASPXFORMSAUTH" loginUrl="~/Account/Login.aspx" defaultUrl="~/" /> </authentication> The simple mistakes get me every time.

Categories : Asp Net

Redirect to the link page after the page has fully loaded
As far as I know, the only way to achieve this is to use AJAX to load your content. That is, instead of reloading the entire page for every link, you just reload portions of content depending on what link was clicked. Let's say your page has a container like this: <div id="content">...</div> Then, for every link (matching a certain condition if you don't want it to happen for all the links), you execute an AJAX request similar to $("a").click(function() { $this = $(this); var data = {}; // Put additional parameters here $.get($this.attr("href"), data , function(response) { $("#content").html(response); } } As @rofavadeka has mentioned, you can also modify the URL so that it reflects the change of location, using something like: window.history.

Categories : Javascript

How to make JS page redirect trigger before page load
Try this How to Run a jQuery or JavaScript Before Page Start to Load. Btw. if you want redirect without displaying page you must use php with cookies check.

Categories : Javascript

Set property of Page on Response.Redirect("Page.aspx")
You can use the following approach 1.Using Query String (Which is already implemented by you) 2.Using Session Variables You are using asp.net better to use multi-view instead of Divs

Categories : Asp Net

Response redirect to same page with querystring on page load
Only do the redirect if QueryString["First"] is not equal to "true" (though I think your naming and logic don't really match there). Something like: void Page_Load( ... ) { if (!Page.IsPostBack) { if (QueryString["VisitFlag"] == null) Response.Redirect("Welcome.aspx?VisitFlag=Done"); } }

Categories : C#

Generate QR code to special page
If the link from the QR code is simply www.myweb.com, I'm afraid you are out of luck. There is absolutely no difference between reading a QR code and accessing the link and manually typing in the address. The only possibility is you may be able to catch certain visitors if they are using an app to read the QR code, subsequently view the target page in-app, and said app has something identifiable about it's User Agent string. I have not experimented with this, but I would suspect this is actually not the case.

Categories : PHP

Redirect Admin to different page and User to different Page
So whats the problem in it? why don't you put User_Type in your database as a column in the table you are storing the user information and then retrieve its value and use it in switch condition to redirect the user to correct page. For example try{ con.Open(); cmd = new SqlCommand("select User_Type from TableName where username=@user", con); cmd.Parameters.Add("@user", SqlDbType.Int).Value = "PersonName"; dr = cmd.ExecuteReader(); if (dr.HasRows == false) { throw new Exception(); } if (dr.Read()) { int Value = Convert.ToInt32(dr[0].ToString()); } switch(Value)

Categories : Asp Net

redirect to another php page from the page which is call by ajax
Well i dont really know how you did your pages but for me i would use a meta tag. It best used if the person is not logged in and access the page . this is the code i used. So place this in your php coding so when ajax calls the files it will run through the php files and when it hits this line it will "refresh" another page and exit the main one echo '<META HTTP-EQUIV="Refresh" Content="0; URL=Login.php">'; exit; The person will be redirected immediately. And if you can Please Post your codes!

Categories : PHP

To redirect the page to current instead of logout page
Have you took a look at the existing Magento code that handles logout ? Class Mage_Customer_AccountController /** * Customer logout action */ public function logoutAction() { $this->_getSession()->logout() ->setBeforeAuthUrl(Mage::getUrl()); $this->_redirect('*/*/logoutSuccess'); } See the "setBeforeAuthUrl()" function ? Try to play with it to inject your current URL which you can retrieve with : Mage::helper('core/url')->getCurrentUrl();

Categories : Magento

Do some check before every page is loaded and redirect to another page
Ok, what are the purposes of your redirection need ? If it's about checking session User for authentification purposes, use filter: Let's assume there is login form at : http://www.domain.com/login.jsf. Once the user fires connect button, we want to redirect him to http://www.domain.com/member/welcome.jsf, and avoid other people not to access the member/welcome.jsf domain, I mean all the pages which are in http://www.domain.com/member/.... Here a simple design: @WebFilter("/member/*") public class SecurityCheck implements Filter { public void init(FilterConfig filterConfig) throws ServletException { } @Override public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws ServletException, IOException { HttpServletRequest request = (HttpServle

Categories : Java

trying to redirect from an ashx page to an aspx page
Since you are doing an ajax request clearly the Redirect should have no effect. What you need to do instead is do it from the client-side, on the success handler: public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string searchValue = context.Request["txtBoxValue"].ToString(); //Return the redirect URL instead context.Response.Write("SearchResults.aspx?search=" + searchValue); } $.ajax({ url: 'Handlers/SearchContent.ashx', data: { 'txtBoxValue': txtBoxValue }, success: function (data) { window.location= data;//redirect here. "data" has the full URL } }); Now, if this is all you are doing in the ashx handler, I don't really see the need for the ajax request.

Categories : C#

how to pass special character to another page using query string in JSP
Forget about the scriptlets, and learn the JSP EL and the JSTL: <c:url var="theUrl value="printselectedn.jsp"> <c:param name="CTextSearch" value="${finalsearch1}"/> <c:param name="CTextNumbr" value="${Mytext1}"/> ... you getthe idea </c:url> onclick="javascript:openWin('<c:out value="${theUrl}"/>')" Scriplets should not be used in JSPs for more than 10 years. Don't use scriptlets.

Categories : Java

display special price's end date to my product page in opencart
The problem is you are just getting a special for a product, regardless of if it's actually in date or for that customer group. The full query used to get a special is in /catalog/model/catalog/product.php (SELECT price FROM " . DB_PREFIX . "product_special ps WHERE ps.product_id = p.product_id AND ps.customer_group_id = '" . (int)$customer_group_id . "' AND ((ps.date_start = '0000-00-00' OR ps.date_start < NOW()) AND (ps.date_end = '0000-00-00' OR ps.date_end > NOW())) ORDER BY ps.priority ASC, ps.price ASC LIMIT 1) AS special So you need to add that to your query as well and supply the customer group id. You also need to check that the date isn't 0000-00-00 so your full code should look as follows $this->data['date_end'] = ''; $customer_group_id = $this->customer->isL

Categories : PHP

Colorbox on IE, opens a colorbox and then immediately follows the link off the page
The issue turned out to be having an itemprop="image" on the image url. Not really sure why that caused the issue but removing it has resolved the issue. This means that the JS is back to my original: $('a.gallery_image').colorbox({ transition: 'fade', opacity: 0.7, speed: 100, fixed: true, rel: 'gal_img', scalePhotos: true, maxWidth: ($(window).width() / 100) * 85, maxHeight: ($(window).height() / 100) * 85 });

Categories : Javascript

Url Redirect Parent page to a sub page
I figured it out its.. RewriteEngine On RedirectMatch 301 ^/web/?$ http://mysite.mycompany/web/design-vision/ RewriteRule ^web/?$ http://mysite.mycompany/web/design-vision/ [R=301,L]

Categories : Htaccess

Page not redirect to any other page during download
Maybe you need to make a wrapper page, like 01net, that has a link to the download link (in your case the php file above), then redirects to a thank you page using javascript. You can't do it the way you are trying to do.

Categories : PHP

Cannot 301 redirect this page to a specific page
Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory: Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteCond %{THE_REQUEST} ^[A-Z]{3,}s/+Login.aspx?ReturnUrl=\%2fPages\%2fHome\%2fUser\%2fWish-list.aspx [NC] RewriteRule ^ /en/ukeurope/home? [R=302,L]

Categories : Htaccess

Redirect to next page and increment page id
You can use this:- $value=current_value; $value=$value+1; header("location:http://mydomain.com/scanner.php?url=http://external-domain.com/index.php?article_id=" . $value);

Categories : PHP

How i can get the array ID from a page to another redirect page
Change $id=isset($_GET['ID']); to $id=isset($_GET['article_id']) ? (int)$_GET['article_id'] : 0; $id = isset($_GET['ID']); - this returns bool and moreover it will be always false because there is no ID in $_GET Your link looks like $mytext = $mytext . " <a href='$link?$var=$id'>read more...</a>"; it is parsed by truncate function which outputs <a href='article.php?article_id=SOME_ID'>read more...</a> so you should use on $_GET['article_id'] to get this id and you should cast it to int by (int) or intval() Two more things. Your code is very dangerous you should really read and google some topics that covers SQL_INJECTION Mysql_* functions are depracated and will be removed in future. Use PDO or Mysqli instead. These engines have something called prepar

Categories : PHP

How does web page redirect work in this page?
I used Fiddler to investigate and the site return for link http://www.seas.harvard.edu/academics/areas/computer-science HTTP 301 response code, that performs the redirect. I you want to get real URL. You should perform real request to harvard.edu web server and parse response. (Redirect URL is located in Location key in HTTP Header). Sorry about your second question. I don't have skill in Java. This SO question may help (httpclient-4-how-to-capture-last-redirect-url)

Categories : Java

How to redirect a page without the page extension
What you're looking for is called URL rewrite. Take a look at this tutorial for beginners: http://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/.

Categories : Htaccess

Redirect to wordpress page without page ID
Maybe you could use get_page_by_path() or get_page_by_title(). Both functions accept Post Type as argument, it's not only restricted to "pages". And they will return a full $post object, ie, $post->ID. Maybe a WPML function is needed, an equivalent of those. Or maybe a combination. See the docs for Language dependent IDs.

Categories : Wordpress

How to start special init event in a backing bean before JSF page loads?
The problem is that the @PostConstruct public void init() method is called after the managed bean is created and the fields are injected. Since your bean is @SessionScoped, it will live until the user session expires. A way to solve is to use <f:event type="preRenderView" listener="{bean.init}" /> as explained here: What can <f:metadata> and <f:viewParam> be used for? (no need to use <f:metadata> as explained by BalusC here: JSF: Does it matter whether place f:event inside f:metadata or not). Per your question update, this problem is handled in the first link. I'll post the relevant code to handle this situation (taken from BalusC answer): public void init() { FacesContext facesContext = FacesContext.getCurrentInstance(); if (!facesContext.isPostback() &a

Categories : JSF

How to show 3 most recent posts in a special tiles on home page using wordpress?
Here is one way to do it. If you're new you should read up on these essential topics: The Loop and WP_Query. <?php $query = new WP_Query( 'posts_per_page=3' ); // The Loop if ( $query->have_posts() ) { $i = 1; while ( $query->have_posts() ) { $query->the_post(); $i++; ?> <div class="tile<?php echo $i ?>"> <img class="post-image" src="<?php echo get_post_meta($post->ID, 'post_image', true) ?>"/> <div class="tile-datebox"> <img src="<?php echo get_post_meta($post->ID, 'post_icon', true) ?>" > <p><?php the_time('F jS, Y') ?></p> <div class="tile-info"><h1><a href="<?php the_per

Categories : PHP

Convert auto page numbers special character to actual value in InDesign document
Ok, I think I've worked it out. main(); function main(){ app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll; app.findGrepPreferences.findWhat="~N"; var FindGrep=app.activeDocument.findGrep(); for(i=0; i<FindGrep.length; i++) { var item = FindGrep[i]; var page = item.parentTextFrames[0].parentPage; item.contents = page.name; } alert("done"); } Struggled to find any valuable documentation from Adobe. This really helped: http://jongware.mit.edu/idcs5/ As well as this SO question: Get current page number in InDesign CS5 from Javascript Edit: If your page numbering is in a master, you will need to "override all page master items" (check the pages palette) Edit 2: This worked on inDesign 5.5 (not s

Categories : Misc

redirect to error page when error occurs and access denied in page
You can use Global.asax and use the Application_Error method in there handle the exception and redirect. Here is what I am doing : protected void Application_Error(object sender, EventArgs e) { Exception ex = Context.Error; if (ex is HttpUnhandledException) { ex = Context.Error.InnerException; } if (ex.GetType().Name == "FileNotFoundException") { //ignore } else { try { if ((ex as HttpException).GetHttpCode() == 404) { // Page Not found, redirect if (!ex.Message.Contains("error.aspx")) { Response.Status = "301 Moved Permanently";

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.