|
-
Aug 20th, 2005, 04:10 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] errors i cant find
wts wrong with these snippets?
Code:
$data = $_POST['first_name'] . "\t" . $_POST['last_name'] . "\t" . $_POST['email'] . "\t" . $_POST['username'] . "\t" . crypt($_POST['password'] . "\t" . $dir . "\r\n";
fwrite ($fp, $data);
and here it says call to undefined function fgetcvs ()
Code:
if (isset ($_POST['submit']))
{
$loggedin = FALSE;
$fp = fopen ('../users/users.txt', 'rb');
while ($line = fgetcvs ($fp, 100, "\t"))
{
if (($line[0] == $_POST['username']) AND ($line[1] == crypt ($_POST['password'], $line[1])))
{
$loggedin = TRUE;
break;
}
}
-
Aug 20th, 2005, 08:09 PM
#2
Lively Member
Re: errors i cant find
You forgot a closing ')' when calling crypt():
Code:
$data = $_POST['first_name'] . "\t" . $_POST['last_name'] . "\t" . $_POST['email'] . "\t" . $_POST['username'] . "\t" . crypt($_POST['password']) . "\t" . $dir . "\r\n";
Also, whats fgetcvs()? Did you mean fgetcsv()?
-
Aug 20th, 2005, 11:15 PM
#3
Thread Starter
Hyperactive Member
-
Aug 20th, 2005, 11:32 PM
#4
Thread Starter
Hyperactive Member
Re: errors i cant find
1 more thing i made my form "sticky" to retain the values but even wen u first open the page it is displaying the $_POST['first_name'] etc stuff
how can i makje it retain the values after anything was entered?
-
Aug 21st, 2005, 12:11 AM
#5
Lively Member
Re: errors i cant find
Do you check to see if has a value already?
PHP Code:
<input type="text" name="aName" value="<?php if(isset($_POST['aName'])) echo $_POST['aName']; ?>">
-
Aug 21st, 2005, 12:38 AM
#6
Thread Starter
Hyperactive Member
Re: errors i cant find
now this isnt working
Code:
<p>First name:
<input type="text" name="first_name" value="<?php if (isset($_POST['first_name'])) echo $_POST['first_name']; ?> /><br />
Last name:
<input type="text" name="last_name" value="<?php if(isset($_POST['last_name'])) echo $_POST['last_name']; ?> /><br />
Email:
<input type="text" name="email" value="<?php if(isset($_POST['email'])) echo $_POST['email']; ?> /><br />
Username:
<input type="text" name="username" value="<?php if(isset($_POST['username'])) echo $_POST['username']; ?> /><br />
Password:
<input type="password" name="password" /><br />
Confirm password:
<input type="password" name="confirm" /><br />
<input type="submit" name="submit" value="Register" /></p>
-
Aug 21st, 2005, 12:42 AM
#7
Thread Starter
Hyperactive Member
Re: errors i cant find
n/m i just forgot the cloding "
no i just gotta fix my conditional cause somethings still not right
-
Aug 21st, 2005, 12:46 AM
#8
Lively Member
Re: errors i cant find
You're missing the ending quote on the value attribute:
Code:
<p>First name:
<input type="text" name="first_name" value="<?php if (isset($_POST['first_name'])) echo $_POST['first_name']; ?>" /><br />
Last name:
<input type="text" name="last_name" value="<?php if(isset($_POST['last_name'])) echo $_POST['last_name']; ?>" /><br />
Email:
<input type="text" name="email" value="<?php if(isset($_POST['email'])) echo $_POST['email']; ?>" /><br />
Username:
<input type="text" name="username" value="<?php if(isset($_POST['username'])) echo $_POST['username']; ?>" /><br />
Password:
<input type="password" name="password" /><br />
Confirm password:
<input type="password" name="confirm" /><br />
<input type="submit" name="submit" value="Register" /></p>
-
Aug 21st, 2005, 12:52 AM
#9
Thread Starter
Hyperactive Member
Re: errors i cant find
yea i fixed that but now something is messed up with the conditionals cause ir sumit all thev alues the right way and the forms says try again instead of registering me
-
Aug 21st, 2005, 12:56 AM
#10
Lively Member
Re: errors i cant find
Hm, well I cant suggest anything without seeing the code, other than just using regular debugging techniques to figure out where the problem is.
-
Aug 21st, 2005, 12:57 AM
#11
Thread Starter
Hyperactive Member
Re: errors i cant find
yea ima try and figure it out on my own for once lol if i really cant find it i'll make a new thread thanx for ur help yak
-
Aug 21st, 2005, 01:00 AM
#12
Lively Member
Re: [RESOLVED] errors i cant find
You're welcome, and good luck.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|