w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Grab Value from Javascript popup - use as php post value
Add an ID to the input field: <form id="frm1" action="login.php"> <input id="email" onclick="resetPassword()" type="text" name="email" value="Reset Password" style="cursor: pointer; background:none; text-decoration: underline; border: none;" /> </form> function resetPassword() { var email=prompt("Enter email to reset password.", "example@email.com"); if (email!=null) { document.getElementById("email").value = email; // Put value into form field document.getElementById("frm1").submit(); } } If you don't want the user to be able to type directly into the form field, you should give it the readonly attribute. onclick prevents them from clicking on it, but they could still get there with Tab.

Categories : PHP

PHP to post links to sub directories & php to display images
You need to get list of all files from current dir and it's subdirs (i.e. recursively). Please read examples from http://www.php.net/manual/en/function.readdir.php. There are few very good implementations of what you need.

Categories : PHP

Create blog post links similar to a folder structure
This is called Semantic URLs, they're also referred to as slugified URLs. You can do this with the .htaccess command RewriteURL Ex: RewriteURL ^(.*)$ handler.php?path=$1 Now handler.php gets /health/2013/08/25/some-random-title and this is your entry point.

Categories : PHP

changing direct links to route links
You may try this for some rough processing: Use href="([^"]+)" to find every link that actually points to some resource. Iterate over each found resource (group 1 of each match) and check if it starts with /, http:// or www.. If it doesn't, add a leading / and replace the original value in the code with the modified one (for the replacing, try replacing the value of the full match (group 0) with the modified value).

Categories : C#

Filter the output images links with javascript
If i understand you right , you need simply this: toInject += "<li class='"+classname+"'><a href='#'><img src='" + img_src.split(".").join("-150x150.") + "' width='75' height='75' alt='' /></a></li>"; Update after question edit: Is it possible for you to add a full path in the end like this: toInject += "<li class='"+classname+"'><a href='#'><img src='http://127.0.0.1/wordpress/" + img_src.split(".").join("-150x150.") + "' width='75' height='75' alt='' /></a></li>"; or you got your pp_images array already with full paths?

Categories : Javascript

JQuery/javascript: Dynamic gallery's images can be used as links but not as buttons. Why?
You need to prevent the default click behavior the plugin is trying to fire. $("#monja").click(function(e) { e.preventDefault(); alert('it works'); }); For more info as to how this works, check out Event Bubbling.

Categories : Javascript

How to load all the images from one of my folder into my web page, using Jquery/Javascript
Use : var dir = "Src/themes/base/images/"; var fileextension = ".png"; $.ajax({ //This will retrieve the contents of the folder if the folder is configured as 'browsable' url: dir, success: function (data) { //List all .png file names in the page $(data).find("a:contains(" + fileextension + ")").each(function () { var filename = this.href.replace(window.location.host, "").replace("http://", ""); $("body").append("<img src='" + dir + filename + "'>"); }); } }); If you have other extensions, you can make it an array and then go through that one by one using in_array(). P.s : The above source code is not tested.

Categories : Javascript

Getting Direct File Links from Dropbox
You can use the Chooser: https://www.dropbox.com/developers/dropins/chooser/android. It will present UI to the user to let them choose a file, and then it will give your app a URL you can use to download the file, or just the file content itself.

Categories : Android

Rails array of images -- create links that will display the next/prev images
You can use Jquery Sliders, image slide show plugins Image Slide show demo link

Categories : Ruby On Rails

AngularJS HTML5 Mode - How do direct links work without server specific changes?
The AngularJS documentation does in fact mention this Server side Using this mode requires URL rewriting on server side, basically you have to rewrite all your links to entry point of your application (e.g. index.html) In this case, one Java-based solution is to tell the server "map all urls to index.html." This can be done in any HTTP Server or container. I implemented this using Java/Servet since I want my application to be HTTP server agnostic (ie Apache versus NginX, or Tomcat/JBoss only). In web.xml: <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <servlet> <servlet-name>StaticServlet</servlet-name> <jsp-file>/index.jsp</jsp-file> </servlet> <ser

Categories : Java

.htaccess direct users to new folder
Try something like RewriteRule ^www.example.com/oldFolder/(.*) www.example.com/newFolder/$1 [R=301,L] It will set the moved permanently header whenever someone wants to reach old url and it will keep params after /

Categories : PHP

Cycle2: captioned images PLUS images are links
I had same issue. I removed data-cycle stuff for captions and just added a div with my caption text beneath the img tag but inside the anchor tag like this: <a href="some-link.html"> <img src="some-image.jpg" /> <div class="captions">here's my caption</div> </a> And I'm using the basic data-cycle-slides="> a" So apparently you can treat an anchor as a "composite".

Categories : Misc

How to not give direct acess to folder but to it's inside documents
Put a .htaccess file in that folder. .htaccess files are used by the server to follow some set rules. You should create this file with a basic text editor such as notepad, but not MSWord or a wysiwyg editor. Search your FTP, there might already be one, it might also be hidden so make sure you open the FTP with the option to see all files option -a. In the retrieved or newly created file, put the line Options -Indexes This will disable folder listing, giving a "Forbidden" error. Another option, is to simply put an index.html or index.php file in the folder, that way when typing the folder name as URL will serve the index page instead of the folder root. And it also allows you to display a user friendly error. Personnaly, I use both options.

Categories : PHP

Denying Direct Access(Download) to all files within a folder in WAMP
You should probably place the videos outside of the web directory if the only supported way to view them will be via a PHP script. Just give a download link to a PHP script and have the PHP script perform authentication and authorization and then serve up the video with appropriate headers.. The video files do not need to be in a web directory for this.

Categories : PHP

Pulling Random Images From A Folder Above The public_html Folder
Why not use an absolute path instead of: header('Content-Type: image/jpeg'); readfile('home/folder/my image.jpg'); like this: // notice the absolute path prefix if(!is_file($image_path = '/home/folder/my image.jpg')){ header('Content-Type: text/plain', 404); echo 'Image file not found!'; } // We got a file, keep going... header('Content-Type: image/jpeg'); header('Content-Length: '.filesize($image_path)); readfile($image_path); die; // done here Or use the path relative to current directory of .php script with __DIR__.'/path/to/image.jpg'.

Categories : PHP

Unlink images in images folder on webserver that are not present in csv file field column
Description First put all the images you want removed into regex as a | delimited list. Then use the regex to replace on the string. Regex: ,?(?:WG06HGY2.JPG|WG06HGY4.JPG|HELP1.JPG|HELP4.JPG)(?=[ ,]|) Replace with: nothing Example Sample Text FULL REG WG06HGY1.JPG,WG06HGY2.JPG,WG06HGY3.JPG,WG06HGY4.JPG WXT55331.JPG,WXT553312.JPG,WXT553313.JPG,WXT553314.JPG,HELP1.JPG,HELP2.JPG,HELP3.JPG,HELP4.JPG Code <?php $sourcestring="your source string"; echo preg_replace('/,?(?:WG06HGY2.JPG|WG06HGY4.JPG|HELP1.JPG|HELP4.JPG)(?=[ ,]|)/imsx','',$sourcestring); ?> After Replacement FULL REG WG06HGY1.JPG,WG06HGY3.JPG WXT55331.JPG,WXT553312.JPG,WXT553313.JPG,WXT553314.JPG,HELP2.JPG,HELP3.JPG

Categories : PHP

How can I grab the date of the last post on my blogger blog and display it on another site?
It is likely that your blog supports RSS. RSS provides an xml file with your recent updates so you could for example use a javascript / jQuery based parser to parse this file and get your last post date, title and link.

Categories : Javascript

Grab only text from blog post that includes image, tables, etc
You need strip_tags plus truncate truncate(strip_tags(post.text), length: 100, separator: ' ') And you should save the result in before_save callback into special field you talked about for optimization.

Categories : Ruby On Rails

How can I block direct access to images in a directory but allow PHP to display them?
Send the appropriate Content-Type header for the image, and then use readfile() to stream the bytes to output. Also, if you're going to use a filepath in the URL for this, be certain to sanitize the filepath first so that e.g. /etc/passwd can't be read using your script.

Categories : PHP

Loading all images from folder & make named Images from them
Find the 'real path' to that directory on the server. Use it to establish a File object. Create a FilenameFilter for PNG. Use File.listFiles(FilenameFilter) on that source directory. That will return a File[] containing references to the PNG files. That is assuming the images are on the class-path, as loose File resources. If they are in a Jar, we must iterate the ZipEntry objects of the Jar to dynamically discover what it contains.

Categories : Java

Avoid direct access to images in a directory on server through htaccess?
There are 2 ways to do this Method 1 When you deny access, even you can't access it through a webpage. Step 1: Prevent access to mysite.com/member/ Into folder member, create new .htaccess file and add the following lines: Order Deny,Allow Deny from all Step 2: Set up an alternative way to access the files for yourself Into folder member create file get_image.php and add the following code: if( !empty( $_GET['name'] ) ) { $img_name = preg_replace( '#[^-w]#', '', $_GET['name'] ); $img_file = "{$_SERVER['DOCUMENT_ROOT']}/member/{$img_name}"; if( file_exists( $img_file ) ) { header( 'Cache-Control: public' ); header( 'Content-Description: File Transfer' ); header( "Content-Disposition: attachment; filename={$img_file}" ); header( 'Content-Type:

Categories : Htaccess

How to download images from the URL to images folder-Grails
You should not download anything into web application inner folder, because when you redeploy the application the files inside will be lost. Instead, you have to create a folder on your hard-drive and make it accessible (permissions) to the application server. After that follow this answer to save the file How to create file in current system from within grails controller action and save data fetched from database? . Note, you're dealing with binary file format!

Categories : Image

Images within a post display fine but clicking on images return 404 not found error
Your permalink structure is incorrect. You need to change it back to nascentarray.com/year/month/date/post-name/ If it's already that way, then you need to double check your folders in uploads. Because if you look at your one page here http://nascentarray.com/2013/06/17/stock-wallet-the-only-wallet-you-will-ever-need/ That image is linked with ../year/month/date/post_name/image_name/ i.e. http://i0.wp.com/nascentarray.com/wp-content/uploads/2013/06/stock_wallet_2.jpg?resize=389%2C176 Obviously your plugin for viewing galleries adds the extra stuff in the URL's. Where as the link you gave above has just ../post_name/image_name/ Which isn't working with your plugin or linking of the image file.

Categories : Wordpress

Extra Input fields in AmazonS3 Direct Upload POST Form
I worked around the problem by sending the title attribute through the URL. In my RouteConfig file I added a new route: routes.MapRoute( name: "Transcode", url: "{controller}/{action}/{title}/{id}", defaults: new { controller = "Videos", action = "Transcode", id = UrlParameter.Optional } ); and then in the Transcode action I added a title parameter. Then finally the value I passed to the redirect URL attribute was: " http://dev.area.local/Videos/Transcode/title"

Categories : Asp Net Mvc

PHP pick up post input text fields and post images in two arrays?
First of all, give your submit button a name like <input name="submit" type="submit"> Then change if (isset($_POST) === true && isset($_FILES) === true) to if( isset( $_POST['submit'] ) ) { // ... } Also notice, you have 'att12' => $_POST['att12']); but you don't have a 12th input, instead, your last input is <input type="text" name="att11"> So, you should add another <input type="text" name="att12"> Finally, I don't know what you are trying to do but it doesn't look good to me.

Categories : PHP

how to show images from ftp folder with folder names and images names in asp.net c#
Here is what you want You can use Jquery tree view with Asp.net http://www.programmingsolution.net/useful-js/jquery-treeview.php For jquery try this http://jquery.bassistance.de/treeview/demo/

Categories : Asp Net

Ajax post request only gets through once browser is closed and opened again
Maybe it's caching it. Try cache: false in the ajax call like so. function setList(str){ var postDatas = decodeURI($('#form'+str+'').serialize()); alert(postDatas); // $('#crm-feedback').html('<img src="images/ajax-loader.gif"/>'); // var formname = "test"; $.ajax({ url: base_url+"admin/page/file.php", type: "POST", cache: false, data: postDatas, // data: "formname="+formname, success: function(data){ // $('#crm-feedback').html('Saved!').css('color','green'); alert("test"); } }); }

Categories : PHP

WWW server reports error after POST Request by Internet Direct components in Delphi
I'm very sure that I'm POSTing the right data Since it does not work - obviously you do not (or Delphi does not - that makes no difference for server). You should start usual debugging loop: Observe reference working behaviour. Observe your program behavior Spot the difference Eliminate the difference Check if the program works now If not - go to step 2. Reference implementation would be some WWW browser working with site: Opera, Chrome, Firefox, MS IE, etc. Observing tool would be some HTTP Sniffer like WireShark or OmniPacket or Microsoft Net Monitor or else, however this tinkers with OS work on rather deep level. Or it can be local proxy with GUI, like Proxomitron or Membrane Monitor - but that would require special setup for both the program and the browser, to route their

Categories : Delphi

Grab a session value in Javascript?
It would be exactly the same but with Session("LastName") instead of LastNameTextBox.ClientID), e.g.: printWindow.document.write('Last Name: <%= Session("LastName") %>'); ...although you may want to make sure the name is escaped correctly, since names can contain ' characters (amongst other things), which if unescaped would cause an error in the script when it went to the client browser, because the browser would see: printWindow.document.write('Last Name: O'Toole'); // Syntax error -------------------------^ If you're using .Net 3.5 or later, you can use JavaScriptSerializer to do the escaping for you.

Categories : Javascript

JavaScript replace() seems to only grab the first hit
That's the default behavior of .replace() with a string argument (for some reason). Provide a regex with a global flag and it'll work: str.replace(/{{value}}/g, ...); Also, since I was writing one anyways, here's a simple JavaScript clone of Python's str.format: String.prototype.format = function() { if (!arguments.length) { return this; } var mapping; if (typeof arguments[0] === 'object') { mapping = arguments[0]; } else { mapping = arguments; } return this.replace(/{(.*?)}/g, function(match, name) { return mapping[name]; }); }; You can use it like so: str.format({value: '<a href=...'}); Or like: '{0}{1}{0}'.format(1, 2); // "121"

Categories : Javascript

Post has_one gallery or Post has_many images?
This will greatly depends of what you want to do with galleries. If this is only a presentation thing (images grouped within some html code to be displayed united), you don't need a Gallery model. Now, if Gallery has actual meaning in your business logic - like if you want to add special attributes on it, like license or category - you could have a dedicated model. The question you should ask yourself is : will galleries be used somewhat unrelated to posts ? For example, a user may want to reuse one gallery from a post in an other one. Or, you may want to allow visitors to browse galleries, without having to pass through every single post. That's up to you. But since you're writing a tool more than a final product, I would recommend to be the more open possible : it makes sense to hav

Categories : Ruby On Rails

Change root folder on HTML links
You can try with a internal redirect like this: RewriteCond %{REQUEST_FILENAME} .php$ RewriteRule ^(.*)$ /folder/$1 [L,QSA] The condition is to redirect only PHP files to the folder, if that gives you a loop you can go with a more specific one: RewriteRule ^(.*).php$ /folder/$1.php [L,QSA] With RewriteBase something like this: RewriteBase /folder/ RewriteRule ^(.*).php$ $1.php [L,QSA]

Categories : HTML

File Links to Old Folder in Project Navigator
It sounds like your plist files were added not relative to the group folder. Perhaps this was set for absolute path?

Categories : IOS

How to find all symbolic links pointing to a particular folder?
find tells you that you have no access to / directory. To search in a directory you have access to: find -L /home/thejobco -samefile /home/thejobco/public_html/JCCore/quick_job/

Categories : Linux

Grab a Html section name using Javascript
Change var answrOne = w.name; to var answrOne = w.getAttribute('name'); jsFiddle example

Categories : Javascript

Add links to flexslider images
You can wrap an image in a link. Like this: <div class="flexslider"> <ul class="slides"> <li> <a href='linkto'><img src="slide1.jpg" /></a> </li> </div> In the main page there is an example (second image). EDIT: //Let's say you have this array: <?php $slides = array( array('image' => 'slide1.jpg','link' => 'link1'), array('image' => 'slide2.jpg','link' => 'link2') ); ?> <ul class="slides"> <?php foreach ($slides as $slide) : if (empty($slide['image'])) { continue; } ?> <li> <a href="<?php echo $slide['link']?>"> //Now we have a 'link' key to match every slide. <img s

Categories : PHP

Images which have text and links beside them
LIke this [DEMO]1 css .pull-left{ float:left; }

Categories : HTML

Get images from wordpress post (post content)
Put this in your functions.php function getTheFirstImage() { $files = get_children('post_parent='.get_the_ID().'&post_type=attachment&post_mime_type=image'); if($files) : $keys = array_reverse(array_keys($files)); $j=0; $num = $keys[$j]; $image=wp_get_attachment_image($num, 'large', false); $imagepieces = explode('"', $image); $imagepath = $imagepieces[1]; $thumb=wp_get_attachment_thumb_url($num); echo "<img src='$thumb' class='thumbnail' />"; endif; } Then use in your template getTheFirstImage() function where you want to print the image $args = array( 'posts_per_page' => 10, 'category' => 6 ); $myposts = get_posts( $args ); foreach( $myposts as $post ) : setup_postdata($post); getTheFirstImage

Categories : PHP

Most efficient way to grab XML tag from file with JavaScript and Regex
There are two problems affecting you here getting the regex to work in your JavaScript code. First, you are escaping the whole regex expression string, which means that your capturing (.*?) and your whitespace ignoring [s]* will also be escaped and won't be evaluated the way you're expecting. You need to escape the XML parts and add in the regex parts without escaping them. Second, the whitespace ignoring part, [s]* is falling prey to JavaScript's normal string escaping rules. the "s" is turning into "s" in the output. You need to escape that backslash with "s" so that it stays as "s" in the string that you pass to construct the regular expression. I've built a working script that I've verified in the UI Automation engine itself. It should extract and print out the expected URL: var t

Categories : Javascript

styling of links applies to images?
I'd add a style to remove the background color from linked images - that way you won't run into issues with transparent PNGs etc: .imglink:hover { background-color:transparent; }

Categories : HTML



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