428 Posted Topics
Re: That echo statement works for me without any issue. Can you post what you are getting errors and/or output when you run it? | |
Re: ***I apologize this will ONLY work with php > 5.3.0*** Would not a better solution be to use the tools that PHP already provides for doing just this? [CODE=php] $datetime1 = new DateTime($row["ss_datestart"] . " " . $row["ss_timestart"]); $datetime2 = new DateTime($row["ss_dateend"] . " " . $row["ss_timeend"]); $interval = $datetime1->diff($datetime2); … | |
Re: You're probably looking for a multi-byte function. [url]http://php.net/manual/en/function.mb-substr.php[/url] | |
Re: In Firefox/Windows you would put [url]http://www.abc.com[/url] into the address bar, once the site was loaded, press CTRL-U to bring up the source, then CTRL-C/CTRL-V on whatever urls you want. :twisted: I think the concept you're looking for is a website scraper, there are a lot of different options for doing … | |
Re: How would I build a web page similar to an online banking page that has a running account balance, only I want to make each line editable. If a specific line was edited the total would then change up through the top. (transactions are sorted by date order) How do … | |
Re: Are these account numbers unique to the whole system, or is it acceptable that in each of those 6 tables the AI will start at 1? | |
Re: The way this is done, is using a database of zipcodes with geographic information attached, latitude and longitude. Given a user's zipcode, its a matter of finding all zipcodes within a certain distance, say 10 miles, and then any store which has a location within those zipcodes. Here is a … | |
Re: PHP is server-side. It can ONLY work with the directory structure on the server. This sounds like something for a client-side language like javascript, but I imagine there are security restrictions in place in most/all browsers to prevent or hinder the ability to recurse through the user's harddrive. Can't say … | |
Re: PHP is a server-side language. It could care less what browser you are using. I'm going to take a total shot in the dark and say if this works in FF and not in IE then it has something to do with how the data is being passed from your … | |
Re: [CODE=php] <?php //Set date according to formats accepted by strtotime //Set timezone to use $day = new DateTime('yyyy-mm-dd', new DateTimeZone('America/New York')); //Modify to one month in future $day->modify('+1 month'); //Display updated date echo $day->format('Y-m-d'); [/CODE] This isn't tested. but the date() function in php does not return an object and … | |
Re: What exactly are you trying to get out of the url? Perhaps there is a more efficient way to obtain it. Can you post and example url? | |
Re: Bill, Having little if any biology background, can you tell does your relational tree have multiple parents like a family tree? [CODE=text] [A] [B] |_____| | ------------- | | | [C] [D] [E] [/CODE] or does a tree only have one parent in your use case? [CODE=text] [A] | ------------ … | |
Re: [CODE=text] SELECT SUM( table.column ) as `downloads` [/CODE] Without more information that is as specific as I can get | |
Re: If you want a truly universally unique identifier (UUID) then check out this post on the php.net site. [url]http://www.php.net/manual/en/function.uniqid.php#94959[/url] MySQL 5.x also has support for UUID's [url]http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html#function_uuid[/url] There is also a UUID pecl extension. [url]http://pecl.php.net/package/uuid[/url] | |
Re: -virtual This is a perfect use of the RecursiveArrayIterator in the PHP5 SPL. You are using PHP5 right? [CODE=PHP] <?php $root = array( "paa" => array ( "adi1" => array ( "cir1" => array ( "aka", "ra", "vinodh","dkido" ), "cir2" => array ( "muta", "la" ), "cir3" => array ( … | |
Re: Normally I would suggest building it and learning it and making it work because you'll get the most out of it, but email especially html and attachments are one of the things in PHP I'd suggest referring to a library built specifically for it. In the long run you'll save … ![]() | |
Re: None of what was explored here is url encoding. URL encoding means encoding characters that not safe to be passed in the url, for example a "/" or a "+". When you url encode a url you encode those in hex or decimal format. "/" => %2F => %47. For … | |
Re: An ampersand will definitely cause problems in the value of a node in XML. So will < and > etc. modify the script to translate those characters to their character references & > etc etc. Read this: [url]http://www.xml.com/pub/a/2001/01/31/qanda.html[/url] | |
Re: I'm going to assume you're using PHP 5...this will not work otherwise. First off here is the test CSV file I used based on what you provided: (test.csv) [CODE] Example name1;3rd July 2010;21:08;Example of a comment 1 Example name2;4th July 2010;22:08;Example of a comment 2 Example name3;4th July 2010;23:08;Example of … | |
Re: Personally I would use the DirectoryIterator SPL object. [url]http://www.php.net/manual/en/class.directoryiterator.php[/url] | |
Re: You could also override the default session handler, and set it up to instead use a database table to store sessions. A count of the rows in the table will yield your currently active session list. This also sets you up to be able to use your sessions across multiple … | |
Re: Can you post an example of the XML and also what you're currently trying to do with the xml? I have done extensive work with XML perhaps I can answer your question. | |
Re: just fyi, ereg is depreciated as of 5.3 and will throw a notice. Use the pcre set of functions. [url]http://www.php.net/manual/en/ref.pcre.php[/url] | |
Re: I'll give it some time, but agree with about 90% of the criticisms posted above. It looks like the site has taken several steps backwards. Since no one else mentioned it, unless I missed it, has anyone else had this weird chrome glitch? Quite obnoxious when you instantly lose a … | |
Re: There is no comparison between OOP and structural php programming in my mind. OOP is composed of most of the concepts and functionality that is "structural" programming. OOP does not magically make your code more maintainable and it does not make it any more organized. A good understanding of the … | |
Re: [CODE=php] <?php //Check if $_GET['p'] is set if not return empty string $action = (isset($_GET['p']) === TRUE? strtolower($_GET['p']) : ''); switch($action){ case 'submit': //Accessed as form.php?p=submit //Process the form, save to db, etc. break; default: //Accessed as form.php //Display the form or show a homepage break; } [/CODE] Set your … | |
Re: Your problem is in the IF/ELSE conditional. Because it is doing a search for each line in the file, it is generating output for each line in the file. Instead of outputting the result or failure in the for loop, assign the result to an array like: $result[] = 'link … | |
Re: This can be handled with a single query and without all of the conditionals and select queries to determine the current counter value. [CODE=SQL] INSERT INTO memberst (id, counter) VALUES ('', 1) ON DUPLICATE KEY UPDATE counter = counter+1 [/CODE] If the record exists increment it by 1, if the … | |
Re: I assume you already have a relatively solid understanding of PHP's basics. e.g. Functions, Variables, Includes etc. Great place to start is the manual. [URL="http://php.net/manual/en/language.oop5.php"]http://php.net/manual/en/language.oop5.php[/URL] Once you feel you have a good understanding of how OOP works in general, I find the SPL (Standard PHP Library) to be extremely useful … | |
Re: You have the single quote inside double quotes you do not need to escape it. Right now the function it looking for ' to replace with ’ [CODE=php]$data=str_replace("’","'",$data);[/CODE] | |
Re: [QUOTE=ardav;1217413]You need to ensure you have the right data structure and data types. For example, if you're storing protein sequences, you may go over the 256 character limit of varchar types. Data entered will be truncated. You then need to use one of the text types.[/QUOTE] This is no longer … ![]() | |
Re: You can not have more than one auto-increment column in the same table in MySQL. You could however do something like: [CODE=SQL] /* Table +-----------+------------+ | RowId (AI)| RowCount | +-----------+------------+ | 1 | 37 | +-----------+------------+ | 2 | 51 | +-----------+------------+ | 3 | 26 | +-----------+------------+ */ … | |
Re: In general that article looks like it touches on most of the basics however I disagree with some of their basic security methods [LIST] [*]Handle errors gracefully No production environment should ever be running with error_reporting enabled. This being disabled will prevent php from displaying errors or returning query issues. … | |
![]() | Re: you're missing a [ in $_REQUEST"text"] change it to $_REQUEST["text"] ![]() |
Re: Does the server you have uploaded your files to have mod_rewrite enabled for apache? | |
Re: Has anyone else ever taken the XML/XSL approach? I found generating XML representations of my output and using XSL style sheets to do the transformations with the php XSL extension to quite powerful and surprisingly fast. It also truly separates your php from your template while also being a w3 … | |
Re: To my understanding, this is exactly how MyISAM and InnoDB both work with slight differences. MyISAM locks the entire table while InnoDB locks a row during an insert/update. It appears you can manually lock and unlock a table for a query though if necessary. [url]http://dev.mysql.com/doc/refman/5.0/en/lock-tables.html[/url] Some info on table locking … | |
Re: Depending on the complexity of the directory structure you're trying to navigate i'd recommend looking at the Standard PHP Library (SPL) specifically at [URL="http://php.net/manual/en/class.directoryiterator.php"]DirectoryIterator[/URL] and [URL="http://www.php.net/manual/en/class.recursivedirectoryiterator.php"]RecursiveDirectoryIterator[/URL] They're going to greatly simplify navigating very complex hierarchies. The other thing that is nice is you can always wrap them with a filter … | |
Re: jpGraph is a very full featured and very powerful graphing library. Its not flashy and its not going to produce flash charts but it definitely gets the job done. If you do want some fancier charts but still want to be able to use the system without relying on google's … | |
Re: Check out Plupload. It is a very interesting offering that allows you to configure a file uploader using a variety of different runtimes. Flash, Gears, Silverlight, HTML5, HTML4, etc. [url]http://www.plupload.com/index.php[/url] | |
Re: You could also use a PHP 5 DirectoryIterator from the SPL library. [CODE=php] $iterator = new DirectoryIterator('/path/to/directory/'); foreach($iterator as $fileinfo){ if( !$fileinfo->isDot() && $fileinfo->isFile() ){ echo $fileinfo->getPathname(); } } [/CODE] DirectoryIterators implement the SplFileInfo class ([url]http://www.php.net/manual/en/class.splfileinfo.php[/url]) so anything available there is also immediately available in $fileinfo From my quick tests … | |
Re: I believe what you're looking for is something like the following [CODE] RewriteRule !\.(js|ico|gif|jpg|png|css)$ /index.php [/CODE] Where any request which is not for a file of those types is routed to index.php (You would need to add pdf to that) But I think a better solution would be to use … | |
Re: [QUOTE=terry.b;823734]In my previous post, you need to add a line to initialize $newstr. Corrected code should be as follows: function StripExtraSpace($s) { $newstr = ""; for($i = 0; $i < strlen($s); $i++) { $newstr = $newstr . substr($s, $i, 1); if(substr($s, $i, 1) == ' ') while(substr($s, $i + 1, … | |
Re: This is not an IE issue. Get yourself Firebug for Firefox and the IE Developer Toolbar for IE7 -- maybe 6 and 8? When I run through the example on firefox it is not removing the li tags from the list when i deselect a tag, just the input and … | |
Re: [url]http://www.webhostingtalk.com[/url] read through their shared hosting offers forum or reseller or whatever you're looking for then search those companies on their site and read through topics about the host. Probably one of the most robust resources when it comes to host selection that I've found. If you want to avoid … | |
Re: [URL="http://www.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members"]http://www.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members[/URL] | |
Re: [QUOTE=evstevemd;1076838]I'm just curious to see what are favorite PHPers in terms of the following: 1. What is your favorite IDE (If you can tell why you love it, it will ice the cake)? 2. What is your favorite JS/PHP libraries (I would love to hear why) 3. What PHP framework … | |
Re: You could verify the credit card number using the Luhn Algorithm. [url]http://en.wikipedia.org/wiki/Luhn_algorithm[/url] There is a link at the bottom for an example of a php algorithm. There are some resources I have seen online that describe the particulars of most major card providers in terms of length of card number, … | |
Re: if you're making the form submit to itself then you need to make the index action in the index controller look for post data so it knows it needs to validate the form. [code=php] <?php class IndexController extends Zend_Controller_Action { public function indexAction() { $form = new Default_Form_Index(); $request = … | |
Re: Manipulating the user's screen in anyway is something that should be avoided at all costs. Imagine you were to visit a site, that has a layout designed for 640 x 480, but instead of showing you the whitespace they hijacked your browser window and shrunk the display down to a … |
The End.