php

Creating a single hyperlink from 2 mysql table entries using php

I have a mysql table containing the values for 'display' and 'link'. I'd like to pull these into a php file that displays the 'display' value which hyperlinks to the 'link' value I have already connected to the database and selected the appropriate rows to display, but I'm at a loss on how to create the php for this.. As you can prob...

ajax form validation

Hi, I have created a script which checks if an email is valid. I have another function which checks if a username is taken. When checking both textboxes I get 'error on page' if these are checked on there own it works fine. Below is my code <script type="text/javascript"> function AjaxFunction() { var httpxml; try { // Firefox, Opera 8...

What are the best techniques for making my LAMP sites download faster?

Hi Everyone I have a few sites I built for my work, nothing major, mainly just little tools which people can access and use when they're out of the office. I'm not very experienced as a developer but I like to tinker quite a lot and I was wondering if anyone had any clever little tweaks I could do to my sites to make them download faste...

XML node with Mixed Content using PHP DOM

Is there a way to create a node that has mixed XML content in it with the PHP DOM? ...

What are some precautions a LAMP application should undertake on initialisation?

I want to write a PHP application that is going to do some checks first, to ensure an optimal and secure environment. I'm sure I alone can not think of everything, so what am I missing? Ensure MySQL username/password can SELECT, INSERT etc Update PHP timezone Check for register_globals and warn if enabled Ensure /install is deleted If ...

which mvc or engine should i start on?

i have been programming php modules and websites from scratch and building sites for customers is taking forver. people have told me to stick to an mvc or engine like (joomla,wordpress,drupal, etc). what I'm wondering is since i'm new to all this which one do you guys prefer i start with? an mvc or an engine (joomla,wordpress etc...) ...

Parsing Dates with PHP

i am trying to write a program but i have no idea what to with parsing a date in this format into into a date stamp Jan 15 2005 12:00AM i do not care about the 12:00AM as all the records have that 12:00AM appended to them. ...

my attempt at classes

class hello { var $fname; var $lname; function attrib() { $this->fname = "sarmen"; $this->lname = "dijango"; } function say() { $name = $this->fname.", ".$this->lname; return $name; } } this is my sample class when i include the class on a page and type something like this $d = new hello(); $d->say() no...

Professional Path for Beginner Programmer

I am 22 years old and I currently work for a small startup that does web design/development for a variety of clients. I do not have a post-secondary education. I started building websites for fun when I was about 13 years old, doing HTML markup and some graphic design. I know enough about things like CSS, JavaScript and XML to use them d...

print another page from the current page passing a value

hi i need to validate the next page before printing it ... what i did is i used i frame in the first page and called the page i needed to print but it fired the query in the first page which should have been fire in the second page after the submission or click of the button ... so i need to fire the php function after the button click...

How to serve .flv files using PHP?

Hi, I'm building a streaming video site. The idea is that the customers should pay for a membership, login to the system, and be able to view the videos. I'm going with FlowPlayer for showing the actual videos. The problem now is, the videos need to be stored somewhere publically and the url to the .flv files needs to be passed to flo...

Generating Private, Unique, Secure URLs

I'd like to generate a secure one-click-access type of url similar to the examples below. I'll be using PHP but that is irrelevant as I'm just looking to understand the underlying concept. Some answers suggest using a GUID, but I don't think that will give me an absolutely unique, secure URL like below. # Google Calendar 3qq6jlu04ptl...

problem accessing an iframe that was called using ajax

hi, i called an iframe using ajax onto the current page and tried to print the page but is printing blank page can somebody help me with this what i did was: current page: <input type="button" onclick=verifyControl('1001') > <div id='pa_print'></div> js file function: function verifyControl(rNo) { xmlHttp=GetXmlHttpObject(); ...

How to include() all PHP files from a directory?

Very quick n00b question, in PHP can I include a directory of scripts. i.e. Instead of: include('classes/Class1.php'); include('classes/Class2.php'); is there something like: include('classes/*'); Couldn't seem to find a good way of including a collection of about 10 sub-classes for a particular class. ...

CakePHP Gurus: Console cake command not finding -app path correctly?

I've installed the CakePHP core files in this folder: /home/iopener/webapps/cake_1.2.1.8004 I've got my app installed here: /home/iopener/webapps/Smasholi.com/app The cake console command is in my path, and runs fine, but it seems to be ignoring any attempt to point it to the correct -app folder. If I run 'cake' from inside the app f...

Combining recursive iterator results: children with parents

I'm trying to iterate over a directory which contains loads of PHP files, and detect what classes are defined in each file. Consider the following: $php_files_and_content = new PhpFileAndContentIterator($dir); foreach($php_files_and_content as $filepath => $sourceCode) { // echo $filepath, $sourceCode } The above $php_files_and_c...

Perform UPDATE and setting a user variable in one single query.

Everyone familiar with php's mysql_query command, knows that it doesn't allow us to perform more than one query (separated by the ; delimiter) in one call... My problem is that I wan't to be able to define a user variable in my UPDATE query so that I increment it for each row (kinda like auto increment). It should look like something as...

Dynamic include

<?php // Default page if (!$_SERVER['QUERY_STRING']) $Page = "news"; // View elseif (isset($_GET['newsID'])) $Page = "newsView"; elseif (isset($_GET['userID'])) $Page = "profile"; elseif (isset($_GET['messageID'])) $Page = "message"; elseif (isset($_GET['threadID'])) $Page = "thread"; elseif (isset($_GET['forumID'])) $Page = "forum"; el...

In CodeIgniter is it ok to use $this->load->model() as often as needed?

Basically I have lots of code in models and although the model might've been loaded elsewhere I like to make sure by doing $this->load->model() almost everywhere its used. Is that all right, or does it use up any resources even if the model has already been loaded? ...

Good PHP framework for beginner PHP Developer?

I'm starting a project in my spare time and I'd like to use PHP. I'd like to use some form of framework to speed things up. The problem is that I don't know very much PHP, I've used it and I'm familiar with the syntax etc, I'm just not fully in my comfort zone while using it. Is there a good PHP framework for people who know enough PHP...