Results 1 to 12 of 12

Thread: [RESOLVED] errors i cant find

  1. #1

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Resolved [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;
    		}
    	}

  2. #2
    Lively Member {yak}'s Avatar
    Join Date
    Aug 2005
    Posts
    119

    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()?
    {yak}

  3. #3

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: errors i cant find

    oops lol

  4. #4

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    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?

  5. #5
    Lively Member {yak}'s Avatar
    Join Date
    Aug 2005
    Posts
    119

    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']; ?>">
    {yak}

  6. #6

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    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>

  7. #7

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: errors i cant find

    n/m i just forgot the cloding "
    no i just gotta fix my conditional cause somethings still not right

  8. #8
    Lively Member {yak}'s Avatar
    Join Date
    Aug 2005
    Posts
    119

    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>
    {yak}

  9. #9

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    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

  10. #10
    Lively Member {yak}'s Avatar
    Join Date
    Aug 2005
    Posts
    119

    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.
    {yak}

  11. #11

    Thread Starter
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    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

  12. #12
    Lively Member {yak}'s Avatar
    Join Date
    Aug 2005
    Posts
    119

    Re: [RESOLVED] errors i cant find

    You're welcome, and good luck.
    {yak}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width