SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard edshuck's Avatar
    Join Date
    Jul 2000
    Posts
    1,200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    signup.php and a little parse problem

    hi

    small difficulty, major for me - i am having the problem.

    in the tutorial from kevin about sessions, there are several small files. one is the signup.php. i am having a problem getting past the parse with the error constantly being repeated at the else:

    has anyone encontered the problem and cleared it or is there something i am not doing?

    i am really directing this query to those who have had an involvement with the tutorial.

    i know the problem is me but i am at a loss as to what i have done wrong.

    this is the code area of the problem.
    </body>
    </html>
    <?php
    else:

    dbConnect('edshuck');

    if ($newid=="" or $newname=="" or $newemail=="") {
    error("One or more required fields were left blank. Please fill them in and try again.");
    }
    this is just a snip but will be recognizable.

    thanks

  2. #2
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    um... why is it else: ?
    that's not the structure for an if/else statement.
    PHP Code:
    if(condition)
    {
    // do this if true
    }
    else
    {
    // do this otherwise

    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  3. #3
    SitePoint Wizard johnn's Avatar
    Join Date
    Mar 2001
    Location
    Southern California, USA
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Defender1,
    It is if you search for "else:" in the php manual. I think edshuck needs "endif;" after dbConnect() statement.

  4. #4
    SitePoint Wizard edshuck's Avatar
    Join Date
    Jul 2000
    Posts
    1,200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that is a really good question.

    kevin used it in the editauthor.php of the original 10 chapter tutorial. and here in this tutorial. and i ask once before with no real reply. it was a question to the group and not to kevin.

    i do not know.

    but i do know that there is a way that this works. it worked once and i managed to mess it up. and it worked with the else:
    Last edited by edshuck; Oct 23, 2001 at 22:53.

  5. #5
    SitePoint Wizard edshuck's Avatar
    Join Date
    Jul 2000
    Posts
    1,200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi

    let me work with the endif for a few minutes. thanks

  6. #6
    Happy Holidays !! Paul S's Avatar
    Join Date
    Mar 2001
    Location
    Mexico
    Posts
    1,287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    there's a problem with that syntax (don't use it, read what is told in the manual), it could be a real mess with nested if..else conditions. IMHO, if I were you I'd use brackets.


Bookmarks

Posting Permissions

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