w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
While Sending Html Mails from my web application Recieved Mails contains Symbols like &ldquo,&rdquo, ‘
Check with another constructor for htmlView: ContentType mimeType = new System.Net.Mime.ContentType("text/html"); var htmlView = AlternateView.CreateAlternateViewFromString(bodyMessage, mimeType);

Categories : Asp Net Mvc

return (mysql_result(mysql_query("SELECT COUNT('ID') FROM 'users' WHERE 'username' = '$username'") , 0) == 1) ? true : false;
In MySQL, identifier quote character is the backtick " ` " (not single quote) as stated here: http://dev.mysql.com/doc/refman/5.0/en/identifiers.html. Please update your query to use back ticks on table name and column names as follows: "SELECT COUNT(`ID`) FROM `users` WHERE `username` = '$username'" Because the query did not succeed, your mysql_query returned false which is the reason for that error. Please have a look at the documentation for mysql_query here http://php.net/manual/en/function.mysql-query.php and check the "Return Values" section thoroughly. Also as you mention tutorial then I believe you are beginning to learn PHP with DB development, in which case its better to start learning either mysqli http://php.net/manual/en/book.mysqli.php or PDO http://php.net/manual/en

Categories : PHP

populate a drop down menu with database users names, when a username is selected refresh showing users details
Use a form <form action="/yourpage" method="post"> <select> <option value="<?=$id; ?>"><?=$name; $></option> </select> <input type='submit'/> </form> In yourpage.php <?php if(isset($_POST)){ // load user data // or redirect with header() to preexisting page } // load view with user data ?>

Categories : PHP

Delete that particular username from .txt file when browser of that user is closed
There's no sure-fire way to tell if the user has closed his or her web browser. Trying to catch such an action w/ JavaScript will undoubtedly lead to bugs. The only thing you can do is delete said usernames after a pre-defined period of inactivity. If the user hasn't carried out any actions within the pre-defined timeframe, assume that they are inactive.

Categories : PHP

Login system using physical postgres users not "logical" users
To achieve your goal all inserts, updates and deletes, need to leave a trail that is difficult, if not impossible for a standard user to change. you can create: 1) Two schemas: one for common tables, one for security stuff like login/pass(hash) table, user session log, change log table, etc. 2) Two users: one common user, that can only use dml on common schema (no ddl), one superuser. 3) Login function that will check provided user/pass against login/pass table and log successful/failed attempts into user session log (you need SECURITY DEFINER function) 4) Set of audit triggers on common schema tables that will check the user privileges and log any changes, made by the user (SECURITY DEFINER functions here too).

Categories : Security

How to get local users username from Web2Py?
I just ended up moving the web2py app over to an Apache server. If somebody doesn't know how to do this then you can find all of the documentation here: http://web2py.com/book/default/chapter/13 After that I installed the mod_auth_sspi module in order to get instructions. The x86 version of the module can be downloaded from here: http://goo.gl/syzjuk It will require an x86 installation of Apache though. After it is downloaded: Unzip the file Drag mod_auth_sspi.so from the bin folder into wherever you modules folder for your Apache installation is. Add LoadModule sspi_auth_module modules/mod_auth_sspi.so to your httpd.conf file as well as any sspi settings you need to whichever location you need to apply security to. I did have some issues with authentication on some browsers, but

Categories : Python

How safe is validating users in SQL from $_COOKIE["username"]?
You can manipulate cookies on your own machine. A better approach would be to assign the logged in user a random token that you can cross reference with the database to pull the user's level. You should always sanitize input before using it in a query. So create a table for logins and generate a random string to use as an access token. Look into the php crypt function to help generate the string and store that token and that token alone in the cookie. You can store just the user id and the token in the login table, then join with the user table to fetch level from there. You can choose to cycle the tokens per page use or something to increase the improbability of someone else guessing a token and hijacking an admin session. To increase the security on it, you can store a timestamp and

Categories : PHP

Get a Wordpress Users E-Mail by Username via Ajax
Get Wordpress user email : http://codex.wordpress.org/Function_Reference/get_userdata So... use Ajax to get that email http://api.jquery.com/jQuery.ajax/ Use include('../../../../../wp-config.php'); (Change your correct path) use this whatever file you want to access your Wordpress db/funcs AND : http://stackoverflow.com/help/asking

Categories : PHP

Wordpress Users Request to Retrieve Username by email address
get_userdata() Returns a WP_User object with the information pertaining to the user whose ID is passed to it. - http://codex.wordpress.org/Function_Reference/get_userdata $user_info = get_userdata(1); echo 'Username: ' . $user_info->user_login . " "; echo 'User level: ' . $user_info->user_level . " "; echo 'User ID: ' . $user_info->ID . " "; So you could create a form that utilizes the above code to grab what you need. If you can give more info such as if the user wil be currently logged in or not, only the logged in user's username, or anyone can get any username with an email address are all questions I'd have. Gluck.

Categories : Wordpress

Get desktop folder path by username
hmmm... Have You tried os.getenv("CSIDL_DESKTOPDIRECTORY")? It should work according technet@microsoft[1] Way more dirtier way would be trying to read windows registry (HKCU > Software > Microsoft > Windows > CurrentVersion > Explorer > User Shell Folders > Desktop) with some kind of Lua Windows Registry API [2]. [1] http://technet.microsoft.com/en-us/library/cc749104(v=ws.10).aspx [2] http://lua-users.org/wiki/WindowsRegistry

Categories : Windows

How to specify the username that SSH should send to the remote system using the git GUI
You can do it while you're adding a new remote. (ctrl+a is the short command for that, the menus should be something like remotes->add remote). So if you want to do it in git-gui I guess you've to remove the remote and then add a new one. However, that command is a one-time thing to execute in git-bash. I hardly see the problem with that. An other way is to manually edit .git/config which includes all the configuration for your remotes.

Categories : GIT

iOS: how to create multiple test users in sandbox environment having only 1 device available?
The simulator can connect to the Game Center. (The thing it can't do is make in-app purchases.) If you're testing your app in the sandbox you have to log into the Game Center within your app, not in the Game Center app. If you are already logged into Game Center with a normal login run the Game Center app on the simulator and log out. Then run your app and log in within your app.

Categories : IOS

does poll system call know if remote socket closed or disconnected?
If the sockets breaks, poll() will return > 0, then you will have to check the return value of recv in order to know if the socket is disconnected (recv() will return 0 in this case). Also, what would poll return on 0 timeout. int rc = poll(fds, nfds, 0); poll() will return immediately, and the return value can be >= 0. You really should read the poll() manpage, there is all you need to know.

Categories : C

Running app on ipad asks for System username and password again and again
Maybe some keys for your provision profiles placed in System keychain? In this case you should move them to another keychain. In application Applications/Utilities/Keychain Access , move them to the "login" keychain.

Categories : IOS

Qt profile and system environment variable
From the documentation: To obtain the contents of an environment value when qmakeis run, use the $$(...) operator So it should be $$(VLC_QT_PATH)

Categories : Qt

where do I find page source of pages on my system which I opened in Chrome and then Closed
it should be at ~/Library/Caches/Google/Chrome. good luck digging there :S this issue of loosing files was fixed years ago, learn how to use git http://try.github.io/

Categories : Osx

Environment.SpecialFolder.ApplicationData returns the wrong folder
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); do you create a text file to write that you want?? and also you need to assign a variable, for example: String path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); if(File.Exists(path + "filetowrite.log")) { ...................... } also before to check the file, check if directory existe to be more sure. greetings i hope help you.

Categories : C#

How to get Windows OS Environment Variable from System Property
Changing environment path through Computer->Property->Advanced System Settings->Advanced->System Environment Variables->User Variables will take effect immediately. However, please be noted that those programs which are running will not get the latest environment variable. So I thought that you simply didn't reopen a new cmd for echo. Open a new cmd, and echo again, the new path will be shown.

Categories : Windows

Persistant effects of modifying process environment via system
That is how system works: it creates a subshell to execute your command, and when the command is complete, the subshell exits leaving your perl process unaffected. Section 8 of the Perl FAQ also answers this question. I {changed directory, modified my environment} in a perl script. How come the change disappeared when I exited the script? How do I get my changes to be visible? Unix In the strictest sense, it can't be done—the script executes as a different process from the shell it was started from. Changes to a process are not reflected in its parent—only in any children created after the change. There is shell magic that may allow you to fake it by eval()ing the script's output in your shell; check out the comp.unix.questions FAQ for details. You want code alon

Categories : Perl

java getenv Windows system environment variable
By the time your process receives the environment, it has all been merged into a single list of key/value pairs. The separation into System and User variables is a Windows-only subtlety that does not propagate down to programs... unless you write non-portable code to read the Windows registry directly.

Categories : Java

Cleanse a shell runtime environment to run system Perl?
The -i option of the env command allows you to start programs in a clean environment. From then env manpage: -i, --ignore-environment start with an empty environment For you perl example: env -i perl -V

Categories : Perl

Why NetBeans' environment variable does not confirm to the system's setting?
The env variable is set in any bash window you might open up, but it is not set any other way. It seems you will have to resort to desperate measures to get this environment variable set up, which entails setting the variable from the command line and then starting NetBeans from the command line. I can't think of any other way.

Categories : Java

C# Programmatic Remote Folder / File Authentication In Non-Domain Windows Environment
Impersonation works with Peer/LAN network as well. I got your typical home network with some machines on default "Workgroup" and some on a named one if I remembered doing it on the install. Here is the code I use from my IIS server app to access files on my other computer (without having to have the same user and password on both machines involved, copied from somewhere and modified for my use): using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using System.Security.Principal; using System.ComponentModel; /// <summary> /// Class to impersonate another user. Requires user, pass and domain/computername /// All code run after impersonationuser has been run will run as this user. /// Remember to Dispose() afterwards. /// </summ

Categories : C#

Does Environment.getExternalStorageDirectory() returns a usable data folder when no sd card is mounted?
public static File getExternalStorageDirectory () Added in API level 1 Gets the Android external storage directory. This directory may not currently be accessible if it has been mounted by the user on their computer, has been removed from the device, or some other problem has happened. You can determine its current state with getExternalStorageState(). Note: don't be confused by the word "external" here. This directory can better be thought as media/shared storage. It is a filesystem that can hold a relatively large amount of data and that is shared across all applications (does not enforce permissions). Traditionally this is an SD card, but it may also be implemented as built-in storage in a device that is distinct from the protected internal storage and can be mounted as a filesystem

Categories : Android

Track C++ memory usage and system resources (No windows environment)
SIGAR has been recommended before It seems to give mostly total memory/cpu usage during runtime but may be useful as it has bindings for many languages and works on many platforms. As for more detailed per-process information, you can get resident, shared, virtual memory totals as well as i/o and page faults.

Categories : C++

.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

How can I allow users to run a website without adding its bin folder to SVN?
You don't necessarily need Visual Studio to build the solution. For example I use Ruby with rake tools to build .Net solution files using the Albacore gem. read.. http://rake.rubyforge.org/ and https://github.com/Albacore/albacore This gem is extremely powerful, you can use it to build, run tests and even deploy your website, all without even opening Visual Studio. It enables you to use any text editor to modify the files.

Categories : Dotnet

How do you get the Default Users folder (e.g. c:usersDefault)
For example: Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData); See also MSDN Environment.GetFolderPath MSDN SpecialFolder Enumeration

Categories : C#

Get the users temp folder path c++
std::wstring strTempPath; wchar_t wchPath[MAX_PATH]; if (GetTempPathW(MAX_PATH, wchPath)) strTempPath = wchPath; Change wstring to string, wchar_t to char and GetTempPathW to GetTempPathA if you're not using Unicode.

Categories : C++

Is there any way for pushing fonts into users system
You can use Webfonts. Google themselves have a wonderful collection of Webfonts... Check out this wonderful example of using a Google Webfont <html> <head> <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine"> <style> body { font-family: 'Tangerine', serif; font-size: 48px; } </style> </head> <body> <div>Making the Web Beautiful!</div> </body> </html> Check out this fiddle which shows the working of 2 Google WebFonts. Tangerine & Roboto Working Fiddle

Categories : HTML

System users password has expired
Open up cmd.exe and type in SQLPLUS Enter user-name: SYSTEM Enter password: the expired password It will now let you type in a new password for the SYSTEM user

Categories : Oracle

Set network shared folder only allowing admin users
You control who can access a share by setting the DACL (Discretionary Access Control List) on the share. You can do that by calling GetNamedSecurityInfo to retrieve the current permissions on the object, then modify the DACL, then call SetNamedSecurityInfo to associate the modified DACL with the share. Alternatively, you could call NetShareGetInfo with information level 503 to retrieve the current security descriptor, then modify the DACL, and then call NetShareSetInfo with information level 1501 to associate the modified security descriptor with the share. Lacking a really good reason to do otherwise, however, I'd use Get/SetNamedSecurityInfo. Manipulating DACLs is painful enough -- you don't need to add any extra difficulty.

Categories : C++

I want to make a folder where users can drop files but not delete them
Yes, you can do this. Right-click the folder, click properties, then Security tab. Click Advanced, Change Permissions, select the user/group you want to change, then Edit. Be careful of setting deny permissions - you're better off just not allowing Delete. You can Google that for more information.

Categories : Windows

Make folder only accessible for logged-in users on IIS7
In web applications I have worked on, we stream the PDF files to the browser. This way no one has direct access to the file's URL and since it is an ASPX page, we can apply whatever securtiy we want (ie. user must be logged in). Here is sample code similar to what I used: Dim strFilePath As String = "C:wwwpdfabc.pdf" Using fs As New System.IO.FileStream(strFilePath, System.IO.FileMode.Open) Dim docStream(fs.Length) As Byte fs.Read(docStream, 0, CInt(fs.Length)) Response.ClearContent() Response.ContentType = "application/pdf" Response.AddHeader("Content-Disposition", "inline; filename=" + System.IO.Path.GetFileName(strFilePath)) Response.AddHeader("Content-Length", fs.Length) Response.BinaryWrite(docStream) Response.

Categories : Vb.Net

Nodejs CSV data export system for users
read line by line from your mysql-db, and append line by line to your file i dont know that much about the mysqlmodule, so i'm assuming here each line is just an array, therefore the 'row.join(';')'. if thats not the case (maybe its an object), you should fix that. var fs = require('fs'); var connection = require('mysql').createConnection({yourdbsettingshere}); function processRow (row) { fs.appendFile('your-file.csv', row.join(';'), function (err) { connection.resume(); }); } var query = connection.query('SELECT * FROM WHATEVER'); query .on('error', function(err) { // do something when an error happens }) .on('fields', function(fields) { processRow(fields); }) .on('result', function(row) { // Pausing the connnection is useful if your processing involves I/O

Categories : Node Js

Can I automatically navigate users to System Preferences ➞ Privacy?
I see from your answer to the other topic that you've already discovered AXProcessIsTrustedWithOptions, which will take the user straight to the privacy accessibility settings; you're presumably wanting to implement your own user prompt that is less baffling and suspicion-arousing than the official alert provided by that function. You can open the Security & Privacy preferences pane and navigate straight to the Accessibility section using Applescript: tell application "System Preferences" --get a reference to the Security & Privacy preferences pane set securityPane to pane id "com.apple.preference.security" --tell that pane to navigate to its "Accessibility" section under its Privacy tab --(the anchor name is arbitrary and does not imply a meaningful hierarchy.)

Categories : Osx

How to get all users application data folders under system account?
I think, this could help you : //List all the users List<String> usersList = new List<String>(); ManagementObjectSearcher sidQuery = new ManagementObjectSearcher("SELECT * FROM Win32_Account"); ManagementObjectCollection results = sidQuery.Get(); foreach (ManagementObject result in results) { usersList.Add(result["Name"]) } //Showing all the partitions letters String[] strDrives = Environment.GetLogicalDrives(); Foreach (string strDrive in strDrives) { //Check if profil has AppData folder List<String> usersAppData = new List<String>(); String pathAppData = String.Empty; foreach(String user in usersList) { pathAppData = String.Format("{0}Users{1}AppData", strDrive, user); if(Directory.Exists(pathAppData )) { usersAppData.Add

Categories : C#

Multi Project / Users / System Global Git Ignore Solution
I don't think there is a standard way to achieve that for a central repo. You might want to write a script that would fetch from a central location and commit any changes to all the repos that you have on the central server.

Categories : GIT

MySQL determine number of users in system hourly query
Before all you need to create a table for example called hours_table with number from 00 to 23: CREATE TABLE `hours_table` (`hour` char(2) DEFAULT NULL); hour ---- 00 01 02 03 04 .. After you execute this query: SELECT hour, (count(DISTINCT(li.user)) - count(DISTINCT(lo.user))) AS usersloggedin FROM hours_table LEFT JOIN audit_table AS li ON DATE_FORMAT(li.time, '%Y%m%d%H')<=CONCAT('20130702',hour) AND DATE_FORMAT(li.time, '%Y%m%d')='20130702' AND li.action='login' LEFT JOIN audit_table AS lo ON DATE_FORMAT(lo.time, '%Y%m%d%H')<CONCAT('20130702',hour) AND DATE_FORMAT(lo.time, '%Y%m%d')='20130702' AND lo.action='logout' GROUP BY hour In place of 20130702 you put an other day in format yyyymmdd remove DATE_FORMAT(time, '%Y%m%d')='20130702' if you consider user logged

Categories : Mysql

Referencing a Visual Studio solution in a different source control repository whose folder is different for different users
I have used each of the following as solutions to this problem (you could use either, but not both). Use a standard directory structure for your developers. For example: {basePath}/{user}/{repositoryName} This allows you to use relative paths to reference other repositories, as long as you know the {repositoryName} for the repository the project is contained in. Relative paths also allow you to use any {basePath}, so this quite a flexible system. However, there is always a concern that the version of your dependent projects may not be the expected version, potentially leading to strange outputs. For your issue reports, your developers will have to explicitly give the commit hash for both the main repository and the dependencies they are currently working with. Use subrepositories. Thi

Categories : C#



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