Hello Guest
No Avatar
Sign In to Remove
Posts: 
400
Reputation: 
20
Posted: June 25, 2011, 4:35 AM  -- Last Edit: June 25, 2011, 4:38 AM by MLM
  • Group: Administrator
  • AIM: mlm@visualpulse.net
  • deviantART: MadLittleMods
  • Photobucket: MadLittleMods
This tutorial will go over how to view password protected directories with Microsoft Expression Web SuperPreview!

1. Download the Script. Use the Download Link or copy/paste the code and put into your own php file.
Download: Link
Code: [Select]
<?php

// This script allows you to view password protected directories/pages
// NOTE: Make sure to change the username and password for your directory right below
$username "username";
$password "password";

// Change this access password so that an unwanted visitor doesnt view what you are trying to hide in the first place.
$access_password "access_password";


// Example use below:
// http://www.example.com/pw_viewer.php?pass=password&url=http://www.pw-protected.com/

// Change "password" to whatever you want(this is just an extra precaution if you do not want strangers viewing what you are trying to hide)
if($_GET['pass'] == $access_password)
{

$url $_GET['url']; 
$ch curl_init();
curl_setopt($chCURLOPT_URL$url);
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
curl_setopt($chCURLOPT_HEADER0);
curl_setopt($chCURLOPT_RETURNTRANSFER1);
curl_setopt($chCURLOPT_AUTOREFERER1);
curl_setopt($chCURLOPT_FOLLOWLOCATION1);
curl_setopt($chCURLOPT_MAXREDIRS1);
curl_setopt($chCURLOPT_TIMEOUT30);

// This is to log in to your password protected directory/page
curl_setopt($chCURLOPT_USERPWD"$username:$password");

// Grab Content
$output curl_exec($ch);

// Close handle
curl_close($ch);

// Print out what is on that page
echo $output;  



}

?>


2. Edit the pw_viewer.php file(if you downloaded) $username, $password, and $access_password (only three edits - see pic for more details). They are all at the top(lines 5,6, and 9).
  • $username: The username for the password protected directory/page
  • $password: The password for the password protected directory/page
  • $access_password: This is what you will use to make sure no one can view your link without knowing this keyword. Remember this!


3. Upload to your server in a NON-PASSWORD-PROTECTED directory. There is a access password on the file so you do not have to worry about an unwanted visitor seeing what you are trying to hide.

4. You are now all set up and ready to use the script in Microsoft Expression Web SuperPreview. This script could be used on other applications that do not allow password protected links, etc.

5. For use: Location of pw_viewer.php + Access Password + The URL you want to view
ex.
Code: [Select]
http://www.example.com/pw_viewer.php?pass=password&url=http://www.pw-protected.com/
6. With that url just put it into the location field at the top of the application and submit.

Happy Viewing!  ;)
<3 Nerve, Sk8, Labradoodle, Austin
Posts: 
56
Reputation: 
4
Posted: November 20, 2011, 11:15 AM
  • Group: Member
  • deviantART: Imperiousnel
  • MSN: Pirate_King0@hotmail.com
  • Photobucket: Nelo_Angelo1
What exactly is a Pw protected page? Do you mean something like Hotmail.
Posts: 
400
Reputation: 
20
Posted: November 21, 2011, 4:59 AM
  • Group: Administrator
  • AIM: mlm@visualpulse.net
  • deviantART: MadLittleMods
  • Photobucket: MadLittleMods
What exactly is a Pw protected page? Do you mean something like Hotmail.

No, hmm this is hard to describe without an example. Well you can password protect directories on your server and then when you try to visit the location it  prompts for a username and password before any content is displayed. here is what it looks like:
<3 Nerve, Sk8, Labradoodle, Austin
Posts: 
56
Reputation: 
4
Posted: November 21, 2011, 10:58 PM
  • Group: Member
  • deviantART: Imperiousnel
  • MSN: Pirate_King0@hotmail.com
  • Photobucket: Nelo_Angelo1
O, sorta like Ftp forms. Ive seen this maybe once or twice. Will this work when you try to view someone else's server content?
Posts: 
400
Reputation: 
20
Posted: November 22, 2011, 3:08 AM
  • Group: Administrator
  • AIM: mlm@visualpulse.net
  • deviantART: MadLittleMods
  • Photobucket: MadLittleMods
O, sorta like Ftp forms. Ive seen this maybe once or twice. Will this work when you try to view someone else's server content?

Of course but not in the sense that you can hack or view stuff you shouldn't. You still have to know the username and password but this is just a way to view those pages without having the prompt stop content from flowing when you want to see something in Microsoft Expression: SuperPreview or Adobe's browser labs.
<3 Nerve, Sk8, Labradoodle, Austin
Posts: 
400
Reputation: 
20
Posted: December 20, 2011, 3:04 AM
  • Group: Administrator
  • AIM: mlm@visualpulse.net
  • deviantART: MadLittleMods
  • Photobucket: MadLittleMods
Hmmmmm. But what will be the way to retrieve the username and password to view the page?

This is not for hacking... You set this up when you create the password protected directory.
<3 Nerve, Sk8, Labradoodle, Austin
anything