Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
I am a novice scripter. I am trying to create a section on my website where I can validate various clients and direct the to web page with work product for their various engagements I have with them. I downloaded the following script from hotscripts.com and can get it to work with appropriate modifications to the variables to validate to a single directory:Code: Select all
<html>
<?php
#############################################
# PHP/Htaccess login made simple #
# #
# This script made by AvidNewmedia © 2004 #
# #
# This script will work with any htaccess #
# protected directory. It will also work #
# with CPanel access for hosting companies #
# #
#############################################
// the domain variable is where you would place
// the directory or URL that is htaccess protected.
// Make sure you DO NOT use the trailing slash, and don't include "http" in the
// domain variable or it won't work.
#your domain or ip
$domain = "foo.com/foo";
// Get Variables and create a url
$user = $_GET['username'];
$pass = $_GET['password'];
$pre = "http://";
$goto = "$pre$user:$pass@$domain";
?>
<body onLoad="setTimeout('document.forms[0].submit();',2)">
<form action="<?=$goto?>" method="post">
<input type="hidden" name="user" value="<?=$user?>">
<input type="hidden" name="pass" value="<?=$pass?>">
<input type="hidden" name="login" value="login">
</form>
</body>
</html>Code: Select all
$goto = "$pre$user:$pass@$domain";Code: Select all
$goto = "$pre$user:$pass@$domain/$user";In another BB it was suggested to me that the correct syntax for the above line would be:
Code: Select all
$goto = '$pre' . '$user' . ':' . '$pass' . '@' .'$domain' . '/' . '$user';Parse error: parse error, unexpected T_STRING in /home/ehamburg/public_html/clients/phplogin.php on line 27
Please note that this code is contained is contained in a file named phplogin.php and is called from a web page with the entry form for the user ID and password with the following code:
Code: Select all
<div id="layer2">
<h3>Client Login</h3>
<form id="FormName" action="http://www.foo.com/foo/phplogin.php" method="get" name="Client Login">
<label>User ID: </label><input type="text" name="textfieldName" size="20"><p>
<label>Password: </label><input type="password" name="textfieldName" size="20"></p>
<p><button name="Submit" type="button">submit</button></p>
</form>
</div>
//feyd | Please use
Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]