SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Sep 2002
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Changed? - php/mysql form posting

    Someone in another thread said that some of the coding has changed since Kevin's book, which I currently learned off of.

    Other statements were changed, by any chance, has this too?

    PHP Code:
    <?php  
    if ($_POST['Submit']=="Submit") {  
         
    $dbcnx = @mysql_connect("asdf""asdf""asdf");  
         if (!
    $dbcnx) {  
              echo (
    "<P>Unable to connect to the database server at this time.</P>");  
              exit();  
         }  
         if (! @
    mysql_select_db("planetdraft") ) {  
              echo(
    "<P>Unable to locate the Roster Database at this time.</P>");  
              exit();  
         }  
         
    $sql "Insert into f3_roster_profiles set  
         name='
    {$_POST['PlayerName']}', 
         email='
    {$_POST['PlayerEmail']}";  

         if(@
    mysql_query($sql)) {  
              echo(
    "You have added player, $name, to the Roster database.");  
         }else{  
              echo(
    "Error");  
         }   

         exit();  

    }  

    ?>  

    <p><a href="<?=$_SERVER['PHP_SELF']?>">Add another Member</a></p> 
    <p><a href="manage.php">Return to Site management home</a></p> 

    <? 

      
    else: 

    ?> 

    <form action="<?=$_SERVER['PHP_SELF']?>" method="post"> 
    <p>Enter the new member:<br /> 
    Name: <input type="text" name="name" size="20" maxlength="255" /><br /> 
    Email: <input type="text" name="email" size="20" maxlength="255" /><br /> 
    </form> 

    <?php endif; ?>
    And the error I recieve is: Parse error: parse error, unexpected T_ENDIF in c:\inetpub\wwwroot\newplayer.php on line 77

  2. #2
    SitePoint Member
    Join Date
    Sep 2002
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, it looks like anything I do with forms doesn't work, nothing. I bought Kevin's book to get started, now everything has changed according to a few users on these boards. Ive used everyway so far in his book to do the forms, and nothing works.

    Im not saying the book wasnt useful, cause it really did give me a nice leap into being fluent with the basics.

    If you can, link me to a place where I can purchase a book or something that can maybe tell me the new updates since, and help with forms/if-else commands, etc.
    Last edited by draft-; Sep 28, 2002 at 06:53.


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
  •