Password form for iPhone (Simple) - webforms

I am trying to create a webform on the internet that is mobile. I have everything working but am confused on how to create a single password login form.
Example: You click a link and it will direct you to a password only login. The password does not have to be stored in a database but it is just asking for a password, then when you enter the right one it directs you to a website with the download and if you enter it wrong it will display a popup error saying wrong password.
Any ideas?

There is a simple way with .htaccess and .htpasswd files. I tried it on my website, visit ph3nx.com/test (Login with username: "test" and password: "1234")
It's just a directory on my webspace where i put a index.htm containing "correct" and this two files:
.htaccess
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /var/www/test/.htpasswd
AuthGroupFile /dev/null
<Files index.htm>
require valid-user
</Files>
.htpasswd
test:zYghPID4qWkpI
It's working with iPhone and Computer and is very simple :)
Here you can create these files: tools.dynamicdrive.com/password
I hope this helps you ;)

Related

pretty-urls not working with XAMPP and Laravel 5.8

I use Laravel v5.8 and I was happy to use it in VMware with Ubuntu. Now I needed to change to a Windows Server 2012 with xampp.
There is one thing I cannot eliminate:
I can visit my page over
https://fancysubdomain.fancydomain.de/myapplikation/public
I've created links like
<a class="title" href="/entries/create" > FOO </a>
These links go to
https://fancysubdomain.fancydomain.de/entries/create
(watch the missing "myapplication" block) and Apache tells me that the requested URL was not found.
If I type
https://fancysubdomain.fancydomain.de/myapplikation/entries/create
in the address field of the browser it also doesn't work.
In the .env file, I've set
APP_URL= https://fancysubdomain.fancydomain.de/myapplikation/
I've edited \conf\app.php to
'url' => env('APP_URL', ' https://fancysubdomain.fancydomain.de/myapplikation/'),
There are no virtual hosts set up in httpd-vhosts.conf (I am not the administrator). Do I need to set them up to get what I want? Do I need to set up something else?
You should create a Vhost which should point to the public directory of you Laravel application.
It should look like this:
<VirtualHost *:80>
DocumentRoot "path/to/laravels/public/dir"
ServerName localhost
<Directory "path/to/laravels/public/dir">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
After this is done, the default .htaccess file will work and you have pretty url's.
I’ve finally found a solution. Thanks #J. Grunder stackoverflow
After I had changed these settings, I ran into a new problem with my links.
I had created links like
<a href=”/entries/create”>Create Entry</a>
Unfortunately, now the links pointed to
https://fancysubdomain.fancydomain.de/entries/create
(watch missing myapplikation element)
Of course, I could handle that with
<a href=”/myapplikation/entries/create”>Create Entry</a>
But there could be some problems if the user is at that place.
If somebody else runs in the same problem:
Use Laravel’s URL helper:
<a href=”{{ action('EntriesController#create') }}”>Create Entry</a>

Magento admin redirects to 404 page after login

I'm struggling to set up Magento 1.9.1 on Godaddy for the few hours. I've managed to get all URLs work, except admin, which renders a 404 page with Magento's "Whoops" message just after logging in with the right password.
The URI: /index.php/admin/dashboard/index/key/b4a2c39042dae9efe5b17e98e93d5f64/
Changing the core library files as suggested in other topics didn't make any difference.
I had the same trouble, I have resolved it editing .htaccess. My Magento installation is in a subdirectory of my hosting. I have removed the # on the RewriteBase line and added the right value for the subdirectory.
in .htaccess :
RewriteBase /magento_directory/

Private Joomla 2.5 K2 items redirects back to homepage instead of origin link after login

I am gonna try my best to describe our problem. Hopefully someone way smarter than us can figure this out. One of our Joomla sites has some content that requires login, simple enough right? The normal login functionality works great. Once logged in we could see the locked down content. But lets say we have a direct link to a "locked" page, once logged in, the page redirects to the homepage (index.php).
Natively Joomla 2.5 should retain the origin link, and redirects to that link, not back to index.php. So if my link was homepage.com/k2item1, after login it should go to k2item1 not index.php. I have tried turning off all modules and plugins just in case something is overriding the native login functionality from links. I have checked the .htaccess file for redirects. I have tried both settings in SEO settings "Use URL rewriting", Yes/NO doesn't matter. I have tried renaming the override folder (html) in our template folder, so no overrides should happen. Nothing. The link still redirects back to index.php. I have even tried printing out the form/user object to see if the origin link was there, aka "return", and the link is in there, but after login, still index.php instead of the string "return". Any ideas will be greatly appreciated. Maybe there are plugins out there that would help ensure links do not redirect to home page?
Override the component: mod_k2_user/login.php and edit the hidden input name "return".
<input type="hidden" name="return" value="<?php echo base64_encode(JURI::current()) ?>" />

Website default document denied by security restrictions?

I have an ASP.Net 4.0 website hosted at winhost.com.
The default document is index.html. In the browser address bar, if I enter
http://www.mysite.com/index.html
it works fine - I get the index.html page as desired.
If, however, I simply enter http://www.mysite.com
the site behaves as if I have requested a page allowed only to authenticated users, that is, I am automatically redirected to the Login.aspx page.
Obviously this is a major panic! It means that the normal, public facing portion of the site is no longer visible unless visitors are instructed to include "index.html".
In IIS, I have verified that the "Default Document" is index.html, and it is first in the list.
In the web.config, I tried adding
<location path="index.html">
<system.web>
<authorization>
<allow users="?" />
</authorization>
</system.web>
</location>
But that did not help.
This all happened when I converted the site from 2.0 to 4.0. I was so busy fixing all the other problems (ajax security, wrong versions of dlls, etc.) that I never noticed this problem. Seems like it should be simple to fix, but I am stumped. Thanks for any help!
Check the NTFS permissions for the folder, where your website is located. And compare it with "index.htm" file permissions. Some user account must be missing.

Can I protect with a .htaccess file some routes with sinatra?

I wrote a small app with Sinatra and have some admin routes (/admin/new, admin/edit/2, ...) and want to protect them with a .htaccess prompt. Can somebody tell me how I do that?
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /path/to/file/.htpasswd
<Files "protected.html">
Require valid-user
</Files>
If you want to use Sinatra for Authentication, check out this faq.

Resources