428 Posted Topics

Member Avatar for ceeandcee

That echo statement works for me without any issue. Can you post what you are getting errors and/or output when you run it?

Member Avatar for ceeandcee
0
136
Member Avatar for julzk

***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); …

Member Avatar for kswsk
0
7K
Member Avatar for sarithak

You're probably looking for a multi-byte function. [url]http://php.net/manual/en/function.mb-substr.php[/url]

Member Avatar for mschroeder
0
146
Member Avatar for xor83

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 …

Member Avatar for xor83
0
305
Member Avatar for mikecronauer

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 …

Member Avatar for MooGeek
0
162
Member Avatar for heshanm

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?

Member Avatar for heshanm
0
121
Member Avatar for ryanwhite17

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 …

Member Avatar for Stefano Mtangoo
0
156
Member Avatar for devHelp

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 …

Member Avatar for mschroeder
0
150
Member Avatar for terrymold

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 …

Member Avatar for metalix
0
143
Member Avatar for dwssassin

[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 …

Member Avatar for metalix
0
1K
Member Avatar for kasakit

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?

Member Avatar for Mongooseman
0
294
Member Avatar for billmudry

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] | ------------ …

Member Avatar for mschroeder
0
277
Member Avatar for Smudly

[CODE=text] SELECT SUM( table.column ) as `downloads` [/CODE] Without more information that is as specific as I can get

Member Avatar for mschroeder
0
78
Member Avatar for dandixon

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]

Member Avatar for chintan@dani
0
119
Member Avatar for virtualvinodh

-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 ( …

Member Avatar for virtualvinodh
0
246
Member Avatar for fasharlht

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 …

Member Avatar for rajarajan2017
0
141
Member Avatar for mybluehair

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 …

Member Avatar for mschroeder
0
183
Member Avatar for bucktaylor

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 &amp; &gt; etc etc. Read this: [url]http://www.xml.com/pub/a/2001/01/31/qanda.html[/url]

Member Avatar for metalix
0
130
Member Avatar for ptemedia

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 …

Member Avatar for chrishea
0
2K
Member Avatar for seh1

Personally I would use the DirectoryIterator SPL object. [url]http://www.php.net/manual/en/class.directoryiterator.php[/url]

Member Avatar for mschroeder
0
171
Member Avatar for Dartz654

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 …

Member Avatar for mschroeder
0
109
Member Avatar for Mongooseman

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.

Member Avatar for Mongooseman
0
150
Member Avatar for sallecpt

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]

Member Avatar for sallecpt
0
211
Member Avatar for jephthah

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 …

Member Avatar for Dani
8
2K
Member Avatar for rutaba

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 …

Member Avatar for Usernamex235
0
163
Member Avatar for ramalc

[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 …

Member Avatar for ramalc
0
165
Member Avatar for Dragennd

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 …

Member Avatar for Dragennd
0
166
Member Avatar for LloydFarrell

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 …

Member Avatar for nonshatter
0
949
Member Avatar for dicksonkaranja
Re: OOP

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 …

Member Avatar for Virtualbase
0
83
Member Avatar for bsewell

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 &rsquo; [CODE=php]$data=str_replace("&rsquo;","'",$data);[/CODE]

Member Avatar for mschroeder
0
78
Member Avatar for stefano28

[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 …

Member Avatar for diafol
0
112
Member Avatar for MDanz

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 | +-----------+------------+ */ …

Member Avatar for mschroeder
0
80
Member Avatar for Stefano Mtangoo

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. …

Member Avatar for Stefano Mtangoo
0
90
Member Avatar for leegeorg07

you're missing a [ in $_REQUEST"text"] change it to $_REQUEST["text"]

Member Avatar for leegeorg07
0
6K
Member Avatar for bobbymoir

Does the server you have uploaded your files to have mod_rewrite enabled for apache?

Member Avatar for bobbymoir
0
160
Member Avatar for Stefano Mtangoo

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 …

Member Avatar for mschroeder
0
92
Member Avatar for nonshatter

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 …

Member Avatar for nonshatter
0
591
Member Avatar for Mestika

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 …

Member Avatar for mschroeder
0
312
Member Avatar for k2k

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 …

Member Avatar for furqan219
0
166
Member Avatar for rahul8590

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]

Member Avatar for Froger93
0
165
Member Avatar for SKANK!!!!!

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 …

Member Avatar for mschroeder
0
172
Member Avatar for lifeworks

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 …

Member Avatar for lifeworks
0
6K
Member Avatar for michael123

[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, …

Member Avatar for bhebs_quines
0
4K
Member Avatar for pritaeas

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 …

Member Avatar for pritaeas
0
303
Member Avatar for veledrom

[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 …

Member Avatar for mschroeder
0
898
Member Avatar for azegurb

[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]

Member Avatar for azegurb
0
107
Member Avatar for Stefano Mtangoo

[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 …

Member Avatar for FlashCreations
0
141
Member Avatar for Aamit

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, …

Member Avatar for mschroeder
0
269
Member Avatar for sugumarclick

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 = …

Member Avatar for sugumarclick
0
443
Member Avatar for chicago1985

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 …

Member Avatar for ITGuys!
0
230

The End.