Lastest News from PHPWomen Forum Latest

"Drupal Themers" in Dharamshala


at Srijan Technologies in Dharamshala, Himachal Pradesh

A Drupal themer? And disgusted with city life? Looking to slow down?

If you’re a Drupal themer, and the kinds who’s disgusted with large cities and city life; if you love the mountains and are a greenie; if you want to break away from the polluted air of Delhi/ Mumbai/ Hyderabad /Bangalore /Chennai but are stuck in these cities for lack of employment opportunities in small, quieter places – you just got lucky!

We’re looking for several Drupal developers to join our recently setup development center in Dharamshala, Himachal Pradesh.

Desired Skills & Experience:

1) Configure and customise Drupal modules, especially, Views, CCK, Panels
2) Create pixel-perfect CSS designs from PSD files provided
3)Work with Adaptive Theme or with one of the CSS Frameworks such as 960 GS, Blueprint, Yahoo! UI Library
4)Test and deliver cross-browser compatible CSS; preferably with IE6 as well
5) Work with jQuery

Company Description

Srijan is a kick-ass Drupal development company. An Acquia Enterprise Partner, it has built several large portals such as www.mnn.com, www.indiaenvironmentportal.org.in and www.openthemagazine.com. Srijan is an active community contributor and has organised several Drupal Camps and Meetups.
Srijan has a transparent and participative work culture that encourages innovation in work, dialogue in all facets of the company’s functioning, opportunity to learn and diversify into new technology areas, and coaching and hand-holding in managing work-life better.

To know more about Srijan’s Drupal competencies, please visit: http://drupal.org/node/1326760.

To apply for this job, visit http://www.srijan.in/careers
or contact jobs@srijan.in or varun@srijan.in

Published on: Tue, 07 Feb 2012 10:23:07 +0000
Read More >


Preventing duplicate entries, a how to


I'm new here and this is my first topic. I noticed that several different people brought up uniqueness of information in databases, primarily fixing this problem with unique indices, however some people mentioned instances such as forum posts where someone can refresh a page and have a post entered twice.

My solution to the problem was what I call "tasks." For example when someone goes to create a new forum topic post they're assigned a random sha256 hash. This hash is stored in a table and associated with their user ID. Further on the <form> itself, a hidden field is added with the task.

When they hit submit the task hash is checked against the database, if it's in there then the post is added as expected and the task is deleted. This way if they refresh or come back to the page improperly when the task is checked again, and it doesn't exist, they're told they cannot come back to this page or something fancy (depending on what's going on).

I express it thusly.. note this is partially pseudo-code to give a rough idea, be sure to review and rewrite based on your needs:

CREATE TABLE `tbltasks` (
  `ref_id` int(10) NOT NULL AUTO_INCREMENT,
  `user_id` int(10) NOT NULL DEFAULT '0',
  `task_id` char(64) NOT NULL DEFAULT '',
  `is_used` tinyint(1) NOT NULL DEFAULT '0',
  `set_time` int(12) NOT NULL DEFAULT '0',
  PRIMARY KEY (`ref_id`),
  UNIQUE KEY `task_id` (`task_id`),
  KEY `is_used` (`is_used`),
  KEY `set_time` (`set_time`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;


Instead of simply deleting the row, I update it is_used = 1, because deleting is expensive. I have a cronjob that runs every 6 hours to delete tasks that were never used at all (I always assume that more than 48 hours old means they'll never use it) and ones marked used.

The `ref_id` field serves two purposes, because it's InnoDB and has a key anyway, why not represent it so it can be used, but also when checking if the task exists, I'll demonstrate this in a moment.

Setting up the form
<?php
// $_USER is a global array where I typically store the user's session information.
$task_id = hash('sha256', microtime() . $GLOBALS['_USER']['user_id']);

// P.S. you can do INSERTs in the UPDATE syntax in MySQL. I find it easier, but if you want you can do it in the classic INSERT () VALUES (); way.
mysql_query('INSERT INTO `tbltasks` SET 
    `user_id` = ' . $GLOBALS['_USER']['user_id'] . ',
    `task_id` = \'' . $task_id . '\',
    `set_time` = UNIX_TIMESTAMP();');
?>
<form method="post" action="<?=$_SERVER['REQUEST_URI']?>">
<input type="text" name="title" value="" />
<textarea name="body" rows="4" cols="50"></textarea>
<input type="hidden" name="task_id" value="<?=$task_id?>" />
<input type="submit" name="post" value="Submit Post" />
</form>


Checking submission
<?php
if (isset($_POST['post"])) {
   $check = mysql_fetch_array(mysql_query(
     'SELECT `ref_id`,`user_id`,`is_used`
      FROM `tbltasks`
      WHERE `task_id` = \'' . mysql_real_escape_string($_POST['task_id']) . '\';'));

   if (!is_numeric($check['ref_id'])) {
      // task doesn't exist, tell user they can't submit
   }

   if ($check['user_id'] != $GLOBALS['_USER']['user_id']) {
      // task doesn't belong to that user, tell user they can't submit
   }

   if (1 == $check['is_used']) {
      // task has been used, tell user they can't submit
   }

   // Assuming you've got error control, if they've made it this far, we assume everything is fine
   mysql_query('UPDATE `tbltasks`
                SET `is_used` = 1
                WHERE `task_id` = \'' . mysql_real_escape_string($_POST['task_id']) . '\';'));
   // Like I said, I've got a cronjob that purges used/expired tasks, but you can delete if you'd like

   // INSERT your post data
}
?>


Once again the above code is partially pseudo-code as a demonstration. I have special functions I use for database interaction and created to make tasks easier to create and deal with, which I can share in another topic if anyone's interested. So, I cannot guarantee I got the syntax for mysql_* functions exactly right, because I almost never use them.

I hope this helps anyone that's been having trouble figuring out how to keep people from creating double posts.

Published on: Mon, 06 Feb 2012 14:48:00 +0000
Read More >


Re: Password encryption - Base64


If you insist on using two-way encryption, which as shown above there are better ways to do it, then I'd suggest something like blowfish via mcrypt. Except of course then you will have to keep the key you use safe, because if someone gets that, then they can decrypt the passwords anyway. But definitely no reason to use base64, with that you might as well just store it in plaintext as a blob.

Published on: Mon, 06 Feb 2012 14:19:15 +0000
Read More >


Re: PHP Framework


JohnyCharles wrote on Sat, 03 December 2011 05:46

Which of the Framework is best for developing PHP applications?
That depends on you. The one you're most familiar with will be the one you're most productive with. But many PHP programmers don't use frameworks at all - just an editor and a blank page.

Published on: Thu, 02 Feb 2012 20:02:11 +0000
Read More >


Re: problem in combine jquery and javascript in smarty


Look at the jQuery ajax() function - that will do what you need.

Published on: Thu, 02 Feb 2012 19:32:02 +0000
Read More >


Re: PHP form - Need direction


jacob001 wrote on Tue, 10 January 2012 00:45

I don't know what is AJAX or JS.
That's the second thing you're going to have to learn - AJAX and JS. The first thing you're going to have to learn is programming - things like algorithms and data structures. Grab a copy of Wirth's "Algorithims + Data Structures = Programs" - you can usually find a copy on Amazon for under US$10. Study it and learn programming.

JS is Javascript - a programming language used to write code that runs in the browser. (PHP runs on the server.) AJAX is an acronym for Asynchronous Javascript And XML. It can be synchronous or asynchronous, it can use XML, text, JSON (JavaScript Object Notation) and it doesn't even have to use Javascript.

But until you know how to write programs, the only way you'll get what you need is to have someone write the code for you. (And if the "answers" are going to be looked up, you'll have to learn SQL also.)

Published on: Thu, 02 Feb 2012 19:30:16 +0000
Read More >


Re: please help with php mysql database - maintenance?


If that's the only problem login, I'd check the strlen() of the login and reject anything less than 3 or so. (Silently - just tell the user it's a bad login or password, don't tell them that it has to be longer, or you'll get bogus logins like 12345.)

Published on: Thu, 02 Feb 2012 19:19:52 +0000
Read More >


PHP Programmers


PHP Programmers Available in Hourly Basis at vEmployee.

Service Type: Off Shore Programming

Type: Fixed Time/Part Time/ Full Time/ Hourly Basis

Published on: Mon, 30 Jan 2012 09:10:45 +0000
Read More >


please help with php mysql database - maintenance?


Hello,

I wonder if you could help me, i have a problem with bogus users on my site.

I created a register page where the details are sent to the database, this is fine but someone is registering with the username: 1 and password: 1 multiple times.

I have about 50 of these now and i would like to know what to actually search for (how to word it) to find out how to stop this?
What would be the name of the script?

If you need any more to go on please ask to me..

Thanks in advance
Jacob

Published on: Wed, 18 Jan 2012 08:34:48 +0000
Read More >


Female PHP Website & Database Developer(s) Needed! Baltimore, MD/D.C. area


Hello All,

I live in Columbia, MD and I'm currently looking for a female PHP Web and Database Developer(s) to provide me with a quote for a dating site that I've designed. The site was created with the interest of woman in mind, so it really would be ideal to work with one.

The site will be rolled out in 3 phases, so this first phase would have to be designed with the other two in mind. I would also need to talk about dedicated hosting options, how to handle uploaded and live streaming videos.

If you, or someone you know would be interested in a fun freelance project, please contact me or forward my info.

Thank you!

Nicole
410.707.2878

Published on: Mon, 16 Jan 2012 22:11:12 +0000
Read More >


Re: symfony plugin


The Jobeet tutorial has a section of turning the Jobeet application into a plugin which is very good..Check it out:

www.symfony-project.org/jobeet/1_4/Doctrine/en/20

Also check out this site:

sitepoint.com/symfony-beginners-tutorial/

Published on: Mon, 16 Jan 2012 09:57:18 +0000
Read More >


Sending Web Page through Email


Hi ladies,
How can I build a 'email this page to a friend' link in a web page.
The link should send the whole web page via email and the page may include images and css styling. Confused

Any ideas? Thanks in advance!

Published on: Thu, 12 Jan 2012 08:42:27 +0000
Read More >