php

how to write a codesniffer that accepts tabs only?

hi i want a codesniff for php_codesniffer that checks for indentation using just tabs. i tried to modify the generic codesniff that disallows tabs, but i cannot get it to work. it seems to highlight statements where i use spaces and tabs as well. any advice? ...

how to send tweet to non followers?

I have a site.and i want to tweet to non followers from my site without going to twitter site. how can do this. Please help me? ...

How to disable magento online sales functionality?

Hi there, I am implementing Magento Community edition and want to disable the "add to cart" functionality temporarily until i am prepared to proceed with online orders. I wanted to use Magento without checkout and add to cart functionality. Please advice. SIA ...

Sending forgot password emails

I am building a service that will have a 'forgot my password' feature. In addition to that, it will also email users when results are ready from my service. I would like to ensure delivery of my emails so I was looking around to find a service that would let me send emails. All that I've been able to find so far are services that requ...

Virtual function - including some html

Hello, I have a php-file which includes another html-file: <? virtual("../top.html");?> The problem is that any code before this include compiles and runs well, after - nothing. There aren't any errors etc. After commenting this line, everything works. Code was written under local computer with ArchLinux + LAMP. Now I have ubuntu 10....

Get the full result

Is there a PHP function to get the full result with a mysql query in a multidimensional array? SELECT * FROM table Usually I would make something like this: $query = mysql_query = ("SELECT * FROM table"); while ($result = mysql_fetch_array($query){ echo $result[0]; } ...

add a number in while loop

if ($num_rows > 0) { while($row=mysql_fetch_assoc($res)) { $fromuser=$row['username']; $comment=$row['comment']; $commentdate=$row['date']; $date=strtotime($commentdate); ...

Incorrect table name, php/mysql

Hi guys, I've got this code mysqli_query ( $userdatabase, 'CREATE TABLE `user_'.$emailreg.'` ( ID int NOT NULL AUTO_INCREMENT PRIMARY KEY, IP varchar(10), FLD1 varchar(20), FLD2 varchar(40), FLD3 varchar(25), FLD4 varchar(25), FLD5 varchar(25) )' ); echo ...

Drupal: how to set collapsed property for edit-content fields

hi, is there any interface to decide which fields should be collapsed and which ones not in content pages ? i.e. Tags is collapsed Menu Settings is expanded, Authoring is expanded.. I would like the opposite. thanks Updated: Taxonomy super-select field (how can I refer to this field ('taxonomy' is not working)) <div class="taxonomy-s...

Validation library PHP / Javascript

Hi, could someone recommend a PHP form validation library (that works independently outside of any php framework) that apart from doing all sort of basic validation (is empty, vs regex, is email, is alphanumeric and so on) can produce javascript code (ideally to work with jquery) to validate the very same form with the very same rules c...

How can I scrape the current webpage with php/javascript?

I have made the following webpage for generating interactive todo lists: http://robert-kent.com/todo/todo.php Basically, the user pastes a numbered todo list and each task is placed into it's own div with a unique id. Users can add notes to the tasks (done with javascript) and can click the green check when the task is done to hide it. ...

Using $this when not in object context

I'm creating a function to show blog's. So I made a show blog function but it keeps giving "Using $this when not in object context" error Class Blog{ public function getLatestBlogsBig($cat = null){ $sqlString = "SELECT blog_id FROM jab_blog"; if($cat != null) $sqlString .= " WHERE blog_cat = " . $cat; ...

How to execute a large PHP Script ?

Well basically I may want to execute a script that may take as much as 1 hours as well. What I really want to do is Send SMS to my users using a third party API. So its basically like I supply my script with an array of phone numbers and fire the method to send SMS. However assuming it take 5 seconds to send 1 SMS and I want to send 10...

How to determine the max file upload limit in php

How can the file upload size allowed by php settings be determined withing a php script? ...

building SQL Query From another Query in php

When I Try to built Query from another Query in php code I Faced some problem can you tell me why? :( code : $First="SELECT ro.RoomID, ro.RoomName, ro.RoomLogo, jr.RoomID, jr.MemberID, ro.RoomDescription FROM joinroom jr,rooms ro where (ro...

Call to a member function fetch_assoc() on a non-object

I'm a super beginner. I did find related questions here but I think they're too advanced for my skills. :-( Here's my function: function get_fname($un){ $registerquery = $this->conn->query("SELECT f_name FROM tz_members WHERE usr='".$un."'"); while ($row = $registerquery->fetch_assoc()) { return $fname = $...

How to learn php language?

Possible Duplicate: Learning PHP for fun and profit I am a student , I want to learn php language,but I don't know how to start? ...

To know whether a web page is built using PHP, JSP, ASP.NET, or other technologies

Hi, I often come across some nice web sites and I want to know what technologies (PHP, JSP, ASP.NET, etc) are used to build those web sites. The web address of some web sites end with ".aspx", ".php", ".jsp", etc. But some web address do not contains any indicators. Is there any systematic way we can use to know the technologies used ...

Grouping php array items based on user and created time

This is an array of objects showing a user uploading photos: Array ( [12] => stdClass Object ( [type] => photo [created] => 2010-05-14 23:36:41 [user] => stdClass Object ( [id] => 760 [username] => mrsmith ) ...

PHP - static DB class vs DB singleton object

I don't want to create a discussion about singleton better than static or better than global, etc. I read dozens of questions about it on SO, but I couldn't come up with an answer to this SPECIFIC question, so I hope someone could now illuminate me buy answering this question with one (or more) real simple EXAMPLES, and not theoretical d...