Jump to content

cloetensbrecht

Members
  • Posts

    13
  • Joined

  • Last visited

  • Days Won

    1

cloetensbrecht last won the day on October 19 2017

cloetensbrecht had the most liked content!

cloetensbrecht's Achievements

Member

Member (2/5)

1

Reputation

2

Community Answers

  1. echo "Order today to receive by " . date("l j F Y", (time() + (86400 * date("N", time()) < 6 ? 5 : 3)));
  2. Have you added the following mysql query after your db connection? SET NAMES utf8
  3. It also depends on how you send your email. If you use sendmail you can enable utf-8. Maybe you should give us the full code?
  4. Have you looked to the encoding of your php file? In your editor you can normaly see what type of encoding your dile is using. It should also be utf8.
  5. <div id='info' class='results'> was not closed correctly. And an id should only be used once on a single page, so I grouped your text into one div. <?php $bredde = $_GET['bredde']; $profil = $_GET['profil']; $felg = $_GET['felg']; $type = $_GET['type']; $size = $bredde . "/" . $profil . "R" . $felg; $title = false; $pricelist = []; function priceFormat($price) { return 'kr '.$price.',-'; } // fill the pricelist array with data if (($handle = fopen("prislister/$type.csv","r")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) { if($data[0] == $size) { $item = new stdClass(); $item->dimensjon = $data[0]; $item->type = $data[1]; $item->li = $data[2]; $item->pris = $data[3]; $item->montert = ($data[3] * 4) + 700; $pricelist[] = $item; } } fclose($handle); } ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Dekkalkulator</title> <link rel="stylesheet" href="style.css"> </head> <body id="results-body"> <div id="results-wrap"> <h3>Priseksempel <?php echo $type;?>dekk med dimensjonen <?php echo $size;?>:</h3> <?php if (count($priceList)): ?> <div id='info' class='results'> <b>Priser oppdatert 05/10.<br> Priser på noe av vårt utvalg. Glem konkurrentenes rabatter, sjekk RINGDEKK pris<br> Vi har dekk i alle prisklasser, men har valgt dekk som vi kan anbefale</b> Vi hjelper deg gjerne med valget.<br> <br><br> <table id="results" class="results" cellpadding="0" cellspacing="0"> <thead> <tr> <td>Dimensjon</td> <td>Merke og type</td> <td>LI</td> <td>Pris</td> <td><center>Pris 4 dekk ferdig montert</center></td> </tr> </thead> <tbody> <?php foreach($priceList as $item): ?> <tr> <td><?php echo $item->dimensjon; ?></td> <td><?php echo $item->type; ?></td> <td><?php echo $item->li; ?></td> <td><?php echo priceFormat($item->pris); ?></td> <td><?php echo priceFormat($item->montert); ?></td> </tr> <?php endforeach; ?> </tbody> </table> Alle priser er inklusiv miljøavgift og mva. Montering er inkludert i prisen lengst til høyre.<br> <br> <a target="_blank" href="http://www.ringdekk.no/nyedekk.html" class="button">Bestill time</a> <a class="button" onclick="window.print()">Skriv ut</a><br> <br> <div class='boks'> <strong>Ringdekk AS</strong><br> Risesletta<br> 3513 Hønefoss<br> <br> Telefon: 32 11 11 74<br> 24t vakt: 405 24 000 </div> <div class='boks'> <strong>Ordinære åpningstider</strong><br> 08 - 17<br> 10 - 14<br> <br><br><br> </div> <div class='boks'> <strong>I sesong</strong><br> 08 - 24<br> 09 - 16<br> <br><br><br> </div> </div> <?php else: ?> <p>Ingen resultater.</p> <?php endif; ?> </div> </body> </html>
  6. If you bought this code from a company.. the company is terrible. <?php $bredde = $_GET['bredde']; $profil = $_GET['profil']; $felg = $_GET['felg']; $type = $_GET['type']; $size = $bredde . "/" . $profil . "R" . $felg; $title = false; $pricelist = []; function priceFormat($price) { return 'kr '.$price.',-'; } // fill the pricelist array with data if (($handle = fopen("prislister/$type.csv","r")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) { if($data[0] == $size) { $item = new stdClass(); $item->dimensjon = $data[0]; $item->type = $data[1]; $item->li = $data[2]; $item->pris = $data[3]; $item->montert = ($data[3] * 4) + 700; $pricelist[] = $item; } } fclose($handle); } ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Dekkalkulator</title> <link rel="stylesheet" href="style.css"> </head> <body id="results-body"> <div id="results-wrap"> <h3>Priseksempel <?php echo $type;?>dekk med dimensjonen <?php echo $size;?>:</h3> <?php if (count($priceList)): ?> <div id='info' class='results'><b></b> Priser oppdatert 05/10. <div id='info' class='results'><b>Priser på noe av vårt utvalg. Glem konkurrentenes rabatter, sjekk RINGDEKK pris</b> <div id='info' class='results'><b>Vi har dekk i alle prisklasser, men har valgt dekk som vi kan anbefale</b> Vi hjelper deg gjerne med valget. <br><br><br> <table id="results" class="results" cellpadding="0" cellspacing="0"> <thead> <tr> <td>Dimensjon</td> <td>Merke og type</td> <td>LI</td> <td>Pris</td> <td><center>Pris 4 dekk ferdig montert</center></td> </tr> </thead> <tbody> <?php foreach($priceList as $item): ?> <tr> <td><?php echo $item->dimensjon; ?></td> <td><?php echo $item->type; ?></td> <td><?php echo $item->li; ?></td> <td><?php echo priceFormat($item->pris); ?></td> <td><?php echo priceFormat($item->montert); ?></td> </tr> <?php endforeach; ?> </tbody> </table> <div id='info' class='results'> Alle priser er inklusiv miljøavgift og mva. Montering er inkludert i prisen lengst til høyre.<br> <br> <a target="_blank" href="http://www.ringdekk.no/nyedekk.html" class="button">Bestill time</a> <a class="button" onclick="window.print()">Skriv ut</a><br> <br> <div class='boks'> <strong>Ringdekk AS</strong><br> Risesletta<br> 3513 Hønefoss<br> <br> Telefon: 32 11 11 74<br> 24t vakt: 405 24 000 </div> <div class='boks'> <strong>Ordinære åpningstider</strong><br> 08 - 17<br> 10 - 14<br> <br><br><br> </div> <div class='boks'> <strong>I sesong</strong><br> 08 - 24<br> 09 - 16<br> <br><br><br> </div> </div> <?php else: ?> <p>Ingen resultater.</p> <?php endif; ?> </div> </body> </html>
  7. Try something like this to organise your users: session_start(); $_SESSION['users'] = []; function addUser($data) { $_SESSION['users'][] = [ 'name' => $data['username'], 'birthYear' => $data['birthyear'] // ... ]; } if (isset($_POST['check'])) { addUser($_POST); $numberOfUsers = count($_SESSION['users']) if ($numberOfUsers == 1) { // do user 1 stuff // $user1 = $_SESSION['users'][0]; } elseif($numberOfUsers == 2) { // do user 2 stuff // $user1 = $_SESSION['users'][0]; // $user2 = $_SESSION['users'][1]; } }
  8. Answer question 1: You use the same styling on all table rows: tr:nth-child(1) td:nth-child(2){ background-color: yellow; } tr:nth-child(2) td:nth-child(1n){ background-color: #D3D3D3; } You should give your calendar a class calendar and put it in your css <!-- add class="calendar" to your table --> <table border='1' class="calendar"> <tr> <td> <input class="previousbutton" type='button' value='<' name='previousbutton' onClick="goPreviousMonth (<?php echo $month.",".$year?>)"> </td> <td colspan='5'> <span class="title"> <?php echo $monthName." ".$year; ?> </span> </td> <td> <input class="nextbutton" type='button' value='>' name='nextbutton' onClick="goNextMonth (<?php echo $month.",".$year?>)"> </td> </tr> <tr> <td>Sun</td> <td>Mon</td> <td>Tue</td> <td>Wed</td> <td>Thu</td> <td>Fri</td> <td>Sat</td> </tr> <?php echo "<tr>"; .... .calendar tr:nth-child(1) td:nth-child(2){ background-color: yellow; } .calendar tr:nth-child(2) td:nth-child(1n){ background-color: #D3D3D3; }
  9. You receive an array in set_files but you doesn't loop the array when setting the image_url and the tmp_path public function set_files($file){ // $file should be an array if(empty($file) || !$file || !is_array($file)){ $this->errors[] = "There was no file uploaded here"; return false; }else{ // $file is an array of files. You should loop the array before getting the file's name and tmp_name // $this->image_url = $file['name']; // $this->tmp_path = $file['tmp_name']; // you should do something like this foreach($file as $f) { $newFile = new stdClass(); $newFile->image_url = $f['name']; $newFile->tmp_path = $f['tmp_name']; $this->files[] = $newFile; // put the file in an array and do stuff with it } } } public function new_images() { // $_FILES['images'] is an array of multiple files $this->set_files($_FILES['images']); }
  10. Something like this? foreach ($cost_array as $key1 => $value1) { // group 1, group 2 and group 3 are empty and should stay => continue the foreach loop if (empty($value1['group1']) && empty($value1['group2']) && empty($value1['group3'])) continue; // if form group 1 exists and its value is the same as $value group 1, it should stay => continue the foreach loop if (isset($form_group1) && $value1['group1'] == $form_group1) continue; // if form group 2 exists and its value is the same as $value group 2, it should stay => continue the foreach loop if (isset($form_group2) && $value1['group2'] == $form_group2) continue; // if form group 3 exists and its value is the same as $value group 3, it should stay => continue the foreach loop if (isset($form_group3) && $value1['group3'] == $form_group3) continue; // otherwise unset the value unset($cost_array[$key1]); }
  11. Have you tried printing the values of $orderp and $orderx before running the query? Does it actually have the values 2 and 5 ? <?php $orderp = $_REQUEST['orderp']; print_r($orderp); // this should print an array with values 2 and 5 for($i= 0; $i < count($cats); $i++) { $orderx = $orderp[$i]; echo $orderx; // this should echo the values 2 and 5 } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.