428 Posted Topics

Member Avatar for fuston05

You could also used the list construct. [url]http://php.net/manual/en/function.list.php[/url]

Member Avatar for mschroeder
0
81
Member Avatar for john0563

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 …

Member Avatar for vsmash
0
597
Member Avatar for RicardoE

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.

Member Avatar for RicardoE
0
151
Member Avatar for jrotunda85

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 …

Member Avatar for smantscheff
0
2K
Member Avatar for OmniX

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

Member Avatar for OmniX
0
164
Member Avatar for veledrom
Member Avatar for robinthomas

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

Member Avatar for mschroeder
0
194
Member Avatar for jakizak

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]

Member Avatar for jakizak
0
160
Member Avatar for tcollins412

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.

Member Avatar for mschroeder
0
93
Member Avatar for AMADH

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 …

Member Avatar for pixelsoul
0
826
Member Avatar for Suzie999

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 …

Member Avatar for Suzie999
0
223
Member Avatar for panhwer
Member Avatar for diafol
0
92
Member Avatar for arctushar

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.

Member Avatar for HemantPHP
0
106
Member Avatar for tcollins412

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 …

Member Avatar for lyrico
0
125
Member Avatar for Misklahr

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.

Member Avatar for Misklahr
0
101
Member Avatar for tcollins412

[url]http://php.net/manual/en/function.mysql-query.php[/url] Look at example #2

Member Avatar for lyrico
0
120
Member Avatar for fuston05

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 …

Member Avatar for fuston05
0
126
Member Avatar for Buppy

Speculating here, but you could possibly make it check the referrer. I'm not sure if window.open will pass a referrer though.

Member Avatar for Buppy
0
231
Member Avatar for veledrom

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 …

Member Avatar for mschroeder
0
2K
Member Avatar for Lapixx

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 …

Member Avatar for Lapixx
0
145
Member Avatar for Siege

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 …

Member Avatar for mschroeder
0
481
Member Avatar for dudzkie

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]

Member Avatar for mschroeder
0
90
Member Avatar for diafol

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 …

Member Avatar for diafol
0
5K
Member Avatar for Awah Mohamed
Member Avatar for mschroeder
0
62
Member Avatar for Awah Mohamed

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

Member Avatar for mschroeder
0
107
Member Avatar for fishcer
Member Avatar for anirban1087

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 …

Member Avatar for anirban1087
0
107
Member Avatar for opticblaze

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

Member Avatar for opticblaze
0
114
Member Avatar for phplover

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 …

Member Avatar for phplover
0
157
Member Avatar for cristi08

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 …

Member Avatar for cristi08
0
246
Member Avatar for zylog

[url]http://www.w3.org/TR/html401/struct/global.html#edef-HTML[/url] It is the root element of any html document

Member Avatar for mschroeder
0
53
Member Avatar for skald89

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 …

Member Avatar for mschroeder
0
124
Member Avatar for arctushar

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.

Member Avatar for mschroeder
0
83
Member Avatar for miketurpin

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 …

Member Avatar for miketurpin
0
251
Member Avatar for VikkiC

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 …

Member Avatar for VikkiC
0
744
Member Avatar for Agent Cosmic

A module is going to be an almost self-contained application made of models, views, controllers, components etc.

Member Avatar for Agent Cosmic
0
71
Member Avatar for PoisonedHeart

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 …

Member Avatar for PoisonedHeart
0
216
Member Avatar for dietdew12z

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.

Member Avatar for dietdew12z
0
111
Member Avatar for atutor

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 …

Member Avatar for mschroeder
0
104
Member Avatar for natchattack

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 …

Member Avatar for natchattack
0
147
Member Avatar for alfredferg
Member Avatar for youlichika

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 …

Member Avatar for mschroeder
0
97
Member Avatar for azegurb

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 …

Member Avatar for azegurb
0
109
Member Avatar for terrymold

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.

Member Avatar for cooperspc
0
821
Member Avatar for lf.gene

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

Member Avatar for mschroeder
0
630
Member Avatar for astroboy44

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

Member Avatar for astroboy44
0
1K
Member Avatar for MackeyJenkins
Member Avatar for Wattsits

Can you access mysql via the command line? If so can you successfully log in as your root user?

Member Avatar for Wattsits
0
86
Member Avatar for haloreachrankm

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 …

Member Avatar for chrishea
0
161
Member Avatar for sjgoodjob

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 …

Member Avatar for mschroeder
0
120

The End.