Default Redirect To Webpage For Authentication?
I'm hunting for a script that would allow me to place a wide-open
wireless access point in my client's business. Then, anyone connecting
and then surfing a webpage would be redirected to a default webpage for
their username/password. Once they log-in, they can surf as normal
until they close their browser. Each new browser session would require
a new cookie/login to surf the web.
Has anyone seen a script that can do this? Or, should I be looking at
some sort of proxy server product?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Set Username/password Authentication For Webpage
i am trying to assign authentication for my web page by using the code <?php if ($PHP_AUTH_USER != “XXX” or $PHP_AUTH_PW != “XXX”): header("WWW-Authenticate: " . "Basic realm="Protected Page: " . "Enter your username and password " . "for access.""); header("HTTP/1.0 401 Unauthorized"); ?> <HTML> <HEAD><TITLE>Authorization Failed</TITLE></HEAD> <BODY> <H1>Authorization Failed</H1> <P>Without a valid username and password, access to this page cannot be granted. Please click ‘reload’ and enter a username and password when prompted. </P> </BODY> </HTML> <?php else : header("Location:http://localhost/"); endif; ?> By using this code it always ask me the username and password just i entered the correct details since it ask me for authentication. Any body tell me how to use it.
Redirect To Webpage When Enter Into A Folder
When we enter url (without sepecified the file) into the browser, like http://website.com/folder/, it would show us the index of the files & folders exist within the specified folder but is it possible for us "control" the browser in such a way, that it would redirect to a file(default.php) so that it would never show user the Index?
How To Use NT Authentication To Redirect Users?
I have NT Authentication on a directory folder, but I want to redirect certain users to differents index pages after they log in. How can I do this? Does NT Authentication box pass variables to the page (ie. $_POST['username']). I don't want to have to validate user's session id for every back page.
How To Move Arrays From Html Webpage To Webpage?
There are a couple techniques to move information from different html web page to web page. 1. URL; 2. Cookie; 3. Form; 4. Session; All the examples I found are move distinguished variables from page to page, such as "?weight=20&name='apple'". I need users choose from the first web page (the arrays will be generated), then use it in second and third html web pages. How do I transfer them (arrays) and which way is the best? For example, if I have two arrays, $fruit[] = array("apple", "pear", "orange"); and associative array $myCats["Me"]="Merry"; $myCats["Pi"]="Pippin"; $myCats["He"]="Hergie";
Database Stores Default Number Everytime, But I Havent Set A Default Number??
Im having some problems with my database. Everytime i store a number which is longer than 10 numbers the script or database puts this number into the database: 2147483647. Its does this everytime no mather how i write the numbers and nomather how long the number is, it just needs to be over 10. I have set any default value in the database and to be sure i havent i tried deleting the table, but same thing happends again???
Php Webpage And Form On Webpage!
recently signed up for a text messageing service that can use php script to send required details to specific mobile numbers, Anyways i recieved this code from the company: Code:
HTTP Authentication .vs. Session Authentication
I am designing a PHP application (yes, I have investigated using existing applications). I cannot use HTTPS for reasons I shall not disclose. I must authenticate users against a database (MySQL) before granting them access. There are two methods I am considering: HTTP authentication, and session authentication. My webpage is spread across multiple scripts, and the user must not have to repeatedly reauthenticate him/herself. It does not matter, however, if the login session remains or is destroyed when the browser closes, although destruction is preferred. To my knowledge, PHP only supports Basic HTTP authentication. This would be easier, and if it matches session authentication in security, I would prefer to use it. Session authentication would be accomplished via a hashed password supplied in a form, sent via POST, after which the userid or another identifying piece of data would be stored in a session variable. My webserver does host other websites, and I cannot adjust its configuration. It seems to me, however, that Basic HTTP authentication sends the username and password in plaintext at the opening of every page. Is this true?
GD Default DPI
I'm currently making a website that needs to edit images with adding text, the problem is, the picture starts at 300 DPI (pixels/inch), but after GD edits the image, it's set to 72 which i read to be the default value GD always uses. is there a way to edit that default to a higher number, if not are there other ways to edit images through php and still keeping the original DPI.
Magic_quotes_gpc On By Default In PHP 4.3.3?
Prior to upgrading to PHP 4.3.3 (Windows), magic_quotes_gpc was turned off in the php.ini file. However, when I upgraded, I told the installer overwrite my previous php.ini files. I didn't have anything special in my previous version of php.ini and I wanted a clean slate. After I upgraded to 4.3.3, I noticed that my scripts were acting strange, specifically form input. I checked php.ini and found that magic_quotes_gpc was turned on. I unzipped the installer exe and upon inspecting the php.ini, I found the default php.ini included had magic_quotes_gpc On. I thought they were going to set magic_quotes_gpc off by default in the later versions. Anyone know why they did this? Was it a mistake?
What Is Better As A Default Value: NULL Or ''?
I would like to collect some statistical data and then make some reports on it. I'm creating tables for this task and i'm not sure what is better for filling default values: NULL or ''. What is optimal for storage purposes and for further reports creation?
Default Image
How can I write a function in such a way that it would look for a specific image to load. If that image exists on the server it will load it, if not it will load a default image.
Dropdown - Default Value
I want to be able to have a drop down list that doesn't necessarily have the first item as the default. The content is being populated by PHP so I have no idea how to do it.
Default Variable Value
Does php provide a built in way to use a variable's current value if that variable is already set but to use a default value otherwise. That is, a more compact syntax for: $some_var = isset("$some_var") ? $some_var : "default value";
Set Column Default
we have a table sistock with column cameramodel varchar(30) and try to set default value to blank with the following: ALTER TABLE SISTOCK CHANGE COLUMN CAMERAMODEL CAMERAMODEL ENUM ('INSTOCK', 'BACKORDER','SERVICE','OBSOLETE') DEFAULT ''; and we get an error at the mysql prompt;
ImageString: How Do I Use A Font That Is Not One Of The Default 5?
I am playing with imagegd for generating images, and was wondering if there is a way I could use a font that is not one of the default 5? I remember reading somewhere about a TT font library for imagegd, but don't remember the specifics. If someone could point me in the right direction I would appreciate it.
Problem On Default Value : : MySQL
Problem on default value : : MySQL I am facing problem in this line `datetime` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, when I tried to crate a new table in MySQL(version 3.23.47-nt)
Using Default DB, User, Password
How do I use odbc.default_db, odbc.default_user and odbc.default_password defined in php.ini in the mssql_connect() function? I do not want to define these vars globally at the application level for many reasons. Shouldn’t calling the function without any parameters force PHP to look at the INI file for the defaults?
Form With To Submits, Which One To Default To?
Say, I have a form. Both cancel and save (in that order) are submits, then in the code I check which button was pressed. The point is that I want the save button (2nd) to be default, not the cancel. Is there a way (in js?) to "focus" the other button? One other way to be some simple js, which submits the page anyway......
Object Default Value In Constructor
I'm trying to write a class with a constructor that takes a single object parameter. So far so good, but I can't for the life of me make the parameter optional. I understand how to do it with a numerical or textual parameter, but not with an object. I tried null, but it doesn't work. class A { } class B { function B($a = ???) { if (!isset($a)) $a = new A; } }
Default Selection From Query
I'm having difficulty trying to have a DEFAULT selected record from a query in my dropdown box (code below). I have about 20 records in a 'facility' table, which listed names of our company's locations. I want to default select one of those records "exton" to be selected in my dropdown box. Code:
PHP Default Host Best Practices
I've got my dev and production environments all setup, and the mysql DBs working fine. What need to do is set the mysql.default_host option in php.ini to be one thing on dev, and something different on production. Unfortunately, my web host doesn't allow me to mess with php.ini. So, what's the best way to specify a different host to mysql_connect() on dev and production. Yes, I could manually edit the variable everything I FTP, but I'd rather not. Should I use a global variable in a separate include file? Other options?
Default Argument Values
something like this possible in PHP: function foo($a=1, $b=2, $c=3) { //... } foo($b=2); Will this assign $a and $c to default values?
How To Overwrite Default Php Installation
On my linux system php seems to have been installed by default. When I type: "which php" it tells me /usr/bin/php I installed php and it has put an executable in the /usr/local/bin/php "which php" still says /usr/bin/php "whereis php" php: /etc/php.ini /usr/bin/php /usr/local/bin/php /usr/local/lib/php /usr/local/lib/php.ini /usr/local/lib/php -v shows the new version but php -v shows the old version. How can I correct this problem? I want to run the command php -v and it shows the newest version. I have already tried removing /etc/php.ini /usr/bin/php
Default Value To Insert Into MySQL
What should I insert as the default value if a form field is blank? My fields don't currently accept null. if($_POST['height']) { // error checking $height = $_POST['height']; } else { $height = ''; } Should $height be equal to '', NULL, or maybe 'NULL'? I'm thinking 'NULL' incase I or someone else decides to change the field to accept null?
PHP Session Default Timeout
what is the default Session Timeout for php...is there a way to increase this on the web server I am hostign my php scripts on..
Default Date Drop Down
Ive got the following drop down which works perfectly, although the default date is set to todays date. Could you please advise me on how to set it to show -- -- ---- instead of 31 05 2007? Code:
Php's Default Character Set
Where does it say that on php.net, that iso8859 is the default charset for strings? Can't find anything about it.
Display A Default Image?
Is there an "if" statement I can use to check if an image exists in a certain directory, and if it does display it, but if it doesn't exist then display another image in a different directory? I've written simple "if" statements for text display, but nothing like this. Is this possible? It might help to tell the scenario. I am putting together templates for teacher web sites. If they wish, they can upload their own logo into their upload directory to display at the top of the page, but if they choose not to upload their own logo I want the default (district) logo to appear there. The default logo is located in another directory on the same server.
Get Webpage Url
how would I call a web page url I'm interested in the current active page Example the URL when I type this post is http://www.phpfreaks.com/forums/index.php?action=post;board=1.0 I want to assign it to a variable ie $url=http://www.phpfreaks.com/forums/index.php?action=post;board=1.0
Default Error Page If No Rows
If there are no rows in the result of my query, instead of just showing some text in the browser saying no rows found, could i redirect to a standard error page using this function?
Need Access To Default File Attributes
When I was first learning php, I created an upload script. The basics of the script had: <form method="POST" ENCTYPE="multipart/form-data"> <input type="file" name="FILE"> <input type="submit" name="SUBMIT" value="Upload"> </form> Then in the submit section, it accesses the filename and filesize by virtue of a default php ability to extract these attributes by using: $FILE_name and $FILE_size (where _name gives the name of $FILE and _size gives the size of $FILE). if($SUBMIT) echo " Filename: $FILE_name <br> Filesize: $FILE_size"; Also, I did add the necessary lines to handle the post variables, like so: $FILE = $_POST['FILE']; $SUBMIT = $_POST['SUBMIT']; I have tried to mimic this script in a new upload script, but am unable to access those same attributes (_name and _size). At the time of my original upload script, we were running it on a Linux server (but I don't remember what we were running for a php version). Currently, I am running PHP 4.2.3 on Mac OS 10.2.8 server. One thought I had was that maybe PHP 4.2.3 no longer supports _name and _size. Or, maybe I am not handling the retrieval of the POST var for the file correctly? I wonder this because I did try print_r($_POST) and I only got the submit returned as a post var.
Dropdown List - Trying To Get Default Populated From Db.
Nooby question but when I try and get this to work (it should identify which rows in the database have GK, MID, DEF, FWD against them and then put SELECTED into the option value to give a default of what the entry is currently) it just adds SELECTED to all the results as if $row["Position"] is returning true against all four conditions? What am I doing wrong? CODE:..
Entering The Date As Default Within A Form
Anyone know how to enter the time into a form or a website that might tell how? I'm using the following html code and trying to get the time to default into the text box. thanks html code <tr> <td><b>Date:</b></td> <td align="left"><input type="text" name="date" size="8" maxlength="8"></td> </tr> php code <? print strftime("%m/%d/%Y"); ?>
Default Function Argument Issue
function test($foo=array()) { echo gettype($foo); implode(' ',$foo); } foo(); This code will output: null and generate the error Bad arguments. in .... on line x ( bad implode args ) what's the deal? $foo should be an array!
Send Default Apache 404 Error From Php
How can I trigger the default Apache 404 error from PHP? I don't want to specify a custom handler, I want the default handler. The reason is that I am using mod_rewrite with Apache for my site. If certain a certain page is requested that is not published, then I want to send the apache default 404 error page. Currently, I am doing this to return a custom error. if($pageNotPublished) { header("HTTP/1.1 404 Not Found"); // How do I send the default apache 404 message // instead of the message below? print("<html><body>HTTP 404 - Not Found</body></html>"); exit(); } The default 404 error page has more details,
Default Home Page Under Xampp.
Is there a way to change default home page under Xampp, so that when I type http://localhost it would go to a home page other than page with popup asking for Xampp authorization.
How To Change PCRE Default Delimiters
I try to use alternative delimiters for a regular expression. When will it be supported? www@mike:/home/www > /usr/local/bin/php -a Interactive mode enabled <?php preg_match('m!A(d*)B!', 'A12345B', $X)); ?> X-Powered-By: PHP/4.2.3 Content-type: text/html <br /> <b>Parse error</b>: parse error in <b>-</b> on line <b>2</b><br /> http://perldoc.com/perl5.8.4/pod/perlrequick.html
How Can I Delete The Default Apache And Php On Linux?
I installed php4.0.2 and apache 1.3.12,but I use the function phpinfo() checked the version of the php,it always tells me it is 3.0.15,so I want to delete the default apache and php on linux,so I can install new php4 and apache and it can connect to the mysql.By the way how can I get rid of the php and apche which the in linux when I installed the linux.
Default Select Drop Down Menu?
I have a drop down menu populated via a script that pulls all categories from the category table. However, when a user clicks to view a specify category (i.e. Toys), I want the drop down menu to display toys as the default value. Code:
MYSQL: How To Set A User's Default Database?
Is it possible to set a user's default database for MySQL database? Instead of having an additional line of command, i.e: mysql> use database <database_name> Perhaps there are parameters I can set up a default database for a user when she log on to mysql.
Setting An Image Field As A Default?
In my application I have 6 image fields. If a user uploads an image they must upload an image 1 which is the main image. So I dont want them to be able to jump to the 2nd or 3rd fields and upload their file there. I am just not sure how to go about defaulting them to upload image 1 first?
Default Selection Radio Button
I have a table where users input a date, time, and quantity for a reservation. On my page ... because I have a junk calendar and coding, every time you click a different month on the calendar or click the "book now" button without entering all the necessary data, the page refreshes and erases all the data. One significant problem is that the times display as radio buttons. Some tours have one time and some have multiple times. On the page, if there is only one time, then to make it easier for users to book tours, I inputted CHECKED into the html code. But unfortunately if the tour has multiple times, then CHECKED doesn't work for the first radio button, it defaults the last radio button because of the php loop. Code:
Screenshot Of Webpage.
I remember an old topic way back about creating a script that would be able to create a dynamic thumbnail image of a live web page. I didn't follow it all the way thru and never did see if somebody created a solution. I tried searching for it, but can't find it. Did anyone figure out if this is possible?
How To Parse A Webpage
I've scoured the net looking for a tutorial on how to parse a webpage but I've come up short handed. Can anyone provide me with some tips on how to get started?
Forcing A GET To Another Webpage
How can I forcefully 'push' a get request within a php? Example would be having 2 websites running on two diferent server. When I update site A, I would like update site B as well using GET. PHP Code:
|