428 Posted Topics
Re: You could also used the list construct. [url]http://php.net/manual/en/function.list.php[/url] | |
Re: If you're developing a web based application, than an architectural requirement is an internet connection. This really can't be avoided. In the case of using lower-end connections a load balancing router with connections to two or more separate ISPs would be the best way to overcome the coincidental downtime. Most … | |
Re: You could serve up an alternative image in its place via .htaccess but you can't force a page that displays your image to redirect to your website. | |
Re: Foreign keys are only relevant when the database tables are InnoDB. MyISAM does not support foreign key relationships in any way. If you are using InnoDB you absolutely should be using the FK constraints for ON UPDATE and ON DELETE. These allow you to enforce your business rules on your … | |
Re: [url]http://us3.php.net/variables.external[/url] Explains why those periods are converted to underscores. Through the comments there are also other characters that are mentioned that appear to be converted as well. | |
Re: My experience is the same as pritaeas. | |
Re: Look at the Zend PHP 5.3 Certification Study Guide. ([url]http://www.zend.com/topics/PHP-5-3-Study-Guide-v1.pdf[/url]) Covers a broad range of topics and they have some very good questions that really make you think about what you're seeing. e.g. What is the output of this code? [CODE] $a = 1; ++$a; $a *= $a; echo $a--; … | |
Re: The eregi functions are deprecated in php 5.3 and since the php development team has officially announced the end of support for php 5.2.x you should update this function to use the preg_ functions instead of ereg. [url]http://www.php.net/manual/en/ref.pcre.php[/url] | |
Re: You are redeclaring your variables inside your loops. If you're looping over $result and than within that loop are setting $result to another value it will screw up the loop. | |
Re: This would be the absolute wrong way to go about this. You would be left with multiple copies of outdated code as soon as your updated your template to resolve any bugs/security holes etc. I'm not sure what you're pages will be displaying, I'm going to assume its for a … | |
Re: This seems like it has two parts to me. To make dealing with the session data easier, implementing a custom session handler which stores the sessions in the database would be the first step. [url]http://www.php.net/manual/en/function.session-set-save-handler.php[/url] [url]http://www.nateklaiber.com/blog/2006/05/10/custom-php-session-handler[/url] [url]http://devzone.zend.com/article/141[/url] Once you have that in place, you want to associate a logged in … | |
![]() | |
Re: Depends on the functionality you want to implement and your skill level. Drupal is a beast of a system. But in comparison starting from scratch to effectively build all of the same functionality will be a massive undertaking. | |
Re: You have two options, you can store the images in mysql itself, which I would not recommend, or you can upload the images to your server and store the paths to the user's images in mysql. When a user hits a profile, it would query the database for 1 or … | |
Re: You need to use a .htaccess file (assuming you're using apache) and setup rewrite rules. [CODE] RewriteEngine On RewriteRule ^get/([0-9]+)$ get.php?id=$1 [NC,L] [/CODE] Something like that will probably get you what you want. | |
Re: [url]http://php.net/manual/en/function.mysql-query.php[/url] Look at example #2 | |
Re: I don't think there is really a best practice for handling variables. It really depends on the scope requirements of the variables. If you prefer to work with many individual variables than continue to use $var1, $var2, etc etc. If you don't like having so many loose variables, you could … | |
Re: Speculating here, but you could possibly make it check the referrer. I'm not sure if window.open will pass a referrer though. | |
Re: My experience with barcode scanners is fairly limited, but anything that is a standard usb scanner has always outputted whatever was scanned as if it was typed by a keyboard. Any of the scanners I have used (only a few) were able to be configured to to automatically add a … | |
Re: You have a few options: 1.) You can upload the files outside of the document root which will make them unaccessible via url. But, if you offer downloads you will have to do it via a php script. 2.) You can use a .htaccess file with a FileMatch directive to … | |
Re: I know this will probably be a more advanced response than what you are looking for but there are a lot of advantages to this kind of code in terms of re-usability. So I'm going to post this hoping it helps you as well as anyone else who needs to … | |
Re: The above SQL is wrong. The correct statement would be: [CODE]SELECT SUM(Price) Total FROM table_name[/CODE] This aliases the result of SUM(Price) to the column Total for easier reference. More info on aliasing columns: [url]http://dev.mysql.com/doc/refman/5.0/en/select.html[/url] | |
![]() | Re: Well both strtolower and strtoupper are not UTF-8 compatible but I believe you already knew this. [url]http://www.phpwact.org/php/i18n/utf-8[/url] is a great resource for the compatability of utf-8 with the current string functions in php. I get the same results as you when I put my own test together using a recommended … ![]() |
| |
Re: [QUOTE=HG&C;1453356]for ease of sql queries and such I would make a table called friends with only 3 fields: id, friend1, friend2 (although you could name it more appropriately) anyways for each and every user/friend store their id in friend1 and their friend's id in friend2. this means that each time … | |
| |
Re: How proficient are you with MySQL and PHP? There are usually two ways I see this solved. The easier to grasp of the two being recursion and the more complex but powerful would be using something like Modified Preorder Tree Traversal (MPTT). I was not aware Oracle supported a native … | |
Re: [url]http://php.net/manual/en/function.is-int.php[/url] Examples should pretty much show you what you want. No sense in reiterating them here. | |
Re: You can alleviate this problem by using a UUID or hashing the UUID for your activation key. [url]http://en.wikipedia.org/wiki/Universally_unique_identifier[/url] There are several php modules that do this, but I've been using a pure PHP implementation with a lot of success Class: [url]http://www.shapeshifter.se/wp-content/uploads/2008/09/classuuid.phps[/url] Usage: [url]http://www.shapeshifter.se/2008/09/29/uuid-generator-for-php/[/url] Check out the probability getting a duplicate … | |
Re: if the mysql server is on the same machine as your php code than localhost will most likely be your database server. If the mysql server is on a remote machine, you will need to use an ip or hostname and probably a port to connect. In *most* hosting environments … | |
Re: [url]http://www.w3.org/TR/html401/struct/global.html#edef-HTML[/url] It is the root element of any html document | |
Re: In my opinion you will probably have much more flexibility on a local machine than on a hosted solution. There are a few pain points I have encountered before though. First, if your app is running a command line utility make sure it is available on all platforms or make … | |
Re: For starters unless $_POST['textfield'] is only a single character ord() will not work. Secondly it only returns ascii values. [url]http://www.asciitable.com/[/url] I assume the characters you would be using are in the utf-8 spec. There are some functions posted in the manual: [url]http://php.net/manual/en/function.ord.php[/url] that seem to indicate utf-8 compatibility. | |
Re: What is the use case for something like this? It seems trivial to implement something like this within the function. [CODE] function someFucntion($a, $b, $c, $d = null) { //Set $d to $b if $d is not set if( is_null($d) === true ){$d = $b;} ... } [/CODE] and if … | |
Re: Development platform aside, you want to start by understanding the domain you're trying to work in. In this case you would want to look at other booking systems and get an understanding of how the leisure center does business. Once you have a good understanding of their processes, begin by … | |
Re: A module is going to be an almost self-contained application made of models, views, controllers, components etc. | |
Re: Depends on your definition of a "module" judging by what you've outlined and what ardav also outlined, I would say those are more like the objects that belong in the service level of your application. Either way, there is no defined list of "must have" functionality. Design your application and … | |
Re: It looks like someone created a function that essentially does what mkdir ([url]http://php.net/manual/en/function.mkdir.php[/url]) already does with its recursive flag. | |
Re: I assume you're trying to provide a web frontend to some kind of form the user would fill out manually. In which case you could create a fillable pdf version of your form. This way it is visually identical to the form that would be filled out on paper. Using … | |
Re: Hopefully this illustrates something that might get you on your way. I also applied some corrections to your code in general. Tried to comment as much as possible. [CODE] //THERE IS A FORM ON ANOTHER PAGE WITH TEXTBOX NAMED "search", //THAT COMES TO THIS PAGE. //Global variables should be CAPITALIZED … | |
Re: Define what you mean by "dynamic array" ? ![]() | |
Re: Create hashes for the common fields that change. I'm thinking the title and content/body of each article. Store these two hashes with each item in your database. When you process the feed again, generate the same hashes and look for any records where both hashes match. If you find a … | |
Re: I agree it entirely depends on what the function is doing. However I disagree with the code example. If you're going to write classes you should be using PHP 5 syntax. [LIST] [*]No reason to have a constructor as the variables default to 'NULL' you could also default them in … | |
Re: There is nothing php related that can just push files to a user's computer without the user's interaction. The same goes for anything built around javascript and php. The user would need some kind of client on their pc that could interact with your server and handle the transfer. | |
Re: [QUOTE=sutt0n;1441556]Yep, pretty much anything's possible in today's programming world. You just have to concentrate. First off, since PHP would try to subtract that [icode]$date[/icode] variable, we need to make it a string so make it this: [code=php]$date = '1990-12-3';[/code] It also seems you've mispelled a function in your code (mysqli_query … | |
Re: Do you need to use cURL for this? Why not use the FTP functions in php? [url]http://php.net/manual/en/book.ftp.php[/url] You could also use the ftp://wrapper [url]http://docs.php.net/manual/en/wrappers.ftp.php[/url] with the filesystem functions | |
Re: Can you access mysql via the command line? If so can you successfully log in as your root user? | |
Re: This is really the wrong place for a thread like this... But, since I'm already here, domain names are a dime a dozen in my experience. Prices are usually within a couple bucks of one another. Personally most of my domains are registered through 1and1.com these days. Godaddy has a … | |
Re: Naming your constructor method the same as the class, although not technically incorrect, should be avoided. With PHP 5 you have the __construct() method for this particular purpose. When a class can not find a defined __construct() method it will, for backwards compatibility reasons, look for a function named identical … |
The End.