Jump to content

[SOLVED] T_string error


slapdashgrim

Recommended Posts

I need help please. when i try and load my page it says http://grimhq.com/grimspace/signup.php

here is the code.

<?
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);

If (isset($_post['submit'])){
$problem = FALSE;

if (empty ($_post['username'])){
$problem = TRUE;
print'<p>Please enter a <b>username</B></p>';
}

if(empty ($_post['password1'])){
$problem=true;
print '<p>Please enter a password</p>';
}

if($_post['password1']!=$_post['password2']){
$problem=true;
print '<p>Please confirm your password, or they did not match</p>';
}

if (!$problem){
if($fp = fopen ('users/users.txt', 'ab')){
$dir = time() . rand (0, 4596);
$data = $_post['username'] . "\t" . crypt ($_post['password1']) . "\t" . $lname . "\t" . $fname . "\t". $dir . "\r\n"

fwrite ($fp, $data);
fclose ($fp);

mkdir ("users/$dir");
print '<p>You are now registerd</p>';
} else {
print "<p>Sorry you could not be registerd due to a system error.</p>";
}else{
//forgot a field
print "<p>Please try again.</p>";
?>
<form action="signup.php" method=get><p>
Username: <input type=text name="username" size=20><br>
First name:<input type="text" name="fname" size=20 value="" maxlength="255"><br>
Last name:<input type="text" name="lname" value="" maxlength="255"><br>
Password:<input type="password" name="password1" value="" maxlength="255"><BR>
Confrirm password:<input type="password" name="password2" value="" maxlength="255"><br>
<input type=submit name=submit value=Register> </form>
<?
}
?>

Link to comment
Share on other sites

Try this

 

<?
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);

If (isset($_post['submit'])){
$problem = FALSE;

if (empty ($_post['username'])){
$problem = TRUE;
print'<p>Please enter a <b>username</B></p>';
}

if(empty ($_post['password1'])){
$problem=true;
print '<p>Please enter a password</p>';
}

if($_post['password1']!=$_post['password2']){
$problem=true;
print '<p>Please confirm your password, or they did not match</p>';
}

if (!$problem){
if($fp = fopen ('users/users.txt', 'ab')){
$dir = time() . rand (0, 4596);
$data = $_post['username'] . "\t" . crypt ($_post['password1']) . "\t" . $lname . "\t" . $fname . "\t". $dir . "\r\n";

fwrite ($fp, $data);
fclose ($fp);

mkdir ("users/$dir");
print '<p>You are now registerd</p>';
} else {
print "<p>Sorry you could not be registerd due to a system error.</p>";
}}else{
//forgot a field
print "<p>Please try again.</p>";
?>
<form action="signup.php" method=get><p>
Username: <input type=text name="username" size=20><br>
First name:<input type="text" name="fname" size=20 value="" maxlength="255"><br>
Last name:<input type="text" name="lname" value="" maxlength="255"><br>
Password:<input type="password" name="password1" value="" maxlength="255"><BR>
Confrirm password:<input type="password" name="password2" value="" maxlength="255"><br>
<input type=submit name=submit value=Register> </form>
<?
}
?>

 

--

Tapos Pal

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.