login  Naam:   Wachtwoord: 
Registreer je!
 Forum

hulp gevraagd bij html form met een php script

Offline yakoeroe - 15/02/2012 20:22 (laatste wijziging 15/02/2012 21:21)
Avatar van yakoeroeLid beste lieve mensjes 
kan er aub iemand naar deze code kijken, ik heb reeds uren gespendeerd om het goed te krijgen maar tevergeefs.
hieronder vind zowel de hml als de php code terug.

  1. <html>
  2. <head>
  3. </head>
  4. <body>
  5. <fieldset><legend>Sollicitatie</span></legend>
  6.  
  7. <!--begin:notice message block-->
  8.  
  9. <div id="note"></div>
  10. <!--begin:notice message block-->
  11.  
  12. <form id="ajax-contact-form" method="post" ENCTYPE="multipart/form-data" action="index.php" action="javascript:alert('success!');">
  13. <center><p><font color="red">* required fields</font></p></center>
  14. <label>Function</label>
  15. <select name="Function">
  16. <option value="Worker">Worker</option>
  17. <option value="Handy Man">Handy Man</option>
  18. <option value="Cleaning lady/Cleaner">Cleaning lady/Cleaner</option>
  19. <option value="Site leader for renovation works">Site leader for renovation works</option>
  20. <option value="Administrative employee">Administrative employee</option>
  21. <option value="Crane driver">Crane driver</option>
  22. <option value="Room maids">Room maids</option>
  23. <option value="Sales Representatives">Sales Representatives</option>
  24. </select><br />
  25.  
  26. <label>Name <font color="red">*</font></label><input class="required inpt" type="text" name="name" value="" /><br />
  27. <input type="radio" name="sex" value="male" /> Male<br />
  28. <input type="radio" name="sex" value="female" /> Female<br />
  29.  
  30.  
  31. <label>Address</label><font color="red">*</font><input type="text" name="Address" value="" /><br />
  32. <label>Code Postal<font color="red">*</font></label><input class="required inpt" type="text" name="Code Postal" value="" /><br />
  33. <label>City<font color="red">*</font></label><input class="required inpt" type="text" name="city" value="" /><br />
  34. <label>Phone <font color="red">*</font></label><input class="required inpt" type="text" name="phone" value="" /><br />
  35. <label>E-Mail<font color="red">*</font></label><input class="required inpt" type="text" name="email" value="" /><br />
  36. <label>Driving license</label><font color="red">*</font><input class="required input type="text" name="Driving license" value="" /><br />
  37. <label>Experiance</label><input class="required input type="text" name="Experiance" value="" /><br />
  38. <label>Nationality</label><font color="red">*</font><input class="required input type="text" name="Nationality" value="" /><br />
  39. <label>Languages</label><font color="red">*</font><input class="required input type="text" name="Languages" value="" /><br />
  40.  
  41.  
  42.  
  43.  
  44. Curriculum Vitae <INPUT TYPE=FILE NAME="upfile"><BR>
  45. <INPUT TYPE=SUBMIT VALUE="Submit">
  46.  
  47.  
  48. </form>
  49. </body>
  50. </html>
  51.  
  52.  
  53. <?php
  54.  
  55.  
  56. // Receiving variables
  57. @$Function = addslashes($_POST['Function']);
  58. @$name = addslashes($_POST['name']);
  59. @$sex = addslashes($_POST['sex']);
  60. @$Address = addslashes($_POST['Address']);
  61. @$Code_Postal = addslashes($_POST['Code_Postal']);
  62. @$city = addslashes($_POST['city']);
  63. @$phone = addslashes($_POST['phone']);
  64. @$email = addslashes($_POST['email']);
  65. @$Driving_license = addslashes($_POST['Driving_license']);
  66. @$Experiance = addslashes($_POST['Experiance']);
  67. @$Nationality = addslashes($_POST['Nationality']);
  68. @$Languages = addslashes($_POST['Languages']);
  69. @$upfile_Name = $_FILES['upfile']['name'];
  70. @$upfile_Size = $_FILES['upfile']['size'];
  71. @$upfile_Temp = $_FILES['upfile']['tmp_name'];
  72. @$upfile_Mime_Type = $_FILES['upfile']['type'];
  73.  
  74. function RecursiveMkdir($path)
  75. {
  76. if (!file_exists($path))
  77. {
  78. RecursiveMkdir(dirname($path));
  79. mkdir($path, 0777);
  80. }
  81. }
  82.  
  83.  
  84. // Validation
  85. if ( strcasecmp($sex,"male") != 0 && strcasecmp($sex,"female") != 0 )
  86. {
  87. die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid sex</font></p>");
  88. }
  89.  
  90.  
  91. if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
  92. {
  93. die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid email</font></p>");
  94. }
  95.  
  96. if( $upfile_Size == 0)
  97. {
  98. die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid upfile</font></p>");
  99. }
  100. if( $upfile_Size >50000000)
  101. {
  102. //delete file
  103. unlink($upfile_Temp);
  104. die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid upfile</font></p>");
  105. }
  106. if( $upfile_Mime_Type != "image/gif" AND $upfile_Mime_Type != "image/pjpeg" AND $upfile_Mime_Type != "image/jpeg" AND $upfile_Mime_Type != "image/png" AND $upfile_Mime_Type != "image/tiff" AND $upfile_Mime_Type != "text/" )
  107. {
  108. unlink($upfile_Temp);
  109. die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid upfile</font></p>");
  110. }
  111. $uploadFile = $upfile_Name ;
  112. if (!is_dir(dirname($uploadFile)))
  113. {
  114. @RecursiveMkdir(dirname($uploadFile));
  115. }
  116. else
  117. {
  118. @chmod(dirname($uploadFile), 0777);
  119. }
  120. @move_uploaded_file( $upfile_Temp , $uploadFile);
  121. chmod($uploadFile, 0644);
  122. $upfile_URL = "http://www.orisma.com.tr/uplfile/".$upfile_Name ;
  123.  
  124. //Sending Email to form owner
  125. $pfw_header = "From: $email\n"
  126. . "Reply-To: $email\n";
  127. $pfw_subject = "Curriculum Vitae";
  128. $pfw_email_to = "info@orisma.com.tr";
  129. $pfw_message = "Function: $Function\n"
  130. . "name: $name\n"
  131. . "sex: $sex\n"
  132. . "Address: $Address\n"
  133. . "Code_Postal: $Code_Postal\n"
  134. . "city: $city\n"
  135. . "phone: $phone\n"
  136. . "email: $email\n"
  137. . "Driving_license: $Driving_license\n"
  138. . "Experiance: $Experiance\n"
  139. . "Nationality: $Nationality\n"
  140. . "Languages: $Languages\n"
  141. . "upfile: $upfile_URL\n";
  142. @mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
  143.  
  144. echo("<p align='center'><font face='Arial' size='3' color='#FF0000'>Thank you, we have received your message</font></p>");
  145. ?>

1 antwoord

Gesponsorde links
Offline Stijn - 15/02/2012 21:22
Avatar van Stijn PHP expert En wat gaat er exact fout? Trouwens, gooi die @-tekens eens weg of de php community komt je in elkaar slaan .
Gesponsorde links
Je moet ingelogd zijn om een reactie te kunnen posten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.227s