Advertentie plaatsen gaat niet door naar fotos

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Simone Joosten

Simone Joosten

19/02/2014 10:14:43
Quote Anchor link
Advertentie plaatsen error
hallo

als ik op mijn site probeer een advertentie te plaatsen
en ik klik op volgende, dan blijft het beeld compleet wit.

Iemand enig idee waar ik deze error in zou moeten zoeken ?
De code waar hij vanaf naar fotos.php zou moeten gaan voeg ik hieronder toe, kan zelf de fout niet vinden:(




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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
session_start();
error_reporting(0);

$inloggen         = 1;
$curr_nemer     = 1;
$formulier         = TRUE;
$choosecat         = true;
$nieuwsbr         = true;
$biedenjanee     = 1;
$prijsoptie        =1;
$typeofad         = "1";
$showonmap        ="2";

include_once("../includes/functions.php");

//member registered via offerbox on a ad, so not all the info is available.
//send him first to change his profile
if(empty($cur_woonplaats )){
    
    header("Location: ".WEBSITE_URL."/members/profile.php?update=1");
    exit;    
}

//price for website link
$sql_css_result_26 =  mysql_query ("select value,value2
                                        from mpsetting
                                        where setting = 'prices'
                                        limit 1");
$adprice = mysql_fetch_assoc($sql_css_result_26);
$pricepercredit        = $adprice['value'];
$priceforlink        = $adprice['value2'];

 
// verwerlem kies categorieen
if (isset($_POST["choosecats"])){
    
    $cat = round(StripDanger($_POST['cat']));
    $subcat = StripDanger($_POST['subcat']);
    
    if(empty($cat) || $subcat=='' || $subcat=='x'){        
        $errors = LANG_ADDAD_CHOSCATSS;
    }
    else{
        //verander welk formulier
        $choosecat=false;
        $adform=true;

        
        if($subcat=='0')
            $getcreditad = $cat;    
        else
            $getcreditad = $subcat;

        //select wat een advertentie in deze ad kost, heeft de klant genoeg credits?
        // anders doorsturen naar credit betaal pagina
                $select_subcatname = mysql_query ("select credits
                                      from categorie
                                    where id = '$getcreditad'
                                    limit 1");
                $cat_subcat_row = mysql_fetch_assoc($select_subcatname);

                //get price for this amount of credits


                $prijs_ad     = formatprice(metbtw($pricepercredit*$cat_subcat_row["credits"]));
                $prijsnon    = metbtw($pricepercredit*$cat_subcat_row["credits"])*100;    //price in cents

        
        
    }
}
// einde verwerlem kies categorieen


// verwerlem kies adform
if (isset($_POST["adformz"])){
    
    $aFout = array();
    
    $choosecat=false;
    $adform=true;
    
    $cat = round(StripDanger($_POST['cat']));
    $subcat = StripDanger($_POST['subcat']);
    
    //geen categorien? doorsturen naar vorige pagina
    if(empty($cat) || $subcat==''){
        $url = WEBSITE_URL."/members/addad.php";
        exit;
    }
    
    $titel = trim(StripDanger($_POST['titel']));
    $titel = substr($titel,0,65);

    $omschrijving = trim(StripDanger($_POST['omschrijving']));
    $omschrijving = strip_tags($omschrijving,'<p><u><strong><em><ul><li><br>');
    $omschrijving = trim(implode(' ', preg_split('/\s+/', $omschrijving)));
    $omschrijving = str_replace('<?','',$omschrijving);
    $omschrijving = str_replace('?>','',$omschrijving);    
    $omschrijving = str_replace('\r\n','',$omschrijving);    
    
    $prijs = str_replace(',','.',$_POST['prijs']);
    $prijs = round(StripDanger($prijs),2);
    $biedenjanee = trim(StripDanger($_POST['biedenjanee']));
    $prijsoptie = round(StripDanger($_POST['prijsoptie']));
    $showonmap = round(StripDanger($_POST['showonmap']));
    
    //extra fields
    $field_1 = trim(StripDanger($_POST['field_1']));
    $field_2 = trim(StripDanger($_POST['field_2']));
    $field_3 = trim(StripDanger($_POST['field_3']));
    $field_4 = trim(StripDanger($_POST['field_4']));
    $field_5 = trim(StripDanger($_POST['field_5']));
    $field_6 = trim(StripDanger($_POST['field_6']));
    $field_7 = trim(StripDanger($_POST['field_7']));
    $field_8 = trim(StripDanger($_POST['field_8']));
    $field_9 = trim(StripDanger($_POST['field_9']));
    
    $websitelink = trim(StripDanger($_POST['websitelink']));
        if(!empty($websitelink) && !eregi("http://", $websitelink) && !eregi("https://", $websitelink))
        $websitelink = "http://".$websitelink;
        
        
    
    if(empty($biedenjanee)) $biedenjanee = 1;
    
    $typeofad = round(StripDanger($_POST['typeofad']));
    
    if(empty($typeofad)) $typeofad = 1;
    
    if($typeofad==2){
        $biedenjanee = 2;
    }
    
    
        if(empty($titel))
        {
            $aFout[] = LANG_ADDAD_ADTITLE." ".LANG_CR_ISMANDA;
        }
        if(empty($prijs) && $prijsoptie==1)
        {
            $aFout[] = LANG_ADDAD_PRICE." ".LANG_CR_ISMANDA;
            $prijs = '';
            unset($_POST["prijs"]);
        }         
        if(empty($omschrijving))
        {
            $aFout[] = LANG_ADDAD_ADTEXT." ".LANG_CR_ISMANDA;
        }
        //zijn er fouten  ander verwerken    
         if(!empty( $aFout ))
        {
            $errors = '
            
            <ul>';
            foreach($aFout as $sFout)

            {
                $errors .= "    <li>".$sFout."</li>\n";
            }
            $errors .= "</ul>";
        }
        else{
                //catname
                $select_catname = mysql_query ("select name
                                      from categorie
                                    where id = '$cat'
                                    limit 1");
                $cat_cat_row = mysql_fetch_assoc($select_catname);
                $select_catname = mysql_real_escape_string($cat_cat_row["name"]);
                //subcatname en credits indien nodig
                
                if($subcat=='0')
                $getcreditad = $cat;    
                else
                $getcreditad = $subcat;
            
                $select_subcatname = mysql_query ("select name,credits
                                      from categorie
                                    where id = '$getcreditad'
                                    limit 1");
                $cat_subcat_row = mysql_fetch_assoc($select_subcatname);
                $select_subcatname = mysql_real_escape_string($cat_subcat_row["name"]);
                $select_cat_credits = mysql_real_escape_string($cat_subcat_row["credits"]);
                
                //geen subcat?
                if(empty($select_subcatname))
                    $select_subcatname = $select_catname;

                
                //$prijsnon $websitelink $priceforlink
                
                
                //check if ad is free or not
                $adprice    = 0;
                $valid         = 0;
                $paydue     = 0;
                
                $adprice     = $cat_subcat_row["credits"]*$pricepercredit;
                //ad is not free
                if($adprice>0){
                    
                    //user has still credtis left, probably given by site admin
                    if($cur_credits>=$cat_subcat_row["credits"]){
                        
                        
                            //deduct credits
                            $credit_update = mysql_query("update members
                                    set credits= credits-".$cat_subcat_row["credits"]."
                                    where wgid = '$wk_id'
                                    LIMIT 1");
                        
                            $paydue     = 0;
                            $valid         = 1;
                            
                    }
                    else{
                        
                        //user has no credits, and has to pay    
                        $valid = '0';
                        $paydue = $adprice*100;    
                        
                    }
                    
                    
                    
                }
                else{
                    
                    $paydue     = 0;
                    $valid         = 1;
                    
                }
                
                if(!empty($websitelink) && $priceforlink >0){
                    //wel een website link
                    $paydue     = ($priceforlink*100)+$paydue;
                    $valid         = '0';
            
                    
                }
                
                if($paydue>0)
                $paydue = metbtw($paydue);
                /*
                if(!empty($websitelink) && $priceforlink >0){
                    //wel een website link
                    $adprice     = $cat_subcat_row["credits"]*$pricepercredit+$priceforlink;
                    $paydue        = $adprice*100;
                    $valid         = '0';
            
                    
                }else{
                    
                    //geen website link
                    $adprice     = $cat_subcat_row["credits"]*$pricepercredit;
                    if($adprice>0){
                        //not free
                        $valid = '0';
                        $paydue = $adprice*100;                        
                        
                    }
                    else{
                        $valid = '1';
                        $paydue = '0';
                    }

                }
        
            */
            
            
                $validto = time()+(STD_LENGTH*86400);
                
                $sql_insert_ = "insert into ads
                    (catid,subcatid,caattext,subcaattext,typeofad,ownerid,titel,omschrijving,prijs,prijsoptie,biedenjanee,plaats,glatti,glongg,showonmap,valid,paydue,posted,validto,
                    field_1,field_2,field_3,field_4,field_5,field_6,field_7,field_8,field_9,websitelink,iscompany)
                    values
                    ('$cat','$subcat','$select_catname','$select_subcatname','$typeofad','$wk_id','$titel','$omschrijving','$prijs','$prijsoptie','$biedenjanee','$cur_woonplaats $cur_provincie','$cur_glatti','$cur_glongg','$showonmap','$valid','$paydue','".time()."','$validto',
                    '$field_1','$field_2','$field_3','$field_4','$field_5','$field_6','$field_7','$field_8','$field_9','$websitelink','$cur_bedrijf')";
                    
                    
                        
    $result_ = mysql_query($sql_insert_);
        
    $ad_id = mysql_insert_id(); // or die("Ongeldige query: " . mysql_error());    
    
    
            // ad geplaatst
            if($ad_id){
                //niet gratis?
 
                  //nu doorsturen naar foto upload
                header("location: ".WEBSITE_URL."/members/fotos.php?adid=$ad_id&new=1");
                
            }
        
            
        exit;    
        }

    
    
    
}
// einde verwerlem adform
 
PHP hulp

PHP hulp

23/11/2024 10:31:07
 
Obelix Idefix

Obelix Idefix

19/02/2014 10:27:59
Quote Anchor link
En wat als je error-reporting aan zet?
 
Simone Joosten

Simone Joosten

19/02/2014 10:34:05
Quote Anchor link
Die heb ik aangezet, maar zie ik helemaal niks, het beeld blijft wit er gebeurd gewoon helemaal niks
 
Obelix Idefix

Obelix Idefix

19/02/2014 10:52:28
Quote Anchor link
Volgens mij staat in de code die hierboven staat, error-reporting uit.
 
Simone Joosten

Simone Joosten

19/02/2014 11:25:13
Quote Anchor link
Ja dat klopt, maar inmiddels is het opgelost, het lag aan mijn computer
na het legen van de cookies werkt het perfect toch bedankt !!
 



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.