notice melding (Opgelost) 		
			
		
		 		
				
		
                        
                 
            
            
				
                
                    rikske (laatste wijziging 03/03/2007 15:47)                       
             
             
                        
                Nieuw lid 
				
				hallo, 
              
        
		
				
		18 antwoorden 
                
                     
                
                    
		
		
	             
 
            
                    
                         
                    
                    
                        
                            Stijn                             
                         
                     
                    
                        PHP expert 
    
    
        
            
                <?
error_reporting( E_ALL ^ E_NOTICE );
?> 
             
            
         
         
     
   
                
                    
                         
                    
                    
                        
                            rikske (laatste wijziging 03/03/2007 17:44)                             
                         
                     
                    
                        Nieuw lid 
    
    
        
            
                <?
include ("header.inc.php");
?>
 <h1>Edit / add address book entry</h1> 
  <?php
include("dbconnect.php");
if($submit)
{
$sql = "INSERT INTO $table (firstname, lastname, address, home, mobile, work, email, email2, bday, bmonth, byear) VALUES ('$firstname','$lastname','$address','$home','$mobile','$work','$email','$email2','$bday','$bmonth','$byear')";
$result = mysql_query($sql);
echo "<br><br>Information entered into address book.\n";
}
else if($update)
{
$sql = "UPDATE $table SET firstname='$firstname',lastname='$lastname',address='$address',home='$home',mobile='$mobile',work='$work',email='$email',email2='$email2',bday='$bday',bmonth='$bmonth',byear='$byear' WHERE id=$id";
$result = mysql_query($sql);
echo "<br><br>Address book updated.\n";
}
else if($id)
{
$result = mysql_query("SELECT * FROM $table WHERE id=$id",$db);
$myrow = mysql_fetch_array($result);
?>
  <form method="post" action="edit.php">
     
             
            <? 
include  ( "header.inc.php" ) ; 
?> 
 
 <h1>Edit / add address book entry</h1> 
  <?php 
include ( "dbconnect.php" ) ; 
if ( $submit ) 
{ 
 
$sql  =  "INSERT INTO $table  (firstname, lastname, address, home, mobile, work, email, email2, bday, bmonth, byear) VALUES ('$firstname ','$lastname ','$address ','$home ','$mobile ','$work ','$email ','$email2 ','$bday ','$bmonth ','$byear ')" ; 
echo "<br><br>Information entered into address book.\n " ; } 
else  if ( $update ) 
{ 
$sql  =  "UPDATE $table  SET firstname='$firstname ',lastname='$lastname ',address='$address ',home='$home ',mobile='$mobile ',work='$work ',email='$email ',email2='$email2 ',bday='$bday ',bmonth='$bmonth ',byear='$byear ' WHERE id=$id " ; 
echo "<br><br>Address book updated.\n " ; } 
else  if ( $id ) 
{ 
$result  =  mysql_query ( "SELECT * FROM $table  WHERE id=$id " , $db ) ; ?> 
  <form method="post" action="edit.php">
 
         
     
 Citaat: 
Rens edit :
  
                
                    
                         
                    
                    
                        
                            compudoc (laatste wijziging 03/03/2007 17:07)                             
                         
                     
                    
                        PHP beginner bijvoorbeeld regel 8, wat is $submit 
                      
                
                    
                         
                    
                    
                        
                            rikske                             
                         
                     
                    
                        Nieuw lid waar kan ik het volledig script plaatsen? 
                      
                
                    
                         
                    
                    
                        
                            compudoc                             
                         
                     
                    
                        PHP beginner op plaatscode.be (laatste icoontje in het typvakje bij reactie) 
                      
                
                    
                         
                    
                    
                        
                            rikske                             
                         
                     
                    
                        Nieuw lid kan je mijn code op http://plaatscode.be/4475 / eens in deze zin aanpassen want ik ben volledig in de mist nu. Sorry hoor 
                      
                
                    
                         
                    
                    
                        
                            compudoc                             
                         
                     
                    
                        PHP beginner hij bedoelt gewoon dat je ipv $submit, $_POST['submit'] moet gebruiken 
                      
                
                    
                         
                    
                    
                        
                            rikske                             
                         
                     
                    
                        Nieuw lid nu krijg ik een parse error 
                      
                
                    
                         
                    
                    
                        
                            rikske (laatste wijziging 03/03/2007 18:12)                             
                         
                     
                    
                        Nieuw lid 
    
    
        
            
                <?
include ("header.inc.php");
?>
 <h1>Edit / add address book entry</h1> 
  <?php
include("dbconnect.php");
if $_POST['submit']
{
$sql = "INSERT INTO $table (firstname, lastname, address, home, mobile, work, email, email2, bday, bmonth, byear) VALUES ('$firstname','$lastname','$address','$home','$mobile','$work','$email','$email2','$bday','$bmonth','$byear')";
$result = mysql_query($sql);
echo "<br><br>Information entered into address book.\n";
}
else if($update)
{
$sql = "UPDATE $table SET firstname='$firstname',lastname='$lastname',address='$address',home='$home',mobile='$mobile',work='$work',email='$email',email2='$email2',bday='$bday',bmonth='$bmonth',byear='$byear' WHERE id=$id";
$result = mysql_query($sql);
echo "<br><br>Address book updated.\n";
}
else if($id)
{
$result = mysql_query("SELECT * FROM $table WHERE id=$id",$db);
$myrow = mysql_fetch_array($result);
?>
  <form method="post" action="edit.php"> 
             
            <? 
include  ( "header.inc.php" ) ; 
?> 
 
 <h1>Edit / add address book entry</h1> 
  <?php 
include ( "dbconnect.php" ) ; 
if  $_POST [ 'submit' ] 
{ 
 
$sql  =  "INSERT INTO $table  (firstname, lastname, address, home, mobile, work, email, email2, bday, bmonth, byear) VALUES ('$firstname ','$lastname ','$address ','$home ','$mobile ','$work ','$email ','$email2 ','$bday ','$bmonth ','$byear ')" ; 
echo "<br><br>Information entered into address book.\n " ; } 
else  if ( $update ) 
{ 
$sql  =  "UPDATE $table  SET firstname='$firstname ',lastname='$lastname ',address='$address ',home='$home ',mobile='$mobile ',work='$work ',email='$email ',email2='$email2 ',bday='$bday ',bmonth='$bmonth ',byear='$byear ' WHERE id=$id " ; 
echo "<br><br>Address book updated.\n " ; } 
else  if ( $id ) 
{ 
$result  =  mysql_query ( "SELECT * FROM $table  WHERE id=$id " , $db ) ; ?> 
  <form method="post" action="edit.php">
 
         
     
 Citaat: 
Rens edit :
  
                
                    
                         
                    
                    
                        
                            compudoc (laatste wijziging 03/03/2007 18:12)                             
                         
                     
                    
                        PHP beginner wat heb je er dan van gemaakt?
    
    
        
            
                <?php
if($_POST['submit']) {
}
?> 
             
            <?php 
if ( $_POST [ 'submit' ] )  { 
 
} 
?> 
 
         
     
   
                      
                
                    
                         
                    
                    
                        
                            rikske                             
                         
                     
                    
                        Nieuw lid ja 
                      
                
                    
                         
                    
                    
                        
                            Stijn                             
                         
                     
                    
                        PHP expert http://plaatscode.be/4476 / -> dit zou nu geen notice meer mogen opgeven en kijk er eens naartoe en leer bij. Je ziet dat alle variablen buiten quotes staan ook. Dat moet zo!  
                
                    
                         
                    
                    
                        
                            rikske                             
                         
                     
                    
                        Nieuw lid bedankt hoor  
                      
                
                    
                         
                    
                        
		
		
	             
 
                
Dit onderwerp is gesloten .