Jump to content

ignace

Moderators
  • Posts

    6,457
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by ignace

  1. One of many who barely can see the link. Is it possible to adjust the color to make it more noticeable? Regards
  2. $ID = array_key_exists('ID', $_GET) ? intval($_GET['ID']) : -1; if (1 > $ID) {//invalid
  3. ignace

    How TO

    <ul id="gallery"> <li><a href="#"><img src="path/to/image.file" width="100" height="100"> <span class="caption">BYEEE</span></a> </li> <li><a href="#"><img src="path/to/image.file2" width="100" height="100"> <span class="caption">HIII</span></a> </li> </ul> ul#gallery li { display: block; float: left; } ul#gallery li a img, ul#gallery li a span { display: block; } ul#gallery li a { text-align: center; text-decoration: none; } ul#gallery li a span { color: #000; } ul#gallery li a:hover span { border-bottom: 1px solid #000; }
  4. <input type="text" name="clientPickup[<?php print $row_count; ?>]" id="clientPickup<?php print $row_count; ?>" style="width: 350px;" /> foreach ($_POST['clientPickup'] as $row_count => $value) {
  5. I like the idea but why not re-think it and make the host OS a VM? Or like Google OS boot as a browser although I can't see the benefit of it being a browser in your context as each OS is equipped with a browser. I think it would be quite cool to switch between Windows Vista, Windows 7, Mac, Ubuntu, FreeBSD to name a few. This will have a few issues though HDD, RAM. You, my man, are a visionair. 5 years ago I predicted that in the future we would boot a cloud-based OS and installing applications is nothing more then just clicking "Add to my desktop". You click on the icon and the applications boots whether that be a game, a Word application, or something else. And now anno 2010: http://www.onlive.com/ The foundation is being created (not yet perfect, but still).
  6. Even then, would you want your visitors to download a Word document (possibly in docx format) that they may or may not be able to open? Why bother your visitors with downloading if you could just show it? Of course having a Word document and all is not that easy when it comes to flexibility or data-independence. So my advice would be to integrate a web Word alternative like: http://tinymce.moxiecode.com/ http://developer.yahoo.com/yui/editor/ http://nicedit.com/ This gives you more possibilities then a Word document.
  7. ignace

    SEO Yahoo

    Well Google never told us anything about their SE algorithm, who knows? Would the CEO of Google be into Sports?
  8. What is your actual goal here? Do you want users to be able to install Windows, Mac, or Linux through their browser?
  9. He said second column <?php echo $row_Recordset1['Price_75mm']; ?> | <?php echo round($row_Recordset1['Price_75mm']*1.1,2); ?>
  10. Thx, how could I be so dumb forgetting field_6 is an email_address. $to = 'insertemail@email.com, email2@email.com, ' . $_POST['field_6'];
  11. I re-wrote your script to make it more flexible: function findCountryByCustomerId($customerID) { $query = "SELECT country FROM fcpv3_customers WHERE id = $customerID"; $data = queryService($query); return $data['country']; } function findStandardChargeByCountry($country) { switch ($country) { case 'Canada': return 19.99; case 'Switzerland': return 9.99; case 'United Kingdom': return 2.99; case 'United States': return 24.99; default: return 0.00; } } function appliesForExtraCharge($productQuantity) { return $productQuantity > 2; } function calculateExtraCharge($standardCharge, $productQuantity, $cutPerItem) { return $standardCharge + $productQuantity * $cutPerItem; } function calculateShipping($customerID, $productQuantity) { $country = findCountryByCustomerId($customerID); $standardCharge = findStandardChargeByCountry($country); if (appliesForExtraCharge($productQuantity)) { $cutPerItem = 0.75; $standardCharge = calculateExtraCharge($standardCharge, $productQuantity, $cutPerItem); } }
  12. A warning or a notice is never a good error handling especially because a production server has display_errors = Off which will hide your error messages to the user. I also don't believe exceptions is a good way to go. Exceptions are also a bad idea because an unhandled exception will leave your website in an unusable state. Your ultimate goal should be - no matter what - to keep the website in a usable state. Personally though I prefer to use Zend_Validator & Zend_Form.
  13. It sets up data-integrity constraints, so that when you remove a user from the system you also delete his inbox/outbox.
  14. Doesn't work, however: <?php // this function will fail with an error // but the error would be outputted above. $errors = call_some_function(); if (!empty($errors)) { echo $errors; } ?> Will.
  15. Or alternatively: define('LOOP_CONTINUE', 1); define('LOOP_BREAK', 2); function blaBlaBla($bla) { if ($bla) { return LOOP_CONTINUE; } else { return LOOP_BREAK; } } In your loop: foreach ($mails as $mail) { $return = blaBlaBla($mail); if (LOOP_CONTINUE === $return) continue; if (LOOP_BREAK === $return) break; }
  16. How do you mean then, something like this? try { //something } catch (UnknownCredentialsException $e) { $errors[] = 'You are getting warmer..'; } catch (DatabaseUnavailableException $e) { $errors[] = 'Great, you fried the system. Are you happy now?'; }
  17. A proper database design could be: CREATE TABLE message ( id int(4) NOT NULL AUTO_INCREMENT, from_user_id int(4) NOT NULL, to_user_id int(4) NOT NULL, subject varchar(128), message text, FOREIGN KEY fk_message_from_user_id (from_user_id) REFERENCES user (id) ON UPDATE CASCADE ON DELETE CASCADE, FOREIGN KEY fk_message_to_user_id (to_user_id) REFERENCES user (id) ON UPDATE CASCADE ON DELETE CASCADE, PRIMARY KEY (id) ) ENGINE = InnoDB;
  18. K then now assume you have 10k users?
  19. I think the for-free part has something to do with that
  20. No, it's not impossible. Check for firstname lastname first and as a last resort check for name.
  21. Like this? $errors = array(); if (empty($_POST['username'])) { $errors[] = 'You stupid F*$% can\'t you read? It said REQUIRED as in I NEED IT???'; }
  22. This applies more to you then it is to me. If you IP banned yourself then of course you are banned and the others aren't because they do not have your IP address.
  23. You can create a good approximation where a certain line starts, of course this assumes that each line is of equal length, example: $line_length = 82;//in bytes (accounting for \r\n on Windows) $filesize = filesize('test.txt'); echo 'Lines: ', ceil($filesize / $line_length); Using something like this: qqmsdlkfjlmqskdjfmlkqsjdfmlksjqdmlfkjsqmldkfjmlqskdjflmksqjdfmlkqsjdfnvsqdfeies qqmsdlkfjlmqskdjfmlkqsjdfmlksjqdmlfkjsqmldkfjmlqskdjflmksqjdfmlkqsjdfnvsqdfeies qqmsdlkfjlmqskdjfmlkqsjdfmlksjqdmlfkjsqmldkfjmlqskdjflmksqjdfmlkqsjdfnvsqdfeies qqmsdlkfjlmqskdjfmlkqsjdfmlksjqdmlfkjsqmldkfjmlqskdjflmksqjdfmlkqsjdfnvsqdfeies qqmsdlkfjlmqskdjfmlkqsjdfmlksjqdmlfkjsqmldkfjmlqskdjflmksqjdfmlkqsjdfnvsqdfeies qqmsdlkfjlmqskdjfmlkqsjdfmlksjqdmlfkjsqmldkfjmlqskdjflmksqjdfmlkqsjdfnvsqdfeies qqmsdlkfjlmqskdjfmlkqsjdfmlksjqdmlfkjsqmldkfjmlqskdjflmksqjdfmlkqsjdfnvsqdfeies qqmsdlkfjlmqskdjfmlkqsjdfmlksjqdmlfkjsqmldkfjmlqskdjflmksqjdfmlkqsjdfnvsqdfeies qqmsdlkfjlmqskdjfmlkqsjdfmlksjqdmlfkjsqmldkfjmlqskdjflmksqjdfmlkqsjdfnvsqdfeies qqmsdlkfjlmqskdjfmlkqsjdfmlksjqdmlfkjsqmldkfjmlqskdjflmksqjdfmlkqsjdfnvsqdfeies Returns "Lines: 10" [ot]The good old Assembler days[/ot]
  24. form-process.php function clean($value) { $value = strip_tags($value); $value = htmlentities($value); return $value; } $_POST = array_map('clean', $_POST); //$url = 'http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']); $from = '';//your e-mail $to = 'insertemail@email.com, email2@email.com, email3@email.com'; $subject = 'Title Evidence - Form Submission'; $message = ''; $headers = 'From: ' . $from . "\r\n"; $headers.= 'Reply-To: ' . $from . "\r\n"; $headers.= 'Return-Path: ' . $from . "\r\n"; $message = <<<MAIL Business Name: $_POST['field_1'] Office Address: $_POST['field_2'] Your Name: $_POST['field_3'] Your Phone: $_POST['field_4'] Your Fax (optional): $_POST['field_5'] Your Email: $_POST['field_6'] Property Address: $_POST['field_7'] Transaction Type: $_POST['field_8'] Seller(s): $_POST['field_9'] Sellers Agent: $_POST['field_18'] Buyer(s): $_POST['field_10'] Buyers Agent: $_POST['field_17'] Sales Price: $_POST['field_11'] Lender (optional): $_POST['field_12'] Loan Amount (optional): $_POST['field_13'] Estimated Closing Date: $_POST['field_14'] Closing Location: $_POST['field_15'] Comments (optional): $_POST['field_16'] MAIL; if (mail($to, $subject, $message, $headers)) { include('confirm.html'); } else { include('failed.html'); } Use as: <?php if (!empty($_POST)): include('form-process.php'); endif; ?> <form action="#" ..
×
×
  • 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.