Hulp gevraagd voor het verzenden van een form

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Pagina: « vorige 1 2

Obelix Idefix

Obelix Idefix

16/02/2012 19:26:50
Quote Anchor link
Zie nog steeds @ in de code staan.
 
PHP hulp

PHP hulp

25/11/2024 07:48:12
 
- Jim  -

- Jim -

16/02/2012 22:46:22
Quote Anchor link
Obelix en Idefix op 16/02/2012 19:26:50:
Zie nog steeds @ in de code staan.


ik ook,... :p

Je kunt ook delen van de code uitschakelen om de fout daarmee uit te kunnen schakelen, en steeds een klein stukje meer inschakelen. Dan komt op een gegeven moment de fout weer 'boven-drijven', en weet je waar het in zit.
Het is zo te zien ook een 50x-error (server error).

note: het is misschien handig als je in je eerste topic de code steeds aanpast. Dat scheelt een hoop vergelijken, scrollen en zoeken naar welke code je als laatst gebruikt.
 
Fouad El Amrani

Fouad El Amrani

29/03/2012 01:51:53
Quote Anchor link
Dank aan iedereen die mij heeft willen helpen maar ik denk dat ik jullie op een verkeerd spoor heb gebracht, maar heb het gevonden :-)
Het werkt zelfs met de @tjes en ereg(), het was de dir waar ik naar verwees die niet klopte en daarmee deze ook niet vond, vandaar die error.

Maar heb nu en andere probleempje, heb de volgende code die werkt maar had het graag anders gehad.
1 include werkt eigenlijk niet echt mooi (de header in de webpagina verdwijnt)
2 de errors en het bericht met daarin " uw bericht werd verzonden"had ik graag
in een kadertje of zo afgebeeld of zoiets...
heeft er iemand suggesties
ALvast bedankt!

<fieldset><legend>Form <span></span></legend>

<form enctype="multipart/form-data" action="index5.php" method="post">


<p>
<label>Function</label>

<select name="Function">
<option value="Worker">Worker</option>
<option value="Handy Man">Handy Man</option>
<option value="Cleaning lady/Cleaner">Cleaning lady/Cleaner</option>
<option value="Site leader for renovation works">Site leader for renovation works</option>
<option value="Administrative employee">Administrative employee</option>
<option value="Crane driver">Crane driver</option>
<option value="Room maids">Room maids</option>
<option value="Sales Representatives">Sales Representatives</option>
</select>
</p>
<p>
<label>Sex</label>
<select name="Sex">
<option value="Male">Male</option>
<option value="Female">Female</option>
</select>
</p>
<p>
<label>Date of birth <font color="red">*</font></label>
<select name="Date Of Birth_Month">
<option> - Month - </option>
<option value="January">January</option>
<option value="Febuary">Febuary</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="July">July</option>
<option value="August">August</option>
<option value="September">September</option>
<option value="October">October</option>
<option value="November">November</option>
<option value="December">December</option>
</select>

<select name="Date Of Birth_Day">
<option> - Day - </option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>

<select name="Date Of Birth_Year">
<option> - Year - </option>
<option value="2004">2004</option>
<option value="2003">2003</option>
<option value="2002">2002</option>
<option value="2001">2001</option>
<option value="2000">2000</option>
<option value="1999">1999</option>
<option value="1998">1998</option>
<option value="1997">1997</option>
<option value="1996">1996</option>
<option value="1995">1995</option>
<option value="1994">1994</option>
<option value="1993">1993</option>
<option value="1992">1992</option>
<option value="1991">1991</option>
<option value="1990">1990</option>
<option value="1989">1989</option>
<option value="1988">1988</option>
<option value="1987">1987</option>
<option value="1986">1986</option>
<option value="1985">1985</option>
<option value="1984">1984</option>
<option value="1983">1983</option>
<option value="1982">1982</option>
<option value="1981">1981</option>
<option value="1980">1980</option>
<option value="1979">1979</option>
<option value="1978">1978</option>
<option value="1977">1977</option>
<option value="1976">1976</option>
<option value="1975">1975</option>
<option value="1974">1974</option>
<option value="1973">1973</option>
<option value="1972">1972</option>
<option value="1971">1971</option>
<option value="1970">1970</option>
<option value="1969">1969</option>
<option value="1968">1968</option>
<option value="1967">1967</option>
<option value="1966">1966</option>
<option value="1965">1965</option>
<option value="1964">1964</option>
<option value="1963">1963</option>
<option value="1962">1962</option>
<option value="1961">1961</option>
<option value="1960">1960</option>
<option value="1959">1959</option>
<option value="1958">1958</option>
<option value="1957">1957</option>
<option value="1956">1956</option>
<option value="1955">1955</option>
<option value="1954">1954</option>
<option value="1953">1953</option>
<option value="1952">1952</option>
<option value="1951">1951</option>
<option value="1950">1950</option>
<option value="1949">1949</option>
<option value="1948">1948</option>
<option value="1947">1947</option>
<option value="1946">1946</option>
<option value="1945">1945</option>
<option value="1944">1944</option>
<option value="1943">1943</option>
<option value="1942">1942</option>
<option value="1941">1941</option>
<option value="1940">1940</option>
<option value="1939">1939</option>
<option value="1938">1938</option>
<option value="1937">1937</option>
<option value="1936">1936</option>
<option value="1935">1935</option>
<option value="1934">1934</option>
<option value="1933">1933</option>
<option value="1932">1932</option>
<option value="1931">1931</option>
<option value="1930">1930</option>
<option value="1929">1929</option>
<option value="1928">1928</option>
<option value="1927">1927</option>
<option value="1926">1926</option>
<option value="1925">1925</option>
<option value="1924">1924</option>
<option value="1923">1923</option>
<option value="1922">1922</option>
<option value="1921">1921</option>
<option value="1920">1920</option>
<option value="1919">1919</option>
<option value="1918">1918</option>
<option value="1917">1917</option>
<option value="1916">1916</option>
<option value="1915">1915</option>
<option value="1914">1914</option>
<option value="1913">1913</option>
<option value="1912">1912</option>
<option value="1911">1911</option>
<option value="1910">1910</option>
<option value="1909">1909</option>
<option value="1908">1908</option>
<option value="1907">1907</option>
<option value="1906">1906</option>
<option value="1905">1905</option>
<option value="1904">1904</option>
<option value="1903">1903</option>
<option value="1902">1902</option>
<option value="1901">1901</option>
<option value="1900">1900</option>
</select>
</p>

<label>Name <font color="red">*</font></label><input class="required inpt" type="text" name="name" value="" /><br /><br />


<label>Address<font color="red">*</font></label>

<input type="text" name="Address" value="" />
<br>
<label>Code Postal<font color="red">*</font></label>

<input class="required inpt" type="text" name="Code Postal" value="" />
<br>
<label>City<font color="red">*</font></label>

<input class="required inpt" type="text" name="city" value="" />
<br>
<label>Phone <font color="red">*</font></label>

<input class="required inpt" type="text" name="phone" value="" />
<br>
<label>E-Mail<font color="red">*</font></label>

<input class="required inpt" type="text" name="email" value="" />
<br>
<label>Driving license<font color="red">*</font></label>

<input class="required input" type="text" name="Driving license" value="" />
<br>
<label>Experiance<font color="red">*</font></label>

<input class="required input" type="text" name="Experiance" value="" />
<br>


<label>Nationality<font color="red">*</font></label>

<input class="required" input type="text" name="Nationality" value="" />
<br>
<label>Languages<font color="red">*</font></label>

<input class="required input" type="text" name="Languages" value="" />
<br>

<label>Curriculum Vitae</label>

<INPUT TYPE=FILE NAME="upfile"><BR>
<br>
<INPUT TYPE=SUBMIT VALUE="Submit">




</form>
</fieldset>



Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<?php
ini_set('display_errors', 1); // 0 = uit, 1 = aan
error_reporting(E_ALL);


include("application form.htm");
// Receiving variables
@$Function = addslashes($_POST['Function']);
@
$Sex = addslashes($_POST['Sex']);
@
$Date_Of_Birth_Month = addslashes($_POST['Date_Of_Birth_Month']);
@
$Date_Of_Birth_Day = addslashes($_POST['Date_Of_Birth_Day']);
@
$Date_Of_Birth_Year = addslashes($_POST['Date_Of_Birth_Year']);
@
$name = addslashes($_POST['name']);
@
$Address = addslashes($_POST['Address']);
@
$Code_Postal = addslashes($_POST['Code_Postal']);
@
$city = addslashes($_POST['city']);
@
$phone = addslashes($_POST['phone']);
@
$email = addslashes($_POST['email']);
@
$Driving_license = addslashes($_POST['Driving_license']);
@
$Experiance = addslashes($_POST['Experiance']);
@
$Nationality = addslashes($_POST['Nationality']);
@
$Languages = addslashes($_POST['Languages']);
@
$upfile_Name = $_FILES['upfile']['name'];
@
$upfile_Size = $_FILES['upfile']['size'];
@
$upfile_Temp = $_FILES['upfile']['tmp_name'];
@
$upfile_Mime_Type = $_FILES['upfile']['type'];

function
RecursiveMkdir($path)
 {

   if (!file_exists($path))
   {

      RecursiveMkdir(dirname($path));
      mkdir($path, 0777);
    }
  }



// Validation
if ( strcasecmp($Function,"Worker") != 0 && strcasecmp($Function,"Handy Man") != 0 && strcasecmp($Function,"Cleaning lady/Cleaner") != 0 && strcasecmp($Function,"Site leader for renovation works") != 0 && strcasecmp($Function,"Administrative employee") != 0 && strcasecmp($Function,"Crane driver") != 0 && strcasecmp($Function,"Room maids") != 0 && strcasecmp($Function,"Sales Representatives") != 0 )
{

die("<p align='center'><font face='Arial' size='5' color='#FF0000'>Please enter a valid function</font></p>");
}


if (strlen($Function) == 0 )
{

die("<p align='center'><font face='Arial' size='5' color='#FF0000'>Please enter a valid function</font></p>");
}


if ( strcasecmp($Sex,"Male") != 0 && strcasecmp($Sex,"Female") != 0 )
{

die("<p align='center'><font face='Arial' size='5' color='#FF0000'>Please enter a valid sex</font></p>");
}


if (strlen($Sex) == 0 )
{

die("<p align='center'><font face='Arial' size='5' color='#FF0000'>Please enter a valid sex</font></p>");
}


if ( strcasecmp($Date_Of_Birth_Month,"January") != 0 && strcasecmp($Date_Of_Birth_Month,"Febuary") != 0 && strcasecmp($Date_Of_Birth_Month,"March") != 0 && strcasecmp($Date_Of_Birth_Month,"April") != 0 && strcasecmp($Date_Of_Birth_Month,"May") != 0 && strcasecmp($Date_Of_Birth_Month,"June") != 0 && strcasecmp($Date_Of_Birth_Month,"July") != 0 && strcasecmp($Date_Of_Birth_Month,"August") != 0 && strcasecmp($Date_Of_Birth_Month,"September") != 0 && strcasecmp($Date_Of_Birth_Month,"October") != 0 && strcasecmp($Date_Of_Birth_Month,"November") != 0 && strcasecmp($Date_Of_Birth_Month,"December") != 0 )
{

die("<p align='center'><font face='Arial' size='5' color='#FF0000'>Please enter a valid date of birth </font></p>");
}


if (strlen($Date_Of_Birth_Month) == 0 )
{

die("<p align='center'><font face='Arial' size='5' color='#FF0000'>Please enter a valid date of birth </font></p>");
}


if ( strcasecmp($Date_Of_Birth_Day,"1") != 0 && strcasecmp($Date_Of_Birth_Day,"2") != 0 && strcasecmp($Date_Of_Birth_Day,"3") != 0 && strcasecmp($Date_Of_Birth_Day,"4") != 0 && strcasecmp($Date_Of_Birth_Day,"5") != 0 && strcasecmp($Date_Of_Birth_Day,"6") != 0 && strcasecmp($Date_Of_Birth_Day,"7") != 0 && strcasecmp($Date_Of_Birth_Day,"8") != 0 && strcasecmp($Date_Of_Birth_Day,"9") != 0 && strcasecmp($Date_Of_Birth_Day,"10") != 0 && strcasecmp($Date_Of_Birth_Day,"11") != 0 && strcasecmp($Date_Of_Birth_Day,"12") != 0 && strcasecmp($Date_Of_Birth_Day,"13") != 0 && strcasecmp($Date_Of_Birth_Day,"14") != 0 && strcasecmp($Date_Of_Birth_Day,"15") != 0 && strcasecmp($Date_Of_Birth_Day,"16") != 0 && strcasecmp($Date_Of_Birth_Day,"17") != 0 && strcasecmp($Date_Of_Birth_Day,"18") != 0 && strcasecmp($Date_Of_Birth_Day,"19") != 0 && strcasecmp($Date_Of_Birth_Day,"20") != 0 && strcasecmp($Date_Of_Birth_Day,"21") != 0 && strcasecmp($Date_Of_Birth_Day,"22") != 0 && strcasecmp($Date_Of_Birth_Day,"23") != 0 && strcasecmp($Date_Of_Birth_Day,"24") != 0 && strcasecmp($Date_Of_Birth_Day,"25") != 0 && strcasecmp($Date_Of_Birth_Day,"26") != 0 && strcasecmp($Date_Of_Birth_Day,"27") != 0 && strcasecmp($Date_Of_Birth_Day,"28") != 0 && strcasecmp($Date_Of_Birth_Day,"29") != 0 && strcasecmp($Date_Of_Birth_Day,"30") != 0 && strcasecmp($Date_Of_Birth_Day,"31") != 0 )
{

die("<p align='center'><font face='Arial' size='5' color='#FF0000'>Please enter a valid date of birth</font></p>");
}


if (strlen($Date_Of_Birth_Day) == 0 )
{

die("<p align='center'><font face='Arial' size='5' color='#FF0000'>Please enter a valid date of birth</font></p>");
}



if (strlen($name) == 0 )
{

die("<p align='center'><font face='Arial' size='5' color='#FF0000'>Please enter a valid name</font></p>");
}



if (strlen($Address) == 0 )
{

die("<p align='center'><font face='Arial' size='5' color='#FF0000'>Please enter a valid address</font></p>");
}



if (strlen($Code_Postal) == 0 )
{

die("<p align='center'><font face='Arial' size='5' color='#FF0000'>Please enter a valid code_postal</font></p>");
}



if (strlen($city) == 0 )
{

die("<p align='center'><font face='Arial' size='5' color='#FF0000'>Please enter a valid city</font></p>");
}



if (strlen($phone) == 0 )
{

die("<p align='center'><font face='Arial' size='5' color='#FF0000'>Please enter a valid phone</font></p>");
}


if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
{

die("<p align='center'><font face='Arial' size='5' color='#FF0000'>Please enter a valid email</font></p>");
}


if (strlen($email) == 0 )
{

die("<p align='center'><font face='Arial' size='5' color='#FF0000'>Please enter a valid email</font></p>");
}



if (strlen($Driving_license) == 0 )
{

die("<p align='center'><font face='Arial' size='5' color='#FF0000'>Please enter a valid driving_license</font></p>");
}



if (strlen($Experiance) == 0 )
{

die("<p align='center'><font face='Arial' size='5' color='#FF0000'>Please enter a valid experiance</font></p>");
}



if (strlen($Nationality) == 0 )
{

die("<p align='center'><font face='Arial' size='5' color='#FF0000'>Please enter a valid nationality</font></p>");
}



if( $upfile_Size == 0)
{

die("<p align='center'><font face='Arial' size='5' color='#FF0000'>Please enter a valid CV</font></p>");
}

if( $upfile_Size >2000000)
{

//delete file
unlink($upfile_Temp);
die("<p align='center'><font face='Arial' size='5' color='#FF0000'>Please enter a valid CV</font></p>");
}

if( $upfile_Mime_Type != "application/msword" AND $upfile_Mime_Type != "application/pdf" AND $upfile_Mime_Type != "application/rtf" AND $upfile_Mime_Type != "application/vnd.ms-artgalry" AND $upfile_Mime_Type != "application/vnd.ms-asf" AND $upfile_Mime_Type != "application/vnd.ms-excel" AND $upfile_Mime_Type != "application/vnd.ms-lrm" AND $upfile_Mime_Type != "application/vnd.ms-powerpoint" AND $upfile_Mime_Type != "application/vnd.ms-project" AND $upfile_Mime_Type != "application/vnd.ms-tnef" AND $upfile_Mime_Type != "application/vnd.ms-works" AND $upfile_Mime_Type != "application/vnd.mseq" AND $upfile_Mime_Type != "application/vnd.msign" AND $upfile_Mime_Type != "application/xml" AND $upfile_Mime_Type != "application/xml-dtd" AND $upfile_Mime_Type != "application/xml-external-parsed-entity" AND $upfile_Mime_Type != "application/zip" AND $upfile_Mime_Type != "audio/32kadpcm" AND $upfile_Mime_Type != "audio/basic" AND $upfile_Mime_Type != "audio/DAT12" AND $upfile_Mime_Type != "audio/G.722.1" AND $upfile_Mime_Type != "audio/L16" AND $upfile_Mime_Type != "audio/L20" AND $upfile_Mime_Type != "audio/L24" AND $upfile_Mime_Type != "audio/MP4A-LATM" AND $upfile_Mime_Type != "audio/mpa-robust" AND $upfile_Mime_Type != "audio/mpeg" AND $upfile_Mime_Type != "audio/parityfec" AND $upfile_Mime_Type != "audio/prs.sid" AND $upfile_Mime_Type != "audio/telephone-event" AND $upfile_Mime_Type != "audio/tone" AND $upfile_Mime_Type != "audio/vnd.cisco.nse" AND $upfile_Mime_Type != "audio/vnd.cns.anp1" AND $upfile_Mime_Type != "audio/vnd.cns.inf1" AND $upfile_Mime_Type != "audio/vnd.digital-winds" AND $upfile_Mime_Type != "audio/vnd.everad.plj" AND $upfile_Mime_Type != "audio/vnd.lucent.voice" AND $upfile_Mime_Type != "audio/vnd.nortel.vbk" AND $upfile_Mime_Type != "audio/vnd.nuera.ecelp4800" AND $upfile_Mime_Type != "audio/vnd.nuera.ecelp7470" AND $upfile_Mime_Type != "audio/vnd.nuera.ecelp9600" AND $upfile_Mime_Type != "audio/vnd.octel.sbc" AND $upfile_Mime_Type != "audio/vnd.qcelp" AND $upfile_Mime_Type != "audio/vnd.rhetorex.32kadpcm" AND $upfile_Mime_Type != "audio/vnd.vmx.cvsd" AND $upfile_Mime_Type != "image/cgm" AND $upfile_Mime_Type != "image/g3fax" AND $upfile_Mime_Type != "image/gif" AND $upfile_Mime_Type != "image/ief" AND $upfile_Mime_Type != "image/pjpeg" AND $upfile_Mime_Type != "image/jpeg" AND $upfile_Mime_Type != "image/naplps" AND $upfile_Mime_Type != "image/png" AND $upfile_Mime_Type != "image/prs.btif" AND $upfile_Mime_Type != "image/prs.pti" AND $upfile_Mime_Type != "image/tiff" AND $upfile_Mime_Type != "image/vnd.cns.inf2" AND $upfile_Mime_Type != "image/vnd.dwg" AND $upfile_Mime_Type != "image/vnd.dxf" AND $upfile_Mime_Type != "image/vnd.fastbidsheet" AND $upfile_Mime_Type != "image/vnd.fpx" AND $upfile_Mime_Type != "image/vnd.fst" AND $upfile_Mime_Type != "image/vnd.fujixerox.edmics-mmr" AND $upfile_Mime_Type != "image/vnd.fujixerox.edmics-rlc" AND $upfile_Mime_Type != "image/vnd.mix" AND $upfile_Mime_Type != "image/vnd.net-fpx" AND $upfile_Mime_Type != "image/vnd.svf" AND $upfile_Mime_Type != "image/vnd.wap.wbmp" AND $upfile_Mime_Type != "image/vnd.xiff" AND $upfile_Mime_Type != "text/" AND $upfile_Mime_Type != "text/calendar" AND $upfile_Mime_Type != "text/css" AND $upfile_Mime_Type != "text/directory" AND $upfile_Mime_Type != "text/enriched" AND $upfile_Mime_Type != "text/html" AND $upfile_Mime_Type != "text/parityfec" AND $upfile_Mime_Type != "text/plain" AND $upfile_Mime_Type != "text/prs.lines.tag" AND $upfile_Mime_Type != "text/rfc822-headers" AND $upfile_Mime_Type != "text/richtext" AND $upfile_Mime_Type != "text/rtf" AND $upfile_Mime_Type != "text/sgml" AND $upfile_Mime_Type != "text/t140" AND $upfile_Mime_Type != "text/tab-separated-values" AND $upfile_Mime_Type != "text/uri-list" AND $upfile_Mime_Type != "text/vnd.abc" AND $upfile_Mime_Type != "text/vnd.curl" AND $upfile_Mime_Type != "text/vnd.DMClientScript" AND $upfile_Mime_Type != "text/vnd.fly" AND $upfile_Mime_Type != "text/vnd.fmi.flexstor" AND $upfile_Mime_Type != "text/vnd.in3d.3dml" AND $upfile_Mime_Type != "text/vnd.in3d.spot" AND $upfile_Mime_Type != "text/vnd.IPTC.NewsML" AND $upfile_Mime_Type != "text/vnd.IPTC.NITF" AND $upfile_Mime_Type != "text/vnd.latex-z" AND $upfile_Mime_Type != "text/vnd.motorola.reflex" AND $upfile_Mime_Type != "text/vnd.ms-mediapackage" AND $upfile_Mime_Type != "text/vnd.wap.si" AND $upfile_Mime_Type != "text/vnd.wap.sl" AND $upfile_Mime_Type != "text/vnd.wap.wml" AND $upfile_Mime_Type != "text/vnd.wap.wmlscript" AND $upfile_Mime_Type != "text/xml" AND $upfile_Mime_Type != "text/xml-external-parsed-entity" AND $upfile_Mime_Type != "video/MP4V-ES" AND $upfile_Mime_Type != "video/mpeg" AND $upfile_Mime_Type != "video/vnd.mpegurl" AND $upfile_Mime_Type != "video/vnd.nokia.interleaved-multimedia" AND $upfile_Mime_Type != "video/vnd.vivo" )
{

unlink($upfile_Temp);
die("<p align='center'><font face='Arial' size='5' color='#FF0000'>Please enter a valid CV</font></p>");
}

$uploadFile = "uplfile/".$upfile_Name ;
if (!is_dir(dirname($uploadFile)))
  {
    @
RecursiveMkdir(dirname($uploadFile));
  }

else
  {
  @
chmod(dirname($uploadFile), 0777);
  }
@
move_uploaded_file( $upfile_Temp , $uploadFile);
chmod($uploadFile, 0644);
$upfile_URL = "http://http://orisma.com.tr/sol.eng/uplfile/".$upfile_Name ;

//Sending Email to form owner
$pfw_header = "From: $email\n"
  . "Reply-To: $email\n";
$pfw_subject = "Sollicitatie";
$pfw_email_to = "[email protected]";
$pfw_message = "Function: $Function\n"
. "Sex: $Sex\n"
. "Date_Of_Birth: $Date_Of_Birth_Month / $Date_Of_Birth_Day /  $Date_Of_Birth_Year\n"
. "\n"
. "name: $name\n"
. "Address: $Address\n"
. "Code_Postal: $Code_Postal\n"
. "city: $city\n"
. "phone: $phone\n"
. "email: $email\n"
. "Driving_license: $Driving_license\n"
. "Experiance: $Experiance\n"
. "Nationality: $Nationality\n"
. "Languages: $Languages\n"
. "upfile: $upfile_URL\n";
@
mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;

 echo("<p align='center'><font face='Arial' size='5' color='#FF0000'>successfully sent</font></p>");
 include("application form.htm");
?>
 
- SanThe -

- SanThe -

29/03/2012 05:13:44
Quote Anchor link
- SanThe - op 15/02/2012 12:54:42:
Haal al die @-jes weg.


Blijkbaar vat jij dit op als: Zet er nog meer @-jes in.
 
Albert de Wit

Albert de Wit

29/03/2012 08:58:16
Quote Anchor link
waarom niet

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php

echo "<select name='Date Of Birth_Day'>
      <option> - Day - </option>"
;
for ($i=1;$i<32;$i++)
{

  echo "<option value='".$i."'>".$i."</option>";
}

echo "</select>";


$date = date("Y");
echo "<select name='Date Of Birth_Year'>
      <option> - Year - </option>"
;
for ($i=$date;$i>1900;$i--)
{

  echo "<option value='".$i."'>".$i."</option>";
}

echo "</select>";
?>


IPV (scheelt je 123 regeltjes)

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<select name="Date Of Birth_Day">
<option> - Day - </option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>

<select name="Date Of Birth_Year">
<option> - Year - </option>
<option value="2004">2004</option>
<option value="2003">2003</option>
<option value="2002">2002</option>
<option value="2001">2001</option>
<option value="2000">2000</option>
<option value="1999">1999</option>
<option value="1998">1998</option>
<option value="1997">1997</option>
<option value="1996">1996</option>
<option value="1995">1995</option>
<option value="1994">1994</option>
<option value="1993">1993</option>
<option value="1992">1992</option>
<option value="1991">1991</option>
<option value="1990">1990</option>
<option value="1989">1989</option>
<option value="1988">1988</option>
<option value="1987">1987</option>
<option value="1986">1986</option>
<option value="1985">1985</option>
<option value="1984">1984</option>
<option value="1983">1983</option>
<option value="1982">1982</option>
<option value="1981">1981</option>
<option value="1980">1980</option>
<option value="1979">1979</option>
<option value="1978">1978</option>
<option value="1977">1977</option>
<option value="1976">1976</option>
<option value="1975">1975</option>
<option value="1974">1974</option>
<option value="1973">1973</option>
<option value="1972">1972</option>
<option value="1971">1971</option>
<option value="1970">1970</option>
<option value="1969">1969</option>
<option value="1968">1968</option>
<option value="1967">1967</option>
<option value="1966">1966</option>
<option value="1965">1965</option>
<option value="1964">1964</option>
<option value="1963">1963</option>
<option value="1962">1962</option>
<option value="1961">1961</option>
<option value="1960">1960</option>
<option value="1959">1959</option>
<option value="1958">1958</option>
<option value="1957">1957</option>
<option value="1956">1956</option>
<option value="1955">1955</option>
<option value="1954">1954</option>
<option value="1953">1953</option>
<option value="1952">1952</option>
<option value="1951">1951</option>
<option value="1950">1950</option>
<option value="1949">1949</option>
<option value="1948">1948</option>
<option value="1947">1947</option>
<option value="1946">1946</option>
<option value="1945">1945</option>
<option value="1944">1944</option>
<option value="1943">1943</option>
<option value="1942">1942</option>
<option value="1941">1941</option>
<option value="1940">1940</option>
<option value="1939">1939</option>
<option value="1938">1938</option>
<option value="1937">1937</option>
<option value="1936">1936</option>
<option value="1935">1935</option>
<option value="1934">1934</option>
<option value="1933">1933</option>
<option value="1932">1932</option>
<option value="1931">1931</option>
<option value="1930">1930</option>
<option value="1929">1929</option>
<option value="1928">1928</option>
<option value="1927">1927</option>
<option value="1926">1926</option>
<option value="1925">1925</option>
<option value="1924">1924</option>
<option value="1923">1923</option>
<option value="1922">1922</option>
<option value="1921">1921</option>
<option value="1920">1920</option>
<option value="1919">1919</option>
<option value="1918">1918</option>
<option value="1917">1917</option>
<option value="1916">1916</option>
<option value="1915">1915</option>
<option value="1914">1914</option>
<option value="1913">1913</option>
<option value="1912">1912</option>
<option value="1911">1911</option>
<option value="1910">1910</option>
<option value="1909">1909</option>
<option value="1908">1908</option>
<option value="1907">1907</option>
<option value="1906">1906</option>
<option value="1905">1905</option>
<option value="1904">1904</option>
<option value="1903">1903</option>
<option value="1902">1902</option>
<option value="1901">1901</option>
<option value="1900">1900</option>
</select>
Gewijzigd op 29/03/2012 09:44:25 door Albert de Wit
 
- Ariën  -
Beheerder

- Ariën -

29/03/2012 09:41:04
Quote Anchor link
vergeet de quotes niet te escapen op lijn 3, Albert ;-)
 
Albert de Wit

Albert de Wit

29/03/2012 09:44:40
Quote Anchor link
aangepast ;)
 
Fouad El Amrani

Fouad El Amrani

29/03/2012 17:21:34
Quote Anchor link
verandert het dan wat wanneer ik de @tjes weglaat?
Mijn form werkt en wordt wel verstuurd maar ik had graag wanneer ik het bedankberichtje of de berichtjes van de verplichte velden in een venstertje afgebeeld.
Dit zonder de form te verlaten.
iemand suggesties?

Toevoeging op 29/03/2012 17:22:42:

THX Albert hou ik voor de volgende;-)
 
Jeroen VD

Jeroen VD

29/03/2012 18:02:16
Quote Anchor link
nog een opmerking albert:
het moet zo:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
<?php
echo '<select name="Date Of Birth_Day"><option> - Day - </option>';
?>

uitleg
Gewijzigd op 29/03/2012 18:05:54 door Jeroen VD
 
Fouad El Amrani

Fouad El Amrani

29/03/2012 18:08:35
Quote Anchor link
Jeroen, Heb jij een idee hoe ik de berichtjes in een venstertje kan afbeelden en men op het formulier blijft?
 
Jeroen VD

Jeroen VD

29/03/2012 18:10:26
Quote Anchor link
nee. ik heb namelijk geen idee wat je bedoelt. leg het eens uit in proces: als ik dit doe, dan wil ik dat er dat gebeurt etc.
Gewijzigd op 29/03/2012 18:10:51 door Jeroen VD
 
Fouad El Amrani

Fouad El Amrani

29/03/2012 18:15:20
Quote Anchor link
wanneer je een formulier moet invullen met verplichte velden, en je niet alles invult krijg je toch een berichtje met daarin bv "vul aub uw naam in" of " vul een geldig e-mail adres in ".
Nu, die berichtjes werken wel maar worden dan op een blanco pagina afgebeeld dan moet je dan als user op de terug toets drukken om terug te keren naar de website of pagina.
Ik had dan graag al die berichtjes die je zou kunnen krijgen in een klein venstertje zodat je nog op de pagina van het formulier blijft.

Toevoeging op 29/03/2012 18:18:46:

oeps .... niet in proces dus
ik vul het form in en vergeet bv de naam in te vullen ( naam verplichte veld)
dan krijg ik een bericht (gelieve uw naam in te vullen)
dit berichtje wordt op een blanco pagina afgebeeld.
ik had graag op de pagina gebleven en het bericht in een appart venstertje.
is dat iets duidelijker?
 
Jeroen VD

Jeroen VD

29/03/2012 18:36:29
Quote Anchor link
javascript is daarvoor de oplossing. maar dat weet ik niet, hoe dat moet
 
Fouad El Amrani

Fouad El Amrani

29/03/2012 18:45:19
Quote Anchor link
ok thx
 
Fouad El Amrani

Fouad El Amrani

01/04/2012 02:28:57
Quote Anchor link
hallo,
ben er nog niet uit... voor diegene die zich geroepen voelen om hun hersenen te pijnigen :-)
ik ben volledig met een andere script begonnen om zo weer van een propere lei te beginnen
wat betreft de berichten, die heb ik kunnen oplossen, maar nu krijg ik problemen met de upload file
Ik heb die nu volledig uit mijn script gehaald .
iemand een idee hoe ik dit moet aanpakken

stukje uit html:

<label>Name <font color="red">*</font></label><input class="required inpt" type="text" name="name" value="" /><br />
<label>Adres<font color="red">*</font></label><input class="required inpt" type="text" name="adres" value="" /><br />
<label>Number<font color="red">*</font></label><input class="required inpt" type="text" name="number" value="" /><br />
<label>Postal code<font color="red">*</font></label><input class="required inpt" type="text" name="postalcode" value="" /><br />
<label>City<font color="red">*</font></label><input class="required inpt" type="text" name="city" value="" /><br />
<label>Phone <font color="red">*</font></label><input class="required inpt" type="text" name="phone" value="" /><br />
<label>E-Mail<font color="red">*</font></label><input class="required inpt" type="text" name="email" value="" /><br />
<label>Driving license<font color="red">*</font></label><input class="required input" type="text" name="Drivinglicense" value="" /><br />
<label>Experiance<font color="red">*</font></label><textarea class="textbox" name="Experiance" rows="6" cols="30"></textarea><br />
<label>Nationality<font color="red">*</font></label><input class="required" input type="text" name="Nationality" value="" /><br>
<label>Languages<font color="red">*</font></label><input class="required input" type="text" name="Languages" value="" /><br>

<label>Curriculum Vitae</label><input type="file" name="upfile" ><BR><br>
<label id="load"></label><BUTTON TYPE="submit" name='submit' value='sumbit'> Send</button>

php script

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?php


error_reporting (E_ALL ^ E_NOTICE);
$post = (!empty($_POST)) ? true : false;
include 'contactsetting.php';
if($post)
    {
    function
ValidateEmail($email)
    {


$regex = "([a-z0-9_\.\-]+)".

"@".

"([a-z0-9\.\-]+){2,255}".

"\.".

"([a-z]+){2,10}";

$eregi = eregi_replace($regex, '', $email);

return empty($eregi) ? true : false;
}

$upfile= stripslashes($_POST['upfile']);
$Function = stripslashes($_POST['Function']);
$Sex = stripslashes($_POST['Sex']);
$Date_Of_Birth_Month = stripslashes($_POST['Date_Of_Birth_Month']);
$Date_Of_Birth_Day = stripslashes($_POST['Date_Of_Birth_Day']);
$Date_Of_Birth_Year = stripslashes($_POST['Date_Of_Birth_Year']);
$Drivinglicense = stripslashes($_POST['Drivinglicense']);
$Nationality = stripslashes($_POST['Nationality']);
$Languages = stripslashes($_POST['Languages']);
$name = stripslashes($_POST['name']);
$email = trim($_POST['email']);
$subject = stripslashes($_POST['subject']);
$Experiance = stripslashes($_POST['Experiance']);
$phone = stripslashes($_POST['phone']);
$adres = stripslashes($_POST['adres']);
$number = stripslashes($_POST['number']);
$postalcode = stripslashes($_POST['postalcode']);
$city = stripslashes($_POST['city']);
$answer = trim($_POST['answer']);
$verificationanswer="4"; //
$to=$toemail.','.$replyto;
$error = '';
$headers="";
$headers.="Reply-to:$replyto\n";
$headers .= "From: $email\n";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers = "Content-Type: text/html; charset=iso-8859-1\n".$headers;




if(!$name)
{

$error .= 'Please enter your name.<br />';
}

if(!$adres)
{

$error .= 'Please enter your addres.<br />';
}

 if(!$number)
{

$error .= 'Please enter your number.<br />';
}

 if(!$postalcode)
{

$error .= 'Please enter your postal code.<br />';
}

if(!$city)
{

$error .= 'Please enter your city.<br />';
}

if(is_numeric($phone))
    {

        
if(!$phone || strlen($phone) < 8)
{

$error .= "Please enter your phone number<br />";
}


    }

    else
    {
       $error .="Please enter a correct phone number<br />";
    }

  



if(!$email)
{

$error .= 'Please enter your E-mail addres.<br />';
}


if($email && !ValidateEmail($email))
{

$error .= 'Your e-mail addres is not correct.<br />';
}




if(!$Experiance || strlen($Experiance) < 5)
{

$error .= "Please enter your Experiance.<br />";
}

if(!$Drivinglicense)
{

$error .= 'Please enter your Driving license.<br />';
}


if(!$Experiance)
{

$error .= 'Please enter your Experiance.<br />';
}


if(!$Nationality)
{

$error .= 'Please enter your Nationality.<br />';
}


if(!$Languages)
{

$error .= 'Please enter your Languages.<br />';
}





if(!$error)
    {

$messages="From: $email <br>";
$messages.="Function: $Function <br>";
$messages.="Sex: $Sex <br>";
$messages.="Birthday: $Date_Of_Birth_Month - $Date_Of_Birth_Day - $Date_Of_Birth_Year <br> ";
$messages.="Name: $name <br>";
$messages.="adres: $adres <br>";
$messages.="number: $number <br>";
$messages.="postalcode: $postalcode <br>";
$messages.="city: $city <br>";
$messages.="Email: $email <br>";
$messages.="Phone: $phone <br>";
$messages.="Driving license: $Drivinglicense <br>";
$messages.="Experiance: $Experiance <br>";
$messages.="Nationality: $Nationality <br>";
$messages.="Languages: $Languages <br>";



    $mail = mail($to,$subject,$messages,$headers);    

if($mail)
    {

    echo 'OK';
if($autorespond == "yes")
{

    include("autoresponde.php");
}
    }

    }

    else
    {
    echo '<div class="error">'.$error.'</div>';
    }

}

?>
 
Obelix Idefix

Obelix Idefix

01/04/2012 08:27:44
Quote Anchor link
eregi is vervallen.
Waarom al die variabelen kopiëren?
Variabelen wordt aangeraden buiten quotes te houden. Regel 168 doe je dat wel.
I.p.v. de mail-functie van php wordt doorgaans verwezen naar swiftmailer/php mailer.

Fouad El Amrani op 01/04/2012 02:28:57:
maar nu krijg ik problemen met de upload file
Ik heb die nu volledig uit mijn script gehaald .
iemand een idee hoe ik dit moet aanpakken


Er zijn diverse topics over het uploaden van bestanden en ook met Google is veel te vinden. Waar loop je precies tegen aan? Wat is die code?
De code die je nu geplaatst hebt is _niet_ relevant!
 
Fouad El Amrani

Fouad El Amrani

01/04/2012 12:09:39
Quote Anchor link
Hey Obelix,
Ik heb gegoogeld hoor maar heb geprobeerd en lukt niet echt.
Kan je mij hierbij helpen de php script te vervolledigen voor de uploadfile?
THX
 

Pagina: « vorige 1 2



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.