Jump to content

ignace

Moderators
  • Posts

    6,457
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by ignace

  1. $pnm = implode('', $pnm);
  2. Put Athy Register.pdf in the same directory as your .php files is, and run: file_put_contents('txtfile.txt', pdf2txt('Athy Register.pdf'));
  3. if(!empty($_POST) && empty($_POST['form']))
  4. What is the best estimated time a user would take to fill them all out? I usually stop after filling out 5 fields, but that's just me
  5. create a function instread. function show_league_image($type) { $images = array ( 'league1' => 'first.jpg', 'league2' => 'secound.jpg', 'league3' => 'third.jpg' ); if(array_key_exists($type, $images)) return '<img src="images/awards/'.$images[$type].'" />'; return false; } Now to display the images you call the function <tr><td><? echo show_league_image($type) ?></td></tr> Hanging around WordPress to much? ??? No, never used it. Strange, you then applied the exact same logic WordPress applies to their functions as the way they deploy the functions. You are one kick-ass programmer, then?
  6. You'll need an smtp server to be able to send e-mails.
  7. create a function instread. function show_league_image($type) { $images = array ( 'league1' => 'first.jpg', 'league2' => 'secound.jpg', 'league3' => 'third.jpg' ); if(array_key_exists($type, $images)) return '<img src="images/awards/'.$images[$type].'" />'; return false; } Now to display the images you call the function <tr><td><? echo show_league_image($type) ?></td></tr> Hanging around WordPress to much?
  8. Can you please post the code with the hidden fields + involved processing (and use code tags please).
  9. $_SERVER['HTTP_ACCEPT_LANGUAGE'] Defines the languages the user "understands" and is indicated by a quality ranging from 0 to 1 (inclusive) where 1=Very Good and 0=Very Poor. For more information on http accept headers: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
  10. That is because NULL points to the the memory address 0x00000000 which if translated from hex to integer is 0 and for boolean is false, .. Or atleast something like that, I can't remember the lessons that well
  11. twilitegxa how is your rpg going? You have been working intensively on it, haven't you? I can somewhat follow your process just by going over your posts
  12. array_walk($t, array(&$this, 'converttolower'));
  13. if ($_POST['submit']) If the form wasn't submitted yet this will yield a warning, thus should be: if (!empty($_POST)) or if (isset($_POST['submit'])) Where are these hidden input fields?
  14. Validate first that their was actually something submitted: if (!empty($_POST)) { // processing logic }
  15. 1) My solution is anything but useless. 2) You would ofcourse modify it to the minimum of characters the input field would need. Ok you are correct on this one, my apologies. However: You suggested: if ($_POST['random_field'] != '') returns true if random_field contains a 0 as empty() does, yes My suggestion: if (isset($_POST['random_field'][2])) only returns true if random_field atleast contains 3 characters, ok granted they can still just type 000 but an added ctype_alpha($_POST['random_field']) should solve that. My suggestion to solve some of the shortcomings isset() and empty() have.
  16. Yes this is anything but proper programming as this can be better written as: if (!is_numeric($var)) { header('Location: /index.php'); }
  17. Great code. Is readable code. Clean it up, not will you only find your own errors also others will find your errors faster.
  18. That is because $words[0] doesn't exist. do print_r($words);
  19. $words = array(); foreach ($var as $word) { if (!array_key_exists($word, $words)) { $words[$word]= 1; } else { ++$words[$word]; } }
  20. $total = (int) file_get_contents('c:\\data\\filehere.txt'); file_put_contents('c:\\data\\filehere.txt', ++$total);
  21. This will work in FF 3.5 & IE8 as you noted but will throw: Notice: undefined index: 'random_field' in all other browsers. if (isset($_POST['random_field'][2])) { // makes sure random_field contains atleast 3 characters (thus not empty) whilst not throwing any notices //set } else { //not set } And how is this then a solution? if ($_POST['random_field'] != '')
  22. This data probably also comes from a db? Then why not store the title in it also? <?php ... $result = mysql_query($query, $db); extract(mysql_fetch_assoc($result)); ?> <!DOCTYPE html> <html> <head> <title><?php print $title; ?></title> </head> <body> <div id="wrapper"> <div id="content"><?php print $content; ?></div> .. </body> </html>
×
×
  • 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.