I'm trying to improve my PHP programming skills, can anyone give me any tips or direction based on this code that I wrote?
<?php
include("db.php");
include("function.php");
//variables
$number = htmlspecialchars($_POST['num']);
$date = date("Y-m-d");
//validate phone number
if (strlen($_POST['num']) != 12){
print "Invalid Phone Numbe...
I'm about to embark on a web startup project involving e-commerce. (somewhat similar to eBay). I've decided to use PHP as the programming language.
Is it recommended to use any PHP framework like CakePHP or Zend with MySQL database for this kind of project? Doing it from scratch can cause much pain and it will be time consuming.
Wh...
I have uncomment the following from the php.ini file
;extension=php_bz2.dll
extension=php_curl.dll
;extension=php_dba.dll
Also ,I have copied the php_curl.dll to windows\system32 and restart the apache server.
I am testing the follwoing script
<?php
$curl_handle=curl_init();
curl_setopt($curl_handle,CURLOPT_URL,'http://example.c...
Dear PHP and Qt experts,
I want to create a Qt application that takes a random integer and sends to the server to a specific file (say to process.php) in order to that file to answer to that Qt application if the number is odd or even. And when the Qt application gets the answer from the process.php, it gives a message box that tells th...
I have installed WAMP and enable some extension. After that i have installed eclipse for php. now my question how can i let eclipse now that i should use apache installation and the version of php which came with WAMP.
I will be developing web apps on windows.
...
I have a some modules and 1 layout. How can i do this thing?:
For each module content of the site should be individual.
...
Hey!
If my site ever goes live (don't think it will, its just a learning exercise at the moment).
I've been using mysql_real_escape_string(); on data from POST, SERVER and GET.
Also, I've been using intval(); on strings that must only be numbers.
I think this covers me from sql injection? Correct? Can i do more?
But, I'm not sure ho...
i am using Zend Framework. some techniques i use currently
Zend_Debug::dump() (+die())
Zend_Log: to firebug/firephp
i particularly like the log to firebug, but when logging large objects, eg. doctrine 2 models (with many associated objects etc), i find that it slows down and crashes alot.
what alternatives are out there?
i curre...
I need to use a regex pattern , but what is the right php "decode" . my pattern is "similar" to BBcode i.e. ['something'] the 'something' could be "any length" but realistically I doubt not more than 10 chars/numbers. What is the correct php syntax to "unscrambe" i.e.
if ($row->xyz =['something'] ):
do this
else:
do that
en...
I hesitate between using the name of the current setter versus using a common name (such as $value) for all setters.
// Style 1
function set_section($section);
// Style 2
function set_section($value);
...
I have never delt with proxies but now I have to. The program is a PHP parser that scraps several websites to retrieve need info. I just need to know how PHP programs work via proxies... how to make them work via proxies.
Thanks for any help!
...
Hi all,
I have a page in Wordpress that displays posts with a category of "newspaper" only. Now, The posts are ordered by descending order (I think, if that is the default), such that the newest is at the top.
This is the code that I have:
<?php $my_query = new WP_Query('category_name=newspaper&posts_per_page=-1'); ?>
<?php if (have_...
Is there a code analyzing utility that can do things like calculate the average variable length in a script or in a bunch of scripts? I'm obsessed with the linguistic aspect of programming. I'd be curious to see how different frameworks or CMSs compare in that aspect.
...
I have been doing WordPress themes for a while, but the straight forward ones. Now this new client wants a theme that has the login and reg form in the theme with a lightbox. I have previously seen login forms included in themes so I agreed to that and told him that the reg form cannot be done. Then I saw modernman. They've managed to br...
I have a script that, when put against a timer, gets progressively slower. It's fairly simple as all it does is reads a line, checks it then adds it to the database, then proceeds to the next line.
Here's the output of it gradually getting worse:
Record: #1,001 Memory: 1,355,360kb taking 1.84s
Record: #1,001 Memory: 1,355,360kb taking...
Hello All,
I have weirdest problem with PHP itself, that I've ever seen.
Setup:
PHP 5.33, (tried PHP 5.2.14 as well) under IIS
Problem:
PHP deletes all session data as soon as I put exclamation point into a key in session array.
Example:
session1.php
session_start();
$_SESSION["foo"] = 'test';
header('Location: session2.php');
s...
Hey, For some reason $password (the one being sent form the form) is coming up blank.
I am manually checking for this with this code:
echo "<p>$username does not match $firstandlast</p>";
echo "<p>$password does not match $dbpassword</p>";
here is my code...
<?php
if(isset ($_POST['submit'])) {
$username = $_POST['nam...
I am new to zend framework and having very basic doubt.I have created one application which follows its own framework. I want to integrate this application with zend framework. whenever any request comes to zend framework, I want to forward same request to my application to do some operations and then give control back to zend framework....
I'm new to php and sql. I have a table with three columns. One 256 bit hash number and two ints. I want to search for the row that matches my hash and then retrieve one int and increment the other. So, I thought I'd kill two birds with one stone by using first the UPDATE command.
$query = sprintf("UPDATE %s SET activationcount = (activ...
I'd like to install wordpress in another directory to the actual DocumentRoot so that I can keep it under version control but at the same time customise my wordpress site.
So I have a directory layout something like this
branches/
tags/
trunk/
index.php
wp-content/ < this is where I will have my customisations
vendors/
wordpress/...