ignace
Moderators-
Posts
6,457 -
Joined
-
Last visited
-
Days Won
26
Everything posted by ignace
-
$pnm = implode('', $pnm);
-
Put Athy Register.pdf in the same directory as your .php files is, and run: file_put_contents('txtfile.txt', pdf2txt('Athy Register.pdf'));
-
if(!empty($_POST) && empty($_POST['form']))
-
D4rN n0 LEE+ 5P34k
-
[SOLVED] Maximum number of post variables you can set?
ignace replied to Prodigal Son's topic in PHP Coding Help
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 -
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?
-
You'll need an smtp server to be able to send e-mails.
-
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?
-
Can you please post the code with the hidden fields + involved processing (and use code tags please).
-
Was not posted by me, but by BillyBob
-
[SOLVED] adding languages to site guidance needed
ignace replied to xcoderx's topic in PHP Coding Help
$_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 -
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
-
[SOLVED] Fiel Upload - Can't dislplay files for downloading
ignace replied to twilitegxa's topic in PHP Coding Help
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 -
array_walk($t, array(&$this, 'converttolower'));
-
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?
-
[SOLVED] Really dont know the subject of this....
ignace replied to onthespot's topic in PHP Coding Help
Validate first that their was actually something submitted: if (!empty($_POST)) { // processing logic } -
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.
-
Yes this is anything but proper programming as this can be better written as: if (!is_numeric($var)) { header('Location: /index.php'); }
-
remove or die()
-
[SOLVED] Format results into a table issues ;)
ignace replied to Andy Bas's topic in PHP Coding Help
Great code. Is readable code. Clean it up, not will you only find your own errors also others will find your errors faster. -
That is because $words[0] doesn't exist. do print_r($words);
-
$words = array(); foreach ($var as $word) { if (!array_key_exists($word, $words)) { $words[$word]= 1; } else { ++$words[$word]; } }
-
$total = (int) file_get_contents('c:\\data\\filehere.txt'); file_put_contents('c:\\data\\filehere.txt', ++$total);
-
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'] != '')
-
how to have a different page title for each page of site using php
ignace replied to autofocus's topic in PHP Coding Help
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>