.htacces/.htpasswd Files
I am trying to develop a simple script that will access my .htacces/.htpasswd files. Basically, I want a login page that comes to another page where the user can change their password.
It is possible to use PHP with htaccess and htpasswd? If not, how could I create a secure folder/area with PHP?
Or, if I used htaccess and htpasswd, is there a way to implement sessions for added security?
I created a passwd file on apache2 win xp and then transferred the file to a
unix server since I dont have telnet access to do it directly. But I keep
getting a 401 error code when I try to log in. Do the win versions of
htpasswd use a different hashing algorithm than the unix version? Is that
possibly why my possword doesnt seem to be working?
1.I created a password file named passwords and also an htaccess file naming Accessfilename.ht access.
2.My Accessfilename.ht access is placed in the folder where my php scripts are saved.
3.Now, when i try to run my php script, it does’nt pop out for an user and a password.
I dont see any errors when i restart my apache. I followed step-by-step procedure, but still it does’nt work.sounds really weird!!
I have a pretty large password protected community using .htpasswd. Now that I am getting the hang of PHP I would like to create a new member area using PHP and cookies so members didn’t have to sign into every script. It would take forever to move all of that info into a database.
Is there a way to use PHP to let someone log in and check their user info against the .htpasswd file? I’ve looked all over the internet but the only scripts or tutorials I could find were on writing passwords to the file not logging people in using them.
Im looking for a way to update my htpasswd file. I want to take $FirstName and use it as a the login ID, and take $LastName (encrpyt it) then update the htpasswd file with both.
My user fills out a registration form. The form data FirstName, LastName is passed to the php file which will update the htpasswd file using the FirstName as the ID and the LastName as the password.
is there a way to write the username/password to the .htpasswd file using a form in php, while also inserting into a mysql db…(i’ve already got the db part down)
I have been trying for a few days now, with no success to automatically add members to a .htpasswd file using PHP, I have a signup page which asks for e-mail and a password, and then sends to a script to deal with the data. However, it seems i cannot get the information into the .htpasswd file, even after using the information previously posted in the forum.
As the info is to append to the htpasswd file. I currently have
$fp = fopen(“.htpasswd”,”w”);
$info = ($email’:'crypt($pw));
fwrite($fp,$info);
fclose($fp);
where $pw is the password and $email the username.
I a variable (LastName) that I need to convert to an htaccess crypted password to put into the htpasswd file. The code I am getting is similar to TG3UomYd9nEOgGary:V2/EvyXHE8h.Q sometimes even longer. Not to mention it doesnt work.
When I use some of the online htpasswd creators i found on google, I am getting crypted passwords such as cwIgR6n88Pt3E much shorter. This crypted password works fine when I put it into the htpasswd file. The one I am getting does not. As you can see, the FirstName is the LOGIN ID, the LastName is the Password
Heres what I have. Code:
I want zu install a security-path with .htaccess and .htpasswd on my privat
local machine (for test-reason)
I succeeded with a .htaccess and Error 404-adressing a special Error-page
with menu.
SSI and PHP are accessible..
My Apache is installed in path C:Apache2
My homepage is in D:Datenhtdocseffektivfamilienzentrum.com
and is named http://fzt.local/
I created a new directory as
D:Datenhtdocseffektivfamilienzentrum.comgehei m where I want to put the
..htpasswd and .htaccess
This path shall be the security-path.
I think, that I should not put password-file there, but for testreason it is
ok.
with a utility I named (and with htpasswd.exe the same) this path as
“geschuetzt”
Loginname (User) “geheim”
password “takatuka71382″
so I got 2 files
..htaccess
AuthUserFile D:/Daten/htdocs/effektiv/familienzentrum.com/geheim/.htpasswd
AuthName “geschuetzt”
AuthType Basic
require valid-user
..htpasswd
geheim:$1$TVX0ogEG$5mrLzYr/bceOinejlH8v.1
I put both files in path
D:/Daten/htdocs/effektiv/familienzentrum.com/geheim/
when adressing http://fzt.local/geheim/index.php – I correct get the window
for input of user and Password.
But when I give user=geheim, and password=takatuka71382, the security-window
does not accept those values.
I created a directory with mysql db configuration files outside of root directory and I want to protect it with .htaccess or .htpasswd (only admin can open it) but I don´t know how to do it. I am on shared server and have no access to httpd.conf file so I don´t know the path and I can´t use command line.
I already have some directories protected, easy, with control panel but only directories inside of root directory. The path of that directory is /home/username/domain-include and root directory is /home/username/domain-www .
If I log on to a ’secure’ page protected by .htaccess and .htpasswd variables how can I access them with PHP to display a custom hello message?
Why is it not working?
Do I need to install some extra software?
(I’ve just compiled php-4.0.2 together with mysql and apache)
I’m trying to password protect a directory in my own local Linux server.
I’m using the same .htpasswd and .htaccess files as I do on the server of my internet provider where every thing is working right.
I just change the path in the .htaccess file but – no way – I still can access the directory I want to password protect without any password prompt
Can somebody tell me what I’m doing wrong – any help will be greatly apreciated.
I’m trying to use php to update my htpasswd file.
I have my permissions on .htpasswd set to 777, so it should be wide
open. From the command line (when logged into the server as “nobody”,
my server’s web user) I can get the htpasswd.exe to run without a
problem, but when passed through my php exec() function the .htpasswd
file does not change. I’m not getting any errors, but I’m not getting
any action either.
Okay, I made a simple AJAX shoutbox and I want to include it on all my pages. To insert the shoutbox I simply type <? include(‘/shoutbox/shoutbox.php’);?> into my HTML page.
The problem is, that in /shoutbox/shoutbox.php I also include settings.php, functions.php, and some other files, and when I include /shoutbox/shoutbox.php into my index page, /shoutbox/shoutbox.php tries to call settings.php from the same folder that my index file is in, since I just ‘included’ it in index’s source.
So my question is, is there any way, without using frames, to include a PHP file as it would be if you link directly to it in the address bar, but placed into another file in a different directory?
I have the following at the beginning of the PHP page:
<?php require_once(‘Connections/conn.php’); ?>
I want to hide the connection file, “conn.php”, so it’s out of the web
accessible file structure. I understand putting them in the php include
directory shoudl do this. For example, let’s say the directory I put them
in is /www/phpIN/, and /www/ht/ is the root web directory.
So I put “conn.php” in the inlcude directory (/www/phpIN/conn.php) and
removed it form CONNECTIONS directory.
I have the following at the beginning of the PHP page:
<?php require_once(‘Connections/conn.php’); ?>
I want to hide the connection file, “conn.php”, so it’s out of the web
accessible file structure. I understand putting them in the php include
directory shoudl do this. For example, let’s say the directory I put them
in is /www/phpIN/, and /www/ht/ is the root web directory.
So I put “conn.php” in the inlcude directory (/www/phpIN/conn.php) and
removed it form CONNECTIONS directory.
Now it doesn’t work.
What do I need to change?
I need to create a folder on the server weekly named by the user. To this folder copy the contents of an /Original folder. Inside the new folder edit one of the files to insert a data with a XML path generated in another application, copied (via memory) and pasted within the very first form and passed to the file in question.
<param name=”FlashVars” value=”xmlfile= $lanofile” />
the $lanofile is the value that I need to pass from the form to be read by this file.
I have created an form (n.php) that POST the name of the folder to a second file (creatdir.php) everything is cool until I have to edit the third file.
How can I pass the value of one of the formfileds to a second file and them read this value as a variable to be consumed as mentioned above? Or actually right whatever is on the third field to this position (not using variables).
I have a server built in window + apche. I am trying to make a photo album, but I don’t know what is the code for detecting the number of files in a server folder and the files’ name~.
Is there any tool to convert the .php files into its object files in deploying the files to other’s server like java classes are deployed?
I need to upload audio files of type .wav & video files of type .avi
/ .mov but my current file unloader is not helping me with that. My
unloader works with application types, images, txt, pdf , mp3, mpg,
mpeg but not with those .wav & .mov/.avi files……..
im creating something new with alot of php files, and i remembered that alot of times on message boards and things like that you see like “misc.php?action=list” or something like that. i would really like to decrese the amount of files i have for this new thing im creating. can someone show me how to put multi files in one?
My problem is not a php problem but something to do with uploading a file to a folder on a remote server.
On the remote server I have my upload script in a folder called lets say “img_upload” and in that same folder I have another folder called “images” where I will be uploading all my images.
Now I specify the path to this folder in my code but the images never get uploaded. I have tested this code on my local machine and from another machine in the office and it works fine. But uploading the image to a remote server is a bit of a pain in the butt.
If any of you guys have uploaded a file to a folder on a remote server could you please tell me what path I would have to put in my code??
I have to do a script which read a zip file and update with it a database, I need to know if there is a way to uncompress .zip files with PHP.
Does anyone know where I can find out how to get PHP to save a text file. Also, How can I combine text boxes and check boxes within one form? I would like to write a simple script which will take a url, and allow me to choose a description(from 4 or so options) and write a text file which could be used as a SSI.
i get these two warnings when i run the php page.
Warning: Cannot send session cookie – headers already sent by (output started at /usr/local/apache/htdocs/ticketsmith/config.inc.php:62) in /usr/local/apache/htdocs/ticketsmith/common.inc.php on line 380
Warning: Cannot send session cache limiter – headers already sent (output started at /usr/local/apache/htdocs/ticketsmith/config.inc.php:62) in /usr/local/apache/htdocs/ticketsmith/common.inc.php on line 380
and the code that generates the warnings is : Code:
I ask a user to upload an image file to my server. Works fine, exept … I want to make sure the user will only upload .jpg and .gif files. If he attempts to upload something else, I need to give an error. I use this on the first page: Code:
I am trying to create a php system where someone can download a file from the webserver.. without knowing where all the rest of the files are. so far i have PHP Code:
Ive searched around everywhere and I cant find the answer that doesnt
involve being on a Windows Machine.
Im wondering is it possible to read a .doc file? I know its a propietary
MS thing however Open Office/Star Office not sure on others can read the
file, I was wondering has anyone been able to accomplish this at all.
I have a “php.ini” file in the normal public area(“/home/sitename/public_html/”) of a site I’m working on. It has only the
following in it:-
include_path=”.:/home/sitename/public_html/admin”;
auto_prepend_file=config.site.php;
Which calls the appropriate files in an admin directory, and sets up a DB and
shopping cart, which is redundant.
My question is, does php always check for a “php.ini” in the public directory,
or is this set in the main php settings somewhere?
I’d like to remove this (with associated files) but don’t want to cause an
error, if php looks for it.
If your server supports php, do you have to upload all php files to cgi-bin, or you can upload them anywhere? I signed up with NetFirms.com, and if u upload php files to cgi-bin they work, if anywhere else it says “php is unavailable”. I probably didn’t do something, or did it wrong. or is it them?
I’ld like to know if using PHP is it possible to work with dbf fox-pro files
and with the associate cdx index files and fpt memo files
a simple questions.
how can I echo a variable made on in a PHP file inside a tpl file.
the TPL file is included inside the PHP file.
I downloaded the IBserver package that has Apache, MySql and PHP all
together. Everything installed fine.
But, where do I save the .PHP files so that the Apache server with find them
and parse them?
I was thinking that one time when I downloaded an Apache version that it
created a sub-directory “httpds” or something like that. This package
installation did create that directory.
If I execute http://localhost, it does find the document that is created by
the installation that displays links to all the part of the installation,
but http://localhost/anything.php does nothing. The file is
<?php
echo ‘Hello World’
?>
I found a PHP Zip on the fly script that I modded a little. I want this to be able to zip up two files which are in the same folder, no biggy.
The only problem that I have found is that the memory_limit defined in phpinfo is limited to 40 MB. I want this to be able to zip a movie (400 MB) and a readme text document (20 KB) Of course I get the following error when I try to download the zip file of both the files in the zip.
(PHP Error)Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 416558280 bytes) in /home/username/public_html/downloads.php on line 14memory_limit is set to 40 MB by my host I was wondering, is there a way to go about doing this in multiple stages, in order to get the same job done? Code:
The first problem i noticed was that my smtp and send_to vars were not set .. i fixed that but then i noticed that even though I was getting the errors mailed to me, the from address was still strange. Then i did a search for php.ini file (I’m on Vista) in my C:wamp folder and noticed that there are actually 2 of them, one was in c:wampphp and one in c:wampapache2.
So then my question why are there 2? They seem identical?
Does anyone know a good tutorial showing how to insert mysql results into a pdf page?
I use a website that gathers info on certain things, then offers the users to print the results out, in to form of a pdf page.
I am creating a web site in which most of my files end in .php. However, i created a certain section in my website in which i would like that my php files in that section, will be downloadable files instead of open in a browser window. Is there a way to go about this ?
P.s. What i did so far is created the downloadable php files to a zip file, and this works fine, however, if possible i would prefer leaving them as php files.
I am using PHP to make a website related to biology. In this site I use PHP code to communicate with external programms (not in PHP, but some biological packages). These programms write their output in temporary files, which I then read using fread() or file_get_contents() functions.
My problem is that these functions seem to have a restriction as to the size of the file that they can read. Is there any other way I read big files (for files close to 20-30MBs for example)?
Please note that there is no other way for me to do this because these programs, by default, write their output to a text file, so I can’t use PHP’s system commands and read the output on the fly. The output file is first created and then I read it into a string and parse it according to what I need.
is there a way to write information to a file on teh server? perl style filehandles if you will? This information would likely be coming from $_POST
I need a bit of help with Reading from a CSV file which is in the following format:-
Stephen,14,Wales,S4545
John,18,England,S6406
Becca,25,Scotland,S4564
Rob,25,Northern Ireland,S4508
Ian,25,Scotland,S4839
I know the basic and I can open the file store it in arrays and print the output.
But how would I query the file so that for example I wanted just the results returned for those matching 25 in column 2?
and then if necessary running another query and having returned those that are 25 in column 2 and Scotland in column 3?
i want to write a script that will check the age of a file and if it is over 6 hours old it will write the result of a script to the file. Now I know that I need to use the fopen, fwrite and fclose to do the file writing bits but am unsure what to use to check the age of the file as it will need to check on its own without needing someone to execute the script so how the hell do I go about doing this.
I have a database of about 20000 entries both in txt format and CSV format. I want to pull one line from the file based on an ID which is submitted from a previous form, so basically a user types in a code then clicks submit and the codes looks up this ID and displays just the info on that line in a HTML form? Can this be done? I want to avoid using a database where possible because of the sheer amount of data in it.
I have a client who wants to be able to update information on their page themselves, sort of like an online bulletin board kindof. I am very loathed to try and teach them basic HTML editing and don’t want them messing with stuff in Dreamweaver.
Is it possible with PHP to get the browser to refer to some txt file i.e. “content.txt” and will read that file and then stick that onto the page? So the client can just type/edit info within a simple txt file and upload that and the PHP will just take care of putting it onto the page? Is that possible?
I am try to read from file A then read from file B
I need to read all the words from file B and extract them from A
for instance File A = the boy ran down the road
file B = ran, road
the ouput should of A should be boy down road then output this to the screen, any takers I have this so far, but i need to subtitute the variable $Key with a file. Code:
I’d like to find a PHP program that creates PDFs on the fly. Also, I’d like the capability of replacing variables within the document. The idea is to personalize the PDF as much as possible. (Ideally when it is personalized they will be less inclined to share.)
I’ve located programs ranging from free to $150 and one for mega bucks.
At this point I need recommendations and guidance on the best practice for this type of thing. If it makes any difference currently when the text file is outputted to PDF it weighs in at around 600KB. If possible I’d like to include graphics, but it is not a deal breaker. Finally, my preference is to include a TT font set within the PDF.
My server does not have the zip library, so I am using mzip http://esurfers.com/m-zip/. I have this working fine on the same server, however what I want to do is this:
1) User logs onto my server and uploads a zip file of images.
2) Zip file is moved to another server and unzipped.
Now everything needs to be done on my server and the only thing that should be seen on the other server is the unzipped files. The only way I can think of this being done is to unzip first and then transfer over the files one by one.
I have a php page in which i have a <link> tag which reference to an external CSS file. I would like to know if it possible to create a script which detects the screen resolution and then based on the resolution it will point the <link> tag to the to the CSS file which fits best for the screen resolution. What i am trying to achieve is something similar to the following:
if screen resolution = 800×600 then
<link href=css1.css>
else if screen resolution = 1024×768 then
<link href=css2.css>
end if