Get Auth'd Username From IIS4 Challenge?
I'd like to setup some intranet pages that are personalized by user. However, I'd like to keep my users with one name/password that's dynamically updated in all "places" when they change their userame and password. Thus, I think I want to use IIS4's built in NT Domain auhentication.
Now, I know how to suck the current authenticated user in VBScript ASP code... is there any way to get this same info in PHP? Would a session variable be the way to go, putting the auth routines in ASP and then transfering the info to PHP with session vars? or something else "Secure"? I'm not a pro on session variables.
View Complete Forum Thread with Replies
Related Forum Messages:
NT Installation (with IIS4)
After installing PHP on an NT we are having a few problems. First we can't seem to pull up files with the extension .html but the same files will work using the extension .phtml Is this normal for NT use? No big deal if so. Second, and most important, (in a PHP program that does work on another server) I am getting the following error from pages that use ' if ($submit) '. ************************** Warning: Undefined variable: submit in includes/product.inc on line 20 ************************** The program does work correctly, it just gives this warning. What have we missed? Oh yea, we are also getting warnings referring to variables used in an email() at the end of the entire site. But the variables are coming through with the email.
View Replies !
Encryption In WinNT/IIS4
I'm using Windows NT with IIS 4 (it's not my fault ), and I'm wondering what encryption possibilities there are. Crypt/mcrypt/encrypt/decrypt don't seem to work. I'm using PHP4...
View Replies !
Parsing Challenge...
I thought I ask the scripting guru about the following. I have a file containing records of data with the following format(first column is the label): CODE#1^DESCRIPTION^CODE#2^NOTES NN-110^an info of NN-001^BRY234^some notes NN-111^1st line data 2nd line data 3rd line data^BRT345^another notes NN-112^description of NN-112^BBC23^multiline notes blah blah blah NN-113^info info^MNO12^some notes here How do I parse so I can insert them in the database, e.g. MySQL/Access?
View Replies !
Search Engine Challenge
I'm running a site with +20.000 articles. The articles (html files) are saved on the server as txt files. Alle other data (author, date, category and so on) are in a MySQL db. Before we had the articles put in the db also and then performed SQL queries for the search engine. But this is no longer feasable since there are too many articles and the db has gotten too big. The search engine does all of the db and the server cpu goes max. I'm looking for a php type search engine that automatically indexes the txt files, produces 1 index file with all indexed words + the id's of articles having those words. Like that the search script doesn't have to query all the articles (the whole db) anymore but just this one index file. Would be nice also if there would be possibility to have a blacklist of words (the, a,...) and other admin things.
View Replies !
Snapshot Web Camera Challenge
I have been paying for the image to be broadcast and other little features such as "Save Image" & "Email Image". After looking into my services I realised that it would be possible for me to host my own images and therefore saving some money. I found that displaying the broadcast was not a problem but "Save Image" has been a nightmare. Is it possible to grap an image from another site (my cameras ip) and prompt the user to save the image?
View Replies !
Email Script Challenge?
Everyone is taking a lot about email and email and email, let see if someone can help us in improving this code, which is basically a very basic and great email script for sending emails with attachments and its working flawleslly, the improvements it requires are as follows: Code:
View Replies !
Problem With Challenge - Response Login Script
The script seems to have a mind of its own as to what value of the variable $OTP (One Time Pad) it inserts in the database. Sometimes it inserts the same value as the value of document.nfc_login_form.hidden.value and sometimes it doesn't. As far as i can see it does this on a completely random case (although obviously that must not be the case). Code:
View Replies !
Create My Own Auction Site Bored Need A Challenge
I am going to create my own auction site as a challenge. Its something I have wanted to do after learning how to create a small shopping cart. I intend to keep the database as small as possible, so I was thinking that storing the auction description in text files could be the way to go. Everything else would need to go in the database ie start time, end time, bids etc.... Do you think this is a good idea to store just Auction descriptions in text files. Is it not better to keep as much info out of the database as possible? When an auction id is called from the database it displays the info from the database but also opens the corresponding text file on the server the contains the description.
View Replies !
Header('Refresh: 0.2; Url=?v=suspended&username=$username');
I'm having trouble using header(); the way I want to... Basically, I want a page called "?v=main", to redirect to "?v=suspended", but also to carry the username... header('Refresh: 0.2; url=?v=suspended&username=$username'); All it shows up in the url is $username, instead of, for example, MrXander... is there a way round this?
View Replies !
Replace The $_POST['Username'] With $_SESSION['Username']
I have the following code: session_start(); include "config.php"; $username = $_POST['Username']; $password = $_POST['password']; $password = md5($password); Which works fine and evreything posts but when I try and replace the $_POST['Username'] with $_SESSION['Username'] it won't reconginze the session. Does anyone know what the problem is. Also if I have session_start() and then like $_SESSION['Username'] on a different page that doesn't work at all either.
View Replies !
Challenge: LOAD DATA LOCAL INFILE Command Used From
they have a limit on 36000 inserts to my mysql database. User 'user' has exceeded the 'max_updates' resource (current value: 36000) This happen when importing a cvs file with 61000 lines. Then I realized that using phpmyadmin works just fine, using the feature: Insert data from a text file into the table Code:
View Replies !
Simple Challenge - Working With Image Coordinates And Dynamic Linking.
(*** apologies for the X-Post, but I felt it was relevant to all the groups ***) I have a page with a large centre-aligned image on it. I want a functionality whereby users can click their mouse on any point in this image and it would then show a virtual mouse pointer at the place where they clicked it. If they were to click somewhere else, the position of the virtual cursor would change. The position of the cursor needs to dynamically generate a link and display it in a form field text edit box. If that link is then viewed separately, it would launch the same page with the virtual mouse pointer at the location where the original person placed it. Basically I want to be able to have one guy point to a location on the image for the benefit of another guy, but graphically as opposed to relying on written explanation. I can run CGI and PHP scripts if need be. Easy-peasy, or can of worms?
View Replies !
Classes - Username As <b>username</b>
So heres my class: class secure{ var $data2; function check() { $data2 =mysql_real_escape_string($data2); $data2 = htmlentities($data2); $data2 = strip_tags($data2); } } Basically what i want to do, is everytime i have a variable in my page that say is inputted from the user, say $message = ($_POST['mesage']);, then i want this to take the data and check it for all of the above. $username = ($_POST['username']); $check = new secure; $check->data2 = $username; $check->check(); echo"$username<br>"; But the problem is this doesn't seem to be working. I typed in my username as <b>username</b> and it still comes up bold when it clearly should remove the bold statements.
View Replies !
A Real Challenge For Real PHP Programmers
<?php /* A challenge to every PHP programmer.The one who's gonna solve this problem would be deemed as PSP(PHP Supreme Programmer).The problem is this : You have to write a script that displays a list of categories and subcategorieslike this one: <select name="category"> <option value="1">Main</option> <option value="2">Main > Computers</option> <option value="4">Main > Computers > Hardware </option> <option value="8">Main > Computers > Hardware > PC</option> <option value="7">Main > Computers > Hardware > Mac</option> <option value="9">Main > Computers > Hardware > Atari</option> <option value="11">Main > Computers > Hardware > PC > History of Pc</option> <option value="">etc...</option> </select> The categories and subcategories details are stored in these two tables in a MySQL database. -categories : the categories names and ids. -cat_relations : the relations between categories.It shows which subcategory belongs to which category. The belongings between categories can go very deep and the number of categories is unlimited. This script will create the two tables and fill them with sample data. All you need to do is to change the four variables below. You can send the script back to this email : yasbergy@yahoo.com. */ //Here starts the script. Please change the values of these variables to fit your settings $user = "prospective_PSP"; $database = "db"; $server = "localhost" ; $pwd = "" ; //Connection to the database that you created mysql_connect($server,$user,$pwd) ; mysql_select_db($database); //Creation of the two tables : categories and cat_relations $categories = " CREATE TABLE `categories` (`id` INT not null AUTO_INCREMENT, `name` VARCHAR(100) not null , PRIMARY KEY (`id`), INDEX (`id`), UNIQUE (`id`)) comment = 'The categories details' "; mysql_query($categories) ; $cat_relations = "CREATE TABLE `cat_relations` (`id` INT not null AUTO_INCREMENT, `daughter_id` INT not null, `mother_id` INT not null , PRIMARY KEY (`id`), INDEX (`id`), UNIQUE (`id`)) comment = 'Which category is the daughter of which category'"; mysql_query($cat_relations) ; //Filling the two tables with sample data $cats = array('Main','Computers','Countries','Hardware','S oftware','Programming languages','Mac','PC','Atari','Winamp','History of the PC','IBM','Components','High level','USA','NYC','LA','Manhattan','India','Winzi p'); for ($i=0;$i<count($cats);$i++){ $sql = mysql_query("insert into categories (name) values('".$cats[$i]."')"); } mysql_query("insert into cat_relations (daughter_id,mother_id) values (2,1),(3,1),(4,2),(5,2),(6,2),(7,4),(8,4),(9,4),(1 1,8),(12,8),(13,8),(10,5),(20,5),(14,6),(15,3),(16 ,15),(17,15),(18,16),(19,3)"); //Now you can have a look on them through phpMyAdmin ?>
View Replies !
Get Username From IIS
I am trying to get the username a person enters when using basic authentication with IIS. Can php do that? That is a person enters a url. He is prompted by IIS for a username & password. IIS allows the user in. I am assuming the server now has the username somewhere.
View Replies !
Using The Username
I am using the sessions for different users, based on their username,,, can i use this statement $username = session_name('username');
View Replies !
Getting Username
My directory uses .htaccess authorization by requiring a username and password. I want to keep a simple log of all transactions to a DB which will provide the who-what-when-where for all edit/add/delete operations. To this end, I want to obtain the username provided in the ..htaccess login. I've tried $PHP_AUTH_USER and $PHP_REMOTE_USER but both variables are blank.
View Replies !
Username
Im not that good at PHP, have a look at this and i think ul find it funny but i aint got a clue. i make it list all the usernames. <?php $sql = "SELECT * FROM ALS_signup"; $result = mysql_query($sql, $conn) or die(mysql_error()); while ($newArray = mysql_fetch_array($result)) { $username = $newArray['username']; echo"<select name='test'> <option>$username</option> </select>
View Replies !
Only One Session Per Username, But How?
I am developing a small database which users will have to log in with a username and password, which is checked against a MySql database. I am using sessions which will end when they either hit the log out button or close their browser. Everything works fine so far, but I can't figure out a good way of making sure if a username is currently logged in (has a session open) that no one else can log in using that username. Would adding a column to the database and querying the database to see if they are logged in be the best, or is there an easier way with sessions that I just don't know about. The issue with using a database by switching a simple yes/no column, would be if they close their browser or computer freezes, they try to log in but can't because the database was never reset.
View Replies !
Displaying Username
I am newbie to php. I did a login Script using dreamweaver tools.Everything works fine but i have problem showing username like welcome username! on top of page when user logged in.I need like this when unauthorised user enters in to my website it should display login box.When user registered and logged in it should display message like WELCOME user! in the same place.
View Replies !
Username Generator
I’m going to be creating a username generator that gives you a few usernames you could use, based on the one you asked to have but was taken. For example, when you signup for a hotmail account and the e-mail address you specified is already taken, it gives you a few choices to pick from based on DOB, age, etc., or create your own custom one again. The thing I’m going to be making is very similar. Instead stead of generating some names based on your DOB, age, etc. it will just give some names with numbers added on, or whatever the guy I’m making it for wants it to operate. Like I enter in Epsilon and it is taken, it then gives me something like Epsilon2002 (Based on the current year), Epsilon_, Epsilon- and so on.
View Replies !
Checking For Username...
How do I check in a mySQL table called 'Users' on column user_name when registering a new user_name to make sure the new 'user_name' does not already exist in that column?
View Replies !
Username And Password
I've got this 'helpdesk' application where people can simply fill out a form and send it off. Each time they have to type in their name, phone number and email address- then answer the questions that they're having problems with. I'd rather store that common non-variable info in a database and pull it out so that they don't have to type it in each time. Is this possible without issuing each individual their own username/password? Or would it be best to have each person log in one time and create their own accounts? Before I just had 3 or 4 general usernames/passwords that the organization members used. I'm trying to keep confusion down to a minimum here. Would it be feasible to have them log in with their last name and pull the information based on that- or there must be another way.
View Replies !
Username For A Session
What is the best way to keep track of a username during a session? Let me elaborate a bit... I want to set up a username/password with htaccess and then allow the verified users access to a number of webpages which allow them to add/delete/modify different items. But I want to keep track of who the current verified user is. What is the best way? A cookie? An environment variable?
View Replies !
Adding Username To Url
I am developing a multilevel marketing system. This system will provide users their own website(virtual). No real disk space. just play by database and account status (paid or not paid). I would like to have the url of a registered user like this www.mysite.com/username/ I can create up to this point. when i tried to access this url. its the requested url is not found..
View Replies !
Validate Username
Can anyone tell me how use regular expression to validate a username with alpha numeric and special character but not space?
View Replies !
PHP-AT: Where To Put Username And PW For SetReturnURL
I am trying to make a setReturnURL call with PHP-AT using Ebay_Authentication->add (hope this is the right way). But I don't know where to put the needed username and password for this call. I did it in the ebay.config.php and even set it via setRequestPassword / setRequestUser but I always get an error like "wrong password or wrong username".
View Replies !
Windows Username
i am using apache,mysql and php on windows XP and soon wil move to windows server 2003, need something that will work on both. i need some kind of script that will get me the current clients windows username. i dont really care what language it will be written. all i need is that it will be possible to embbed it into php page without any extra modules if possible, if not then with some kind of module that is free. (how to embbed it as well will be more than welcome)
View Replies !
Validating Username
I am trying to validate a username input on my form using regular expression. The username can only have letters, numbers, underscores a single period. I dont want them to be able to use spaces and caps (possibly converting all chars to lowercase?)
View Replies !
Run A Query On A Username With A ' ' In It
I'm trying to run a query on a username with a ' ' in it (Jamie Ann), heres my code PHP Code: SELECT userid, filename, username     FROM photoplog_fileuploads     WHERE moderate = 0     AND username = '.$Name. '     ORDER BY RAND()     LIMIT 5 This query only returns something if the username is 1 word (how do I get it to use a possible 2 word username?)
View Replies !
Regexp On Username
username in my system can contain only letters, digits and these characters. if they are not in the beggining and not in the end of username. For example: kak89-k OK -kak89 WRONG kak89_ WRONG Could somebody post regexp for this validation?
View Replies !
How To? Domain.com/username
I'm completing a dating website. I have nearly completed the End-users side. The question i have is when someone wishes to view another users profile, they would have to enter http://www.domain.com/username Code:
View Replies !
Validate If Username Is Already Taken
I'm having a problem with a form validation. Basically what i'm trying to do is have PHP connect to a mysql database and check to see if a username is already taken. If the username is taken in the database it sends the php variable through javascript and pops-up an alert that says its already taken. Here is the code i came up with. I could be way off, but my idea was the put the javascript in a while loop so that it will run through even item in the user_name field in the database till it reaches the last inputted name......
View Replies !
Set FTP Username And Password
My current scenario for this process is a follows: I create a new user and set up the directories with a script. One of the directories is for uploading files and I create an FTP username and password manually in my isp’s control panel. This locks down the directory when the user logins with an FTP client. I have been told that I should be able to set the FTP username and password from the script but despite lots of searching cannot find the answer.
View Replies !
Username Or Email Already Used
I have my code: mysql_connect($db_host, $db_username, "newpwd"); mysql_select_db("powersoft"); $username = $_POST['username']; $username = mysql_real_escape_string($username); if ($username == '') exit ('You must enter a username'); $password = $_POST['password']; if ($password == '') exit ('You must enter a password'); if ($password == 'Password') exit ('You must enter a password'); $encpassword = md5($password); $email = $_POST['email']; if (email == '') exit ('You must enter an email address'); if (email == 'E-mail') exit ('You must enter an email adress'); $email = mysql_real_escape_string($email); $ip = $_SERVER['REMOTE_ADDR']; $sql = 'INSERT INTO `admin_login` (`id`, `username`, `password`, `email`, `ip`, `user`) VALUES (NULL, ''.$username.'', ''.$encpassword.'', ''.$email.'', ''.$ip.'', Ƈ');' mysql_query($sql) or die (mysql_error()); i want to run a check before I insert into the database whether there are any other rows with either that username, that email, or both and return an error and stop if there is. What query would I run for that and where would I put it?
View Replies !
Username Clean Up
I'm trying to make a register script and have succeeded on most tasks but have a couple to go. I've been searching google but can't find exactly which string function it is but it could work like this: Search $username for characters other than $good_chars. If can't find bad characters then return true. $good_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-"; $result = somefunction($username,$good_chars); if($result == "false") { die("Username Not Valid."); } I'm not sure but it may be a combination of functions to get to this. I'm hoping a more experienced user may know an answer.
View Replies !
Check If Username Is Already Taken
whensome registers with my site if their chosen username is the same as another in the database an error is displayed. $query = "INSERT INTO members (username, password, first, last, email, add1, add2, add3, add4, zip, country, phone)values('$myusername', '$mypassword', '$first', '$last', '$email', '$add1', '$add2', '$add3', '$add4', '$zip', '$country', '$phone')"; mysql_query( $query, $link) or die("The Username/E-Mail Address Entered Is Taken<br>Please go back and choose another" ); how could i make a redirect or a popup to say username is taken?
View Replies !
Check If Username Is Taken.
I need to know how to check my database and see if the username someone is registering with is already taken. Here is my register code thus far: <?php $self = $_SERVER['PHP_SELF']; $firstname = $_POST ['firstname']; $username = $_POST ['username']; $password = $_POST ['password']; $email = $_POST ['email']; if( ( !$firstname ) or ( !$username ) or ( !$password ) or ( !$email ) ) { $form ="Please enter all of the details..."; $form.="<form action="$self""; $form.="method="post">First Name: "; $form.="<input type="text" name="firstname""; $form.=" value="$firstname"><br />Username: "; .........................
View Replies !
Read The Username
Can a php file running on an intranet server read the username people logged onto the network with? In Visual Basic I use the api apiGetUserName Private Declare Function apiGetUserName Lib "advapi32.dll" _ Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
View Replies !
Username Validation
// start code snipet $user= "username"; $pass= "password"; if (( $PHP_AUTH_USER != $user) || ( $PHP_AUTH_PW != $pass)) { header("WWW-Authenticate: Basic realm="PhpWiki""); header("HTTP/1.0 401 Unauthorized"); echo "You entered an invalid login or password.<BR>"; echo "You entered $PHP_AUTH_USER for a username.<BR>"; echo "You entered $PHP_AUTH_PW for a password.<BR>"; exit; } echo "You entered $PHP_AUTH_USER for a username.<BR>"; echo "You entered $PHP_AUTH_PW for a password.<BR>"; // end code snipet This code invariably fails, and the echo statements return blank values for $PHP_AUTH_USER and $PHP_AUTH_PW. Aren't those two set automatically when the dialogue box pops up, or do I need to add extra code somewhere for this to work?
View Replies !
Display The Username
I have it working with a basic message. I am trying to be more personable. $_SESSION['userExists'] = "<font color='red'> .$_POST['username']. is already in use. Please choose another username.</font>"; Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:wampwwwinsert.php on line 24
View Replies !
Computers Username
is there a way in which php can grab a computers username, so i want php to grab john and use that to open up a mysql database with information on the user john. Basically so users do not need to log in themselves twice. ie windows then the website.
View Replies !
Image And Username
which is the best way to retrieve the image and username and link the username into the picture? $getimages = mysql_query("SELECT `username`, `thumblocation` FROM `images` WHERE `timeposted` ORDER BY `timeposted` ASC LIMIT 3"); while ($image=mysql_fetch_array ($getimages) ) { echo "<a href='/__site/$username'><img src="$image[thumblocation]"></a>";echo $spacer; }
View Replies !
|